]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/PlatformInitLib/MemDetect.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / OvmfPkg / Library / PlatformInitLib / MemDetect.c
index 6c30566db937188e359dec8bcb1c16abe5222538..38cece9173e8011fd1930d43e163cd3048b24198 100644 (file)
@@ -55,8 +55,15 @@ PlatformQemuUc32BaseInitialization (
     return;\r
   }\r
 \r
+  if (PlatformInfoHob->HostBridgeDevId == CLOUDHV_DEVICE_ID) {\r
+    PlatformInfoHob->Uc32Size = CLOUDHV_MMIO_HOLE_SIZE;\r
+    PlatformInfoHob->Uc32Base = CLOUDHV_MMIO_HOLE_ADDRESS;\r
+    return;\r
+  }\r
+\r
+  PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob);\r
+\r
   if (PlatformInfoHob->HostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {\r
-    PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob);\r
     ASSERT (PcdGet64 (PcdPciExpressBaseAddress) <= MAX_UINT32);\r
     ASSERT (PcdGet64 (PcdPciExpressBaseAddress) >= PlatformInfoHob->LowMemory);\r
 \r
@@ -78,19 +85,12 @@ PlatformQemuUc32BaseInitialization (
     return;\r
   }\r
 \r
-  if (PlatformInfoHob->HostBridgeDevId == CLOUDHV_DEVICE_ID) {\r
-    PlatformInfoHob->Uc32Size = CLOUDHV_MMIO_HOLE_SIZE;\r
-    PlatformInfoHob->Uc32Base = CLOUDHV_MMIO_HOLE_ADDRESS;\r
-    return;\r
-  }\r
-\r
   ASSERT (PlatformInfoHob->HostBridgeDevId == INTEL_82441_DEVICE_ID);\r
   //\r
   // On i440fx, start with the [LowerMemorySize, 4GB) range. Make sure one\r
   // variable MTRR suffices by truncating the size to a whole power of two,\r
   // while keeping the end affixed to 4GB. This will round the base up.\r
   //\r
-  PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob);\r
   PlatformInfoHob->Uc32Size = GetPowerOfTwo32 ((UINT32)(SIZE_4GB - PlatformInfoHob->LowMemory));\r
   PlatformInfoHob->Uc32Base = (UINT32)(SIZE_4GB - PlatformInfoHob->Uc32Size);\r
   //\r
@@ -200,7 +200,7 @@ PlatformAddHobCB (
 \r
       break;\r
     case EfiAcpiAddressRangeReserved:\r
-      BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End);\r
+      BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End - Base);\r
       DEBUG ((DEBUG_INFO, "%a: Reserved [0x%Lx, 0x%Lx)\n", __FUNCTION__, Base, End));\r
       break;\r
     default:\r