From nobody Mon Feb 9 08:58:11 2026 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+44549+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1564415891; cv=none; d=zoho.com; s=zohoarc; b=UNI1DRKEQy1w7p9+SLA8C4Qq4BQqnnNkDPxdJmR40Br0b4znN0u320i9aF8tJtu9Vt+ZABeP0703VGl/JMuqp7oOFLpUsanZsO86S/Jlglf4JzjgJzG8vSjgYta06ygsMeuam4rPPg0JnYBs+v3W/YpBNLSzpOnuyzY5l9w9QwM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564415891; 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=rppf9+ZL4tyqEHG+hZ2nFm/JletGh1qdc+ybnNWfc58=; b=LwPH2n4BdWtLAtDkYYmlEkexdjcU/fwwWw1ymb2Y+jue0cdvPJGy3KXKsVBsGBWwSYyFYbBtYbLu0y1Kql4hgrhqnc+OVV+NBXMOpOLex8/o21LGgvwNOvF7z1Igp3BfoxMyh9OGdXRKdWqQmGn7Kx1o5kr4wRsHyHs3GTaqJiQ= 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+44549+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1564415891598919.4557840585338; Mon, 29 Jul 2019 08:58:11 -0700 (PDT) Return-Path: X-Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com []) by groups.io with SMTP; Mon, 29 Jul 2019 08:58:10 -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+44549+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.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=esa3.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 (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 3ARBLeNSo2mL2OkpWWqoUly+FoDdSJQxfcbCUH3/VJMvmqVRiEFTQlIBThANPKP6xjXSoCfy4C Z1hbFg8d/KibdeJBe86SEWlpetBDQaeD+YWoDLNUJrdaGuiibHu54Lpxg/W3LDjDwmzZ+bYSIb Hi8qP5977299if4r1vgl+4Ds09ZC1OZV6i4p4k9VOL9NBnjp0Nwie/6StcgTIZJfzBiaxlINlX D0ZlbdZv+uLIhvEgBGYi6mbb3Ez9QMb0aBi0Mwll0DSlT1+h+d/+RZ2GPwIc6liNdhflFROJH5 POM= X-SBRS: 2.7 X-MesageID: 3579638 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,323,1559534400"; d="scan'208";a="3579638" From: "Anthony PERARD" To: CC: Julien Grall , , Jordan Justen , Ard Biesheuvel , Laszlo Ersek , Anthony PERARD Subject: [edk2-devel] [PATCH v4 10/35] OvmfPkg/XenPlatformPei: Detect OVMF_INFO from hvmloader Date: Mon, 29 Jul 2019 16:39:19 +0100 Message-ID: <20190729153944.24239-11-anthony.perard@citrix.com> In-Reply-To: <20190729153944.24239-1-anthony.perard@citrix.com> References: <20190729153944.24239-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=1564415891; bh=rppf9+ZL4tyqEHG+hZ2nFm/JletGh1qdc+ybnNWfc58=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=oQ76jCra7nPDa9EO0VT1g8N2F+GmLjEr7K9rGgZ8/M/ce/RJalGcKlA5/RQbvI4m/g7 KKogJPIEe/ZS75rZa3Q4HB00w+ZUUzB/Xyi0ldqgAOEsiEq0eNsIeR8XDH7h+H584YuSS rOz+fgoRbqDlVJ6Tv+PfaabWJjByQhJTZ7M= 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 (#44549): https://edk2.groups.io/g/devel/message/44549 Mute This Topic: https://groups.io/mt/32644075/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-