public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: wojiaohanliyang@163.com
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH 0/3] Fix boot failure when use secure boot supported (-D SECURE_BOOT_ENABLE=TRUE) OVMF packages
Date: Sun, 14 Jul 2024 20:22:27 +0800	[thread overview]
Message-ID: <20240714122230.123680-1-wojiaohanliyang@163.com> (raw)

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 (#119924): https://edk2.groups.io/g/devel/message/119924
Mute This Topic: https://groups.io/mt/107212891/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2024-07-14 12:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-14 12:22 wojiaohanliyang [this message]
2024-07-14 12:22 ` [edk2-devel] [PATCH 1/3] OvmfPkg/PlatformInitLib: Detect FlashNvVarStore before validate it wojiaohanliyang
2024-07-14 12:22 ` [edk2-devel] [PATCH 2/3] OvmfPkg/PlatformInitLib: Init the EmuVariableNvStore before copy data wojiaohanliyang
2024-07-14 12:22 ` [edk2-devel] [PATCH 3/3] OvmfPkg/PlatformPei: Update mapping of FlashNvVarStore before validate it wojiaohanliyang
  -- strict thread matches above, loose matches on Subject: below --
2024-07-14 12:24 [edk2-devel] [PATCH 0/3] Fix boot failure when use secure boot supported (-D SECURE_BOOT_ENABLE=TRUE) OVMF packages wojiaohanliyang
2024-07-14 12:19 wojiaohanliyang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240714122230.123680-1-wojiaohanliyang@163.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox