From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=softfail (domain: citrix.com, ip: , mailfrom: anthony.perard@citrix.com) 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 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com 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: [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> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704144233.27968-1-anthony.perard@citrix.com> References: <20190704144233.27968-1-anthony.perard@citrix.com> MIME-Version: 1.0 Return-Path: anthony.perard@citrix.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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.=0D gUefiOvmfPkgTokenSpaceGuid.PcdHighPmmMemorySize|0x400000|UINT32|0x31=0D =0D + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr|0x0|UINT32|0x17= =0D + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize|0x0|UINT32|0= x32=0D +=0D [PcdsDynamic, PcdsDynamicEx]=0D gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent|0|UINT64|2=0D gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable|FALSE|BOOLEAN|0x1= 0=0D 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=0D gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|gUefiOvmfPkgT= okenSpaceGuid.PcdGuidedExtractHandlerTableSize=0D =0D +0x008000|0x001000=0D +# Used by XenResetVector to communicate with XenPlatformPei=0D +gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr|gUefiOvmfPkgTokenS= paceGuid.PcdXenPvhStartOfDayStructPtrSize=0D +=0D 0x010000|0x010000=0D gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecPeiTempRamSize=0D =0D 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]=0D gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase=0D gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize=0D +=0D + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr=0D + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize=0D 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: ;=0D xor esp, esp=0D =0D + ;=0D + ; Store "Start of day" struct pointer for later use=0D + ;=0D + mov dword[PVH_SPACE (0)], ebx=0D + mov dword[PVH_SPACE (4)], 'XPVH'=0D +=0D mov ebx, ADDR_OF(gdtr)=0D lgdt [ebx]=0D =0D 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 @@ =0D %include "CommonMacros.inc"=0D =0D +%define PVH_SPACE(Offset) (FixedPcdGet32 (PcdXenPvhStartOfDayStructPtr) + = (Offset))=0D +=0D %include "PostCodes.inc"=0D =0D %ifdef DEBUG_PORT80=0D --=20 Anthony PERARD