mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 23:54:02 +02:00
OvmfPkg/PlatformPei: Update ReserveEmuVariableNvStore
ReserveEmuVariableNvStore is updated with below 2 functions defined in PlatformInitLib: - PlatformReserveEmuVariableNvStore - PlatformInitEmuVariableNvStore PlatformInitEmuVariableNvStore works when secure boot feature is enabled. This is because secure boot needs the EFI variables (PK/KEK/DB/DBX, etc) and EmuVariableNvStore is cleared when OVMF is launched with -bios parameter. Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Min Xu <min.m.xu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
parent
4f173db8b4
commit
58eb8517ad
@ -220,24 +220,13 @@ ReserveEmuVariableNvStore (
|
|||||||
EFI_PHYSICAL_ADDRESS VariableStore;
|
EFI_PHYSICAL_ADDRESS VariableStore;
|
||||||
RETURN_STATUS PcdStatus;
|
RETURN_STATUS PcdStatus;
|
||||||
|
|
||||||
//
|
VariableStore = (EFI_PHYSICAL_ADDRESS)(UINTN)PlatformReserveEmuVariableNvStore ();
|
||||||
// Allocate storage for NV variables early on so it will be
|
PcdStatus = PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore);
|
||||||
// at a consistent address. Since VM memory is preserved
|
|
||||||
// across reboots, this allows the NV variable storage to survive
|
#ifdef SECURE_BOOT_FEATURE_ENABLED
|
||||||
// a VM reboot.
|
PlatformInitEmuVariableNvStore ((VOID *)(UINTN)VariableStore);
|
||||||
//
|
#endif
|
||||||
VariableStore =
|
|
||||||
(EFI_PHYSICAL_ADDRESS)(UINTN)
|
|
||||||
AllocateRuntimePages (
|
|
||||||
EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize))
|
|
||||||
);
|
|
||||||
DEBUG ((
|
|
||||||
DEBUG_INFO,
|
|
||||||
"Reserved variable store memory: 0x%lX; size: %dkb\n",
|
|
||||||
VariableStore,
|
|
||||||
(2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024
|
|
||||||
));
|
|
||||||
PcdStatus = PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore);
|
|
||||||
ASSERT_RETURN_ERROR (PcdStatus);
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user