BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4807

This patch series provides fixes for boot VM when use secure boot
supported (-D SECURE_BOOT_ENABLE=TRUE) OVMF packages.

- Detect FlashNvVarStore before calls PlaformValidateNvVarStore in 
PlatformInitLib
  and skip the validation process if the FlashNvVarStore doesn't exist. Since 
the
  PlatformValidateNvVarStore will return false if the FlashNvVarStore doesn't
  exist, this will trigger ASSERT (FALSE) and prevent the guest from moving
  forward.

- Init the whole range of EmuVariableNvStore before copy content from the
  FlashNvVarStore to EmuVariableNvStore. If the Ftw (Fault Tolerant Write) part
  of the EmuVariableNvStore isn't initialized, the FaultToleranteWriteDxe will
  use scrambled address to access memory and leads to crash if the VM is a
  SEV guest.

- Fix the mapping for FlashNvVarStore. If launch a SEV VM with only OVMF.fd,
  the address range for FlashNvVarStore should be mapped as encrypted before
  access FlashNvVarStore in PlatformValidateNvVarStore. If launch a SEV VM with
  both OVMF_CODE.fd and OVMF_VARS.fd, the address range for FlashNvVarStore
  should be mapped as decrypted before access FlashNvVarStore in
  PlatformValidateNvVarStore.

---

These patches based on commit:
d4dbe5e101dc ("SecurityPkg/Tcg2Acpi: Revise debug print")

Han Liyang (3):
 OvmfPkg/PlatformPei: Update mapping of FlashNvVarStore before validate it
 OvmfPkg/PlatformInitLib: Init the EmuVariableNvStore before copy data
 OvmfPkg/PlatformInitLib: Detect FlashNvVarStore before validate it

OvmfPkg/Library/PlatformInitLib/Platform.c | 67 +++++++++++
OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 1 +
OvmfPkg/PlatformPei/AmdSev.c | 105 ++++++++++++++++++
OvmfPkg/PlatformPei/Platform.c | 6 +
OvmfPkg/PlatformPei/Platform.h | 6 +
OvmfPkg/PlatformPei/PlatformPei.inf | 1 +
6 files changed, 186 insertions(+)

-- 
2.25.1



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


Reply via email to