X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=OvmfPkg%2FPlatformPei%2FPlatform.c;h=5a78668126b4cc70eaf0aab84ed062d33928d0ca;hb=86defc2c2575842dc740dad02aafffe212b24c41;hp=1b4dc00b01803356c1ec69b4a6879ca358591dfb;hpb=5e167d7e784c92591921c29b61f0f7a000d9c7ce;p=mirror_edk2.git diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 1b4dc00b01..5a78668126 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -504,7 +504,6 @@ ReserveEmuVariableNvStore ( { EFI_PHYSICAL_ADDRESS VariableStore; RETURN_STATUS PcdStatus; - UINT32 Alignment; // // Allocate storage for NV variables early on so it will be @@ -512,26 +511,15 @@ ReserveEmuVariableNvStore ( // across reboots, this allows the NV variable storage to survive // a VM reboot. // - Alignment = PcdGet32 (PcdFlashNvStorageFtwSpareSize); - if ((Alignment & (Alignment - 1)) != 0) { - // - // Round up Alignment to the next power of two. - // - Alignment = GetPowerOfTwo32 (Alignment) << 1; - } - VariableStore = (EFI_PHYSICAL_ADDRESS)(UINTN) - AllocateAlignedRuntimePages ( - EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)), - Alignment + AllocateRuntimePages ( + EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) ); DEBUG ((EFI_D_INFO, - "Reserved variable store memory: 0x%lX; size: %dkb, " - "alignment: 0x%x\n", + "Reserved variable store memory: 0x%lX; size: %dkb\n", VariableStore, - (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024, - Alignment + (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024 )); PcdStatus = PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore); ASSERT_RETURN_ERROR (PcdStatus); @@ -639,7 +627,7 @@ InitializePlatform ( { EFI_STATUS Status; - DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n")); + DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n")); DebugDumpCmos (); @@ -657,6 +645,15 @@ InitializePlatform ( AddressWidthInitialization (); MaxCpuCountInitialization (); + // + // Query Host Bridge DID + // + mHostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID); + + if (FeaturePcdGet (PcdSmmSmramRequire)) { + Q35TsegMbytesInitialization (); + } + PublishPeiMemory (); InitializeRamRegions (); @@ -666,11 +663,6 @@ InitializePlatform ( InitializeXen (); } - // - // Query Host Bridge DID - // - mHostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID); - if (mBootMode != BOOT_ON_S3_RESUME) { if (!FeaturePcdGet (PcdSmmSmramRequire)) { ReserveEmuVariableNvStore (); @@ -680,6 +672,7 @@ InitializePlatform ( NoexecDxeInitialization (); } + AmdSevInitialize (); MiscInitialization (); InstallFeatureControlCallback ();