On December 12, 2022 5:04 PM, Boeuf, Sebastien wrote:
> Subject: [PATCH 1/3] OvmfPkg/PlatformInitLib: Differentiate TDX case for
> Cloud Hypervisor
> 
> From: Sebastien Boeuf <sebastien.bo...@intel.com>
> 
> 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 <sebastien.bo...@intel.com>
> ---
>  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 <Library/BaseLib.h> #include
> <Library/BaseMemoryLib.h>+#include <Library/CcProbeLib.h> #include
> <Library/DebugLib.h> #include <Library/HardwareInfoLib.h> #include
> <Library/HobLib.h>@@ -312,7 +313,8 @@
> PlatformGetSystemMemorySizeBelow4gb (
>    UINT8       Cmos0x34;   UINT8       Cmos0x35; -  if (PlatformInfoHob-
> >HostBridgeDevId == CLOUDHV_DEVICE_ID) {+  if (PlatformInfoHob-
> >HostBridgeDevId == CLOUDHV_DEVICE_ID &&+      CcProbe () !=
> CcGuestTypeIntelTdx) {     // Get the information from PVH memmap
> return (UINT32)GetHighestSystemMemoryAddressFromPvhMemmap
> (TRUE);   }--
> 2.34.1

Reviewed-by: Min Xu <min.m...@intel.com>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97280): https://edk2.groups.io/g/devel/message/97280
Mute This Topic: https://groups.io/mt/95617496/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to