diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c index b8feae4309..6dbdbf9306 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,9 @@ 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); }