From nobody Thu Nov 14 17:23:18 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+45543+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1565697476; cv=none; d=zoho.com; s=zohoarc; b=SSGUCn/L4uYiLVftmZy5QQOcKA6tfzhARyJ58gkgd25vZTp4hAVWNihBdd8SdJfdd2aGuNYv+Esx/BkyDsdNKdIIeLLqRgZX+EA3Lpc3pcwn36s0vwBAD/g2jIHuCa+2o7czkELtiwQqfrQ2lw5gUAzhBvHtN/rUyilz5RHBjco= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565697476; 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=Gz1shcVkV373sQSxxvdmahuOv0lQ6Mi8rqbtEj89JFU=; b=KPnJ3xmuFmXTYi9ZqgpZri92SV0KMewBO0MaqEZiqLxN+PDngfJqm5Kyoadgnlzg1TXjTvm5jBBiT2KTL2SWOKcDBe/6eQCqV6wdLYLzTXhEE7ctONZ01xp7Oy2IWy/c8jDflhGChSwT6IV/+zssnFf7IVsOQg/QFI1yb4/ldSE= 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+45543+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1565697476145348.15419593207537; Tue, 13 Aug 2019 04:57:56 -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:57:55 -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+45543+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: kUE3JOw0T2mJof0gvPbvm6vJbeZ78vKYdXSzey+Dyic+mii51g3JRgo1YPjciQ772RQQtTHRtF ZTlZ5MwEV5QIytumC7tvxmuqu3yXvQI8pWNKa5OJF4hrHgmovSs13fHPgBMOhFQpeZugQwsKhR pandDLGcy9f82Daq0F/L5Vsyl3uIPBq99eJV9rxia920hmYqFB4rWTOABqn49bGgF/zH4XqxNM Z2f79iuu3oYlcaJQE4W0TG5iSBspRLI7jS6vSdBWA+x+zkNzfWOuXl68tXJ+6gG5Ku08Ad6/S5 BXQ= X-SBRS: 2.7 X-MesageID: 4374821 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="4374821" From: "Anthony PERARD" To: CC: Laszlo Ersek , Jordan Justen , Julien Grall , , Ard Biesheuvel , Anthony PERARD Subject: [edk2-devel] [PATCH v5 10/35] OvmfPkg/XenPlatformPei: Detect OVMF_INFO from hvmloader Date: Tue, 13 Aug 2019 12:30:54 +0100 Message-ID: <20190813113119.14804-11-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=1565697475; bh=Gz1shcVkV373sQSxxvdmahuOv0lQ6Mi8rqbtEj89JFU=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=QrsjJIxyNmwDAWMgLTydMzwEjxKsI26NfQWdcDbQr1c8A9F+vnJGY9mJCNf/oklLpa9 xJkSp5I1iIULBTgz28NdRYkjj5P/K/x8gXF9TAA+LlRO9HQLuAdWM6iru0/R+I4CJ5mIk 7eyB7XmBwnpQsprbrU2MFc8cc2e3psyxZGk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" EFI_XEN_OVMF_INFO is only useful to retrieve the E820 table. The mXenHvmloaderInfo isn't used yet, but will be use in a further patch to retrieve the E820 table. Also remove the unused pointer from the XenInfo HOB as that information is only useful in the XenPlatformPei. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1689 Signed-off-by: Anthony PERARD Acked-by: Laszlo Ersek --- Notes: v3: - fix coding style - fix commit message OvmfPkg/Include/Guid/XenInfo.h | 4 ---- OvmfPkg/PlatformPei/Xen.c | 3 --- OvmfPkg/XenPlatformPei/Xen.c | 25 +++++++++++++++++++++++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/OvmfPkg/Include/Guid/XenInfo.h b/OvmfPkg/Include/Guid/XenInfo.h index 25d76a7828..b052d618fd 100644 --- a/OvmfPkg/Include/Guid/XenInfo.h +++ b/OvmfPkg/Include/Guid/XenInfo.h @@ -18,10 +18,6 @@ typedef struct { /// VOID *HyperPages; /// - /// Location of the hvm_info page. - /// - VOID *HvmInfo; - /// /// Hypervisor major version. /// UINT16 VersionMajor; diff --git a/OvmfPkg/PlatformPei/Xen.c b/OvmfPkg/PlatformPei/Xen.c index 89dc4143b2..3e15b32a73 100644 --- a/OvmfPkg/PlatformPei/Xen.c +++ b/OvmfPkg/PlatformPei/Xen.c @@ -98,9 +98,6 @@ XenConnect ( mXenInfo.VersionMajor =3D (UINT16)(XenVersion >> 16); mXenInfo.VersionMinor =3D (UINT16)(XenVersion & 0xFFFF); =20 - /* TBD: Locate hvm_info and reserve it away. */ - mXenInfo.HvmInfo =3D NULL; - BuildGuidDataHob ( &gEfiXenInfoGuid, &mXenInfo, diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c index f4d0d1c73b..9962fe9fc7 100644 --- a/OvmfPkg/XenPlatformPei/Xen.c +++ b/OvmfPkg/XenPlatformPei/Xen.c @@ -33,6 +33,12 @@ STATIC UINT32 mXenLeaf =3D 0; =20 EFI_XEN_INFO mXenInfo; =20 +// +// Location of the firmware info struct setup by hvmloader. +// Only the E820 table is used by OVMF. +// +EFI_XEN_OVMF_INFO *mXenHvmloaderInfo; + /** Returns E820 map provided by Xen =20 @@ -78,6 +84,8 @@ XenConnect ( UINT32 TransferReg; UINT32 TransferPages; UINT32 XenVersion; + EFI_XEN_OVMF_INFO *Info; + CHAR8 Sig[sizeof (Info->Signature) + 1]; =20 AsmCpuid (XenLeaf + 2, &TransferPages, &TransferReg, NULL, NULL); mXenInfo.HyperPages =3D AllocatePages (TransferPages); @@ -97,8 +105,21 @@ XenConnect ( mXenInfo.VersionMajor =3D (UINT16)(XenVersion >> 16); mXenInfo.VersionMinor =3D (UINT16)(XenVersion & 0xFFFF); =20 - /* TBD: Locate hvm_info and reserve it away. */ - mXenInfo.HvmInfo =3D NULL; + // + // Check if there are information left by hvmloader + // + + Info =3D (EFI_XEN_OVMF_INFO *)(UINTN) OVMF_INFO_PHYSICAL_ADDRESS; + // + // Copy the signature, and make it null-terminated. + // + AsciiStrnCpyS (Sig, sizeof (Sig), (CHAR8 *) &Info->Signature, + sizeof (Info->Signature)); + if (AsciiStrCmp (Sig, "XenHVMOVMF") =3D=3D 0) { + mXenHvmloaderInfo =3D Info; + } else { + mXenHvmloaderInfo =3D NULL; + } =20 BuildGuidDataHob ( &gEfiXenInfoGuid, --=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 (#45543): https://edk2.groups.io/g/devel/message/45543 Mute This Topic: https://groups.io/mt/32851687/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-