From: "joeyli" <jlee@suse.com>
To: devel@edk2.groups.io, min.m.xu@intel.com
Cc: Erdem Aktas <erdemaktas@google.com>,
James Bottomley <jejb@linux.ibm.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [edk2-devel] [PATCH V5 4/8] OvmfPkg/PlatformPei: Update ReserveEmuVariableNvStore
Date: Tue, 21 Mar 2023 17:31:52 +0800 [thread overview]
Message-ID: <20230321093152.GF8116@linux-l9pv.suse> (raw)
In-Reply-To: <a26a9532bf0d34c6ca754f9da21bc0d27567eef6.1662423715.git.min.m.xu@intel.com>
Hi Min M Xu,
I have filed a EDK2 bug relates to this patch:
Bug 4379 - Got NvVarStore FV headers were invalid when using OVMF with AMD SEV
https://bugzilla.tianocore.org/show_bug.cgi?id=4379
I got a "NvVarStore FV headers were invalid." assert when using OVMF with AMD
SEV. After reverted this patch, the assert is gone.
Thanks!
Joey Lee
On Tue, Sep 06, 2022 at 12:35:56PM +0800, Min Xu via groups.io wrote:
> From: Min M Xu <min.m.xu@intel.com>
>
> 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>
> ---
> OvmfPkg/PlatformPei/Platform.c | 25 +++++++------------------
> 1 file changed, 7 insertions(+), 18 deletions(-)
>
> diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
> index 009db67ee60a..b1f8140d6041 100644
> --- a/OvmfPkg/PlatformPei/Platform.c
> +++ b/OvmfPkg/PlatformPei/Platform.c
> @@ -220,24 +220,13 @@ ReserveEmuVariableNvStore (
> EFI_PHYSICAL_ADDRESS VariableStore;
> RETURN_STATUS PcdStatus;
>
> - //
> - // Allocate storage for NV variables early on so it will be
> - // at a consistent address. Since VM memory is preserved
> - // across reboots, this allows the NV variable storage to survive
> - // a VM reboot.
> - //
> - 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);
> + VariableStore = (EFI_PHYSICAL_ADDRESS)(UINTN)PlatformReserveEmuVariableNvStore ();
> + PcdStatus = PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore);
> +
> + #ifdef SECURE_BOOT_FEATURE_ENABLED
> + PlatformInitEmuVariableNvStore ((VOID *)(UINTN)VariableStore);
> + #endif
> +
> ASSERT_RETURN_ERROR (PcdStatus);
> }
>
> --
> 2.29.2.windows.2
>
>
>
>
>
next prev parent reply other threads:[~2023-03-21 9:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 4:35 [PATCH V5 0/8] Enable secure-boot when lauch OVMF with -bios parameter Min Xu
2022-09-06 4:35 ` [PATCH V5 1/8] EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLib Min Xu
2022-09-06 4:35 ` [PATCH V5 2/8] OvmfPkg/PeilessStartupLib: Delete TdxValidateCfv Min Xu
2022-09-06 4:35 ` [PATCH V5 3/8] OvmfPkg/PlatformInitLib: Add functions for EmuVariableNvStore Min Xu
2022-09-06 4:35 ` [PATCH V5 4/8] OvmfPkg/PlatformPei: Update ReserveEmuVariableNvStore Min Xu
2023-03-21 9:31 ` joeyli [this message]
2023-03-24 0:38 ` [edk2-devel] " Min Xu
2022-09-06 4:35 ` [PATCH V5 5/8] OvmfPkg: Reserve and init EmuVariableNvStore in Pei-less Startup Min Xu
2022-09-06 4:35 ` [PATCH V5 6/8] OvmfPkg/NvVarsFileLib: Shortcut ConnectNvVarsToFileSystem in secure-boot Min Xu
2022-09-06 4:35 ` [PATCH V5 7/8] OvmfPkg/TdxDxe: Set PcdEmuVariableNvStoreReserved Min Xu
2022-09-06 4:36 ` [PATCH V5 8/8] OvmfPkg: Add build-flag SECURE_BOOT_FEATURE_ENABLED Min Xu
2022-09-06 7:22 ` [PATCH V5 0/8] Enable secure-boot when lauch OVMF with -bios parameter Yao, Jiewen
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=20230321093152.GF8116@linux-l9pv.suse \
--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