From nobody Thu Nov 14 17:00:10 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+45535+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1565695889; cv=none; d=zoho.com; s=zohoarc; b=PqUN529aI0/sJahEJ0gcVVpLeRnbz3sTbyU1MLDkqkOSaFKgOIsMj5keh14CJPbBQBEdcWCk+FDUwfffFUVbiZbzwnzwW7kUlyrj3uFXfCxo45jMUqsb7ccKzgED5dVXLd9M/RU8djEwLUhnCvx/eg9YikwosYJSL9kuxLEAIcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565695889; 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=s6whLZKMHKtCj4WYV7pzOfZvZgaDE7SF/ZAW4kwziD8=; b=IcltweQGEk6j1P2Ft8EzHZAiJpHO5S3idgGoLAEapzvcFLesmheh1gEdfEuivgIEK4ZzUXrIXFtfvgO4HseB6+1efICkHsXV7f8RQho7E9kczwGc/i43RGGJorPCNYTHV0Iz3AjcuAxK5UYVvCYmUcVqPjM6xHNptmkoyiXZqqo= 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+45535+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1565695889274891.4876050068295; Tue, 13 Aug 2019 04:31:29 -0700 (PDT) Return-Path: X-Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by groups.io with SMTP; Tue, 13 Aug 2019 04:31:28 -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+45535+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.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=esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: dhQjzfxImr2P6pDDCFMMa3hYL1AuaaHfBiSLaDhrkVLAB319UuqdN1BFvjrmT1CEUhemaNkDJ1 Uur8nbXJOKVeYoq9Upx4X44G6sVeicd97V0Wgm0ppvvffdh15xT+S65I6gOYv2cwqHVEtkyi+e nParxWU0F4HU69G0BRpb+pHcK8YQAa9C3ILVD0zJXlraGCNZ/bZO3yozt5vHwxCJQLoMiDu8rQ 8B4b0YU4MSzxZhWz7tDCxgDSLsk4sUyTkNMnTAXz4mPnkfxfbM6pHyz69zWC5ZkA2MtGwlNFFU Hx8= X-SBRS: 2.7 X-MesageID: 4374132 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,381,1559534400"; d="scan'208";a="4374132" From: "Anthony PERARD" To: CC: Laszlo Ersek , Jordan Justen , Julien Grall , , Ard Biesheuvel , Anthony PERARD Subject: [edk2-devel] [PATCH v5 07/35] OvmfPkg/XenResetVector: Saving start of day pointer for PVH guests Date: Tue, 13 Aug 2019 12:30:51 +0100 Message-ID: <20190813113119.14804-8-anthony.perard@citrix.com> In-Reply-To: <20190813113119.14804-1-anthony.perard@citrix.com> References: <20190813113119.14804-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=1565695888; bh=s6whLZKMHKtCj4WYV7pzOfZvZgaDE7SF/ZAW4kwziD8=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=WZ++SwSMJLCqe293k3ziaC7/CUChOZ3J9+ZBJ3aFQsj5W6MTgrNV5RyajkKSJUNfZHN o6VF2Lb5r68I4ZGusNncDDSAk7QqEOeYepUaUETC9VOzPF3/5Ruyin2XwY+jhP++RwBxh hDmUIdj0Cn7/+bE/xRzzi7BbhXEANakFREk= 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 (#45535): https://edk2.groups.io/g/devel/message/45535 Mute This Topic: https://groups.io/mt/32851507/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-