From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.38616.1670835841410151021 for ; Mon, 12 Dec 2022 01:04:01 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Bvv6SO5j; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: sebastien.boeuf@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670835841; x=1702371841; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iXxExgksr6FDrub3HPfmqo9B6O5/q7tlLCAkcNWx/WQ=; b=Bvv6SO5j9LkAKbl/l1Ysu5Auo26yvN94111HdnzGFVKKeAhx2zGokoMK jv9oFiRzp+RdLzpoZYmE7hEeU+WZ/LK70X2CyPIG8unCMoHaSEd0ce9p7 fmFy6yIYLYo2N7ylV64bJnXvFBwLOIJnEWWsSPtT8bh7WFgKYISH0PZUW DyBAOdAu9WRFg+srI873kFr2jG+GrhxgvcWHenqhY/amrnHTYou3ZVRlF /U1di7H//xjcsdEROIqcMgXn1oVOwMLDRfvVlnfAJGPpHPZsHR60VZF7h fnixThvstGcHYesg7sOQukd6dVPTSYErmLYiGZbgn3qgDLODBE0qYa3AD Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="301225973" X-IronPort-AV: E=Sophos;i="5.96,237,1665471600"; d="scan'208";a="301225973" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 01:04:01 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="822414746" X-IronPort-AV: E=Sophos;i="5.96,237,1665471600"; d="scan'208";a="822414746" Received: from vdesserx-mobl1.ger.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.58.223]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 01:03:59 -0800 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, min.m.xu@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [PATCH 1/3] OvmfPkg/PlatformInitLib: Differentiate TDX case for Cloud Hypervisor Date: Mon, 12 Dec 2022 10:03:41 +0100 Message-Id: <64b42b8bb9bbbafc6abb99c812baec57f1506990.1670835199.git.sebastien.boeuf@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Sebastien Boeuf Rely on the CcProbe() function to identify when running on TDX. This allows the firmware to follow a different codepath for Cloud Hypervisor, which means it doesn't rely on PVH to find out about memory below 4GiB. instead it falls back onto the CMOS to retrieve that information. Signed-off-by: Sebastien Boeuf --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/= PlatformInitLib/MemDetect.c index b8feae4309..afee4b1e72 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -26,6 +26,7 @@ Module Name: // #include #include +#include #include #include #include @@ -312,7 +313,8 @@ PlatformGetSystemMemorySizeBelow4gb ( UINT8 Cmos0x34; UINT8 Cmos0x35; = - if (PlatformInfoHob->HostBridgeDevId =3D=3D CLOUDHV_DEVICE_ID) { + if (PlatformInfoHob->HostBridgeDevId =3D=3D CLOUDHV_DEVICE_ID && + CcProbe () !=3D CcGuestTypeIntelTdx) { // Get the information from PVH memmap return (UINT32)GetHighestSystemMemoryAddressFromPvhMemmap (TRUE); } -- = 2.34.1 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, = 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 5 208 026.16 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.