From nobody Thu Nov 14 05:22:39 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43283+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1562251360; cv=none; d=zoho.com; s=zohoarc; b=H7csOKThdrDb8v+F2RZgvgbTWAleSUkegUFWBkMH0sO5+mznyvjvbVGJiddZ1skLY05iu5nOrouCDCksJJriU+l+uOa69G4PRgBRhcJyOq/fRdaPDaJr2fWRNm/UxZVuaICHPqI0nDocpkZ2KAIGZtJdpxZO0l7N9XKXYl+wDrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562251360; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=fLxfSwIbgDBFFaUCL3ePwt++406Rm/7nJRwYE4WwTkc=; b=hbo57Weq4BBg792b3ypgFOmn6Bp1B7ThDYJbB+rh5/oYIlxiokpBSpppnRUpgzqmUt5ALNuXQ2a3J9zyY5N9mJMwhRdNQjDxp1BWlq6HEv7YLyvPy35+J4U5JFlySVs5IMQDkjpYEJ8tS6epTauAd0oD0jekdQQOAyFMuXs5lRc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43283+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1562251360177730.4852878193471; Thu, 4 Jul 2019 07:42:40 -0700 (PDT) Return-Path: X-Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com []) by groups.io with SMTP; Thu, 04 Jul 2019 07:42:39 -0700 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43283+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: HdSXsIp65/UZA0y+tN7Ih+YP31aCQGHMs1rnNhF3SeUhEkQ/hJhff6kEKso41Qd6eK47rE5n3V jGfEdzSNARm4vrjD/l4T8oproKUzYxh39upQzUViHJj9zwnv/htqohYrcyZnoW+oNUbqd8DKRa zlbdXab06p3wyRIhbRBk2U7IlfEJRxAtERUDEv2OpSKPxBVSPeYbp8UtkDsJH7JFR0VwRo8p5g PK8vK8ITiJUEc6EDGzi8/tVRGMo73JaFeqK0qJEkqvwIQynRjOShqShDP3jCAqrScgj0oJgjry tuA= X-SBRS: 2.7 X-MesageID: 2588785 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,451,1557201600"; d="scan'208";a="2588785" From: "Anthony PERARD" To: CC: , Ard Biesheuvel , Jordan Justen , Laszlo Ersek , Julien Grall , Anthony PERARD Subject: [edk2-devel] [PATCH v3 07/35] OvmfPkg/XenResetVector: Saving start of day pointer for PVH guests Date: Thu, 4 Jul 2019 15:42:05 +0100 Message-ID: <20190704144233.27968-8-anthony.perard@citrix.com> In-Reply-To: <20190704144233.27968-1-anthony.perard@citrix.com> References: <20190704144233.27968-1-anthony.perard@citrix.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,anthony.perard@citrix.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1562251359; bh=7HJPR4uq4QGLzqCGlFSwInlCuMGRj9dSzDzZvTWQot0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=ZHAPxE/VK08NNh+XDUnjLi0JnsUbul6ujmsN3PV918ikO0kF8cVotA87U1j/j/q+NZ9 hgcVUGARIx4iZbY6uw5SQM62zWl4/uSbc/SEiKgb3MpuwxT/IJ1hKhcuInt3nOEHV5scg /dRjRYOOiY/qpM6iow5emMQgeJziLHUgZd0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" As described in the Xen PVH documentation [1], "ebx: contains the physical memory address where the loader has placed the boot start info structure". To have this pointer saved to be able to use it later in the PEI phase, we allocate some space in the MEMFD for it. We use 'XPVH' as a signature (for "Xen PVH"). [1] https://xenbits.xenproject.org/docs/unstable/misc/pvh.html Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1689 Signed-off-by: Anthony PERARD Acked-by: Laszlo Ersek --- Notes: v3: - rename PcdXenStartOfDay* to PcdXenPvhStartOfDay* - Use first available token value for those (0x17 and 0x28) OvmfPkg/OvmfPkg.dec | 3 +++ OvmfPkg/OvmfXen.fdf | 4 ++++ OvmfPkg/XenResetVector/XenResetVector.inf | 3 +++ OvmfPkg/XenResetVector/Ia32/XenPVHMain.asm | 6 ++++++ OvmfPkg/XenResetVector/XenResetVector.nasmb | 2 ++ 5 files changed, 18 insertions(+) diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index 9640360f62..c2a2ebfb95 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -218,6 +218,9 @@ [PcdsFixedAtBuild] # The value should be a multiple of 4KB. gUefiOvmfPkgTokenSpaceGuid.PcdHighPmmMemorySize|0x400000|UINT32|0x31 =20 + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr|0x0|UINT32|0x17 + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize|0x0|UINT32|0= x32 + [PcdsDynamic, PcdsDynamicEx] gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent|0|UINT64|2 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable|FALSE|BOOLEAN|0x10 diff --git a/OvmfPkg/OvmfXen.fdf b/OvmfPkg/OvmfXen.fdf index 43c268f6cb..49997fee9b 100644 --- a/OvmfPkg/OvmfXen.fdf +++ b/OvmfPkg/OvmfXen.fdf @@ -172,6 +172,10 @@ [FD.MEMFD] 0x007000|0x001000 gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|gUefiOvmfPkgT= okenSpaceGuid.PcdGuidedExtractHandlerTableSize =20 +0x008000|0x001000 +# Used by XenResetVector to communicate with XenPlatformPei +gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr|gUefiOvmfPkgTokenS= paceGuid.PcdXenPvhStartOfDayStructPtrSize + 0x010000|0x010000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecPeiTempRamSize =20 diff --git a/OvmfPkg/XenResetVector/XenResetVector.inf b/OvmfPkg/XenResetVe= ctor/XenResetVector.inf index 097fc9b5b4..46b133a834 100644 --- a/OvmfPkg/XenResetVector/XenResetVector.inf +++ b/OvmfPkg/XenResetVector/XenResetVector.inf @@ -36,3 +36,6 @@ [BuildOptions] [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize + + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize diff --git a/OvmfPkg/XenResetVector/Ia32/XenPVHMain.asm b/OvmfPkg/XenResetV= ector/Ia32/XenPVHMain.asm index 2a17fed52f..f42df3dba2 100644 --- a/OvmfPkg/XenResetVector/Ia32/XenPVHMain.asm +++ b/OvmfPkg/XenResetVector/Ia32/XenPVHMain.asm @@ -22,6 +22,12 @@ xenPVHMain: ; xor esp, esp =20 + ; + ; Store "Start of day" struct pointer for later use + ; + mov dword[PVH_SPACE (0)], ebx + mov dword[PVH_SPACE (4)], 'XPVH' + mov ebx, ADDR_OF(gdtr) lgdt [ebx] =20 diff --git a/OvmfPkg/XenResetVector/XenResetVector.nasmb b/OvmfPkg/XenReset= Vector/XenResetVector.nasmb index 0dbc4f2c1d..b2cb405d54 100644 --- a/OvmfPkg/XenResetVector/XenResetVector.nasmb +++ b/OvmfPkg/XenResetVector/XenResetVector.nasmb @@ -34,6 +34,8 @@ =20 %include "CommonMacros.inc" =20 +%define PVH_SPACE(Offset) (FixedPcdGet32 (PcdXenPvhStartOfDayStructPtr) + = (Offset)) + %include "PostCodes.inc" =20 %ifdef DEBUG_PORT80 --=20 Anthony PERARD -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43283): https://edk2.groups.io/g/devel/message/43283 Mute This Topic: https://groups.io/mt/32308569/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-