[edk2-devel] The OVMF packages can not work properly when it was compiled with "-D SECURE_BOOT_ENABLE=TRUE"

2024-07-10 Thread wojiaohanliyang
When I compile the OVMF packages with "-D SECURE_BOOT_ENABLE=TRUE -D DEBUG_ON_SERIAL_PORT=TRUE", I found the OVMF can not work properly. *First, I boot a Qemu VM with only OVMF_CODE.fd but not OVMF_VARS.fd:* a. For Non-encrypted VM, the guest hungs in OVMF with the following assert message. --

Re: [edk2-devel] The OVMF packages can not work properly when it was compiled with "-D SECURE_BOOT_ENABLE=TRUE"

2024-07-10 Thread wojiaohanliyang
The root cause of these issues are that the following patchset rename the function from TdxValidateCfv() to PlatformInitEmuVariableNvStore(). 39596c41c8 OvmfPkg: Add build-flag SECURE_BOOT_FEATURE_ENABLED 3abaa281d3 OvmfPkg/TdxDxe: Set PcdEmuVariableNvStoreReserved 70165fa6e2 OvmfPkg/NvVarsFileLi

[edk2-devel] [PATCH 0/3] Fix boot failure when use secure boot supported (-D SECURE_BOOT_ENABLE=TRUE) OVMF packages

2024-07-14 Thread wojiaohanliyang
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

[edk2-devel] [PATCH 1/3] OvmfPkg/PlatformInitLib: Detect FlashNvVarStore before validate it

2024-07-14 Thread wojiaohanliyang
From: hanliyang BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4807 The commit 4f173db8b45b ("OvmfPkg/PlatformInitLib: Add functions for EmuVariableNvStore") rename the function from TdxValidateCfv to PlatformValidateNvVarStore. PlatformValidateNvVarStore is placed in the PlatformInitLib an

[edk2-devel] [PATCH 2/3] OvmfPkg/PlatformInitLib: Init the EmuVariableNvStore before copy data

2024-07-14 Thread wojiaohanliyang
From: hanliyang BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4807 In the case launch with just OVMF.fd, if we just init part of the EmuVariableNvStore, then EmuVariableFvbRuntimeDxe will skip the initialize process of the EmuVariableNvStore and the Ftw (Fault Tolerant Write) part of the Em

[edk2-devel] [PATCH 0/3] Fix boot failure when use secure boot supported (-D SECURE_BOOT_ENABLE=TRUE) OVMF packages

2024-07-14 Thread wojiaohanliyang
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

[edk2-devel] [PATCH 3/3] OvmfPkg/PlatformPei: Update mapping of FlashNvVarStore before validate it

2024-07-14 Thread wojiaohanliyang
From: hanliyang BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4807 In the case of launch a SEV-ES VM with just OVMF_CODE.fd, the validation process in PlatformValidateNvVarStore will trigger MMIO NPF, and the #VC handler will detect that mmio access is invalid because the mmio address range

[edk2-devel] [PATCH 0/3] Fix boot failure when use secure boot supported (-D SECURE_BOOT_ENABLE=TRUE) OVMF packages

2024-07-14 Thread wojiaohanliyang
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

[edk2-devel] [PATCH 2/3] OvmfPkg/PlatformInitLib: Init the EmuVariableNvStore before copy data

2024-07-14 Thread wojiaohanliyang
From: hanliyang BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4807 In the case launch with just OVMF.fd, if we just init part of the EmuVariableNvStore, then EmuVariableFvbRuntimeDxe will skip the initialize process of the EmuVariableNvStore and the Ftw (Fault Tolerant Write) part of the Em

[edk2-devel] [PATCH 3/3] OvmfPkg/PlatformPei: Update mapping of FlashNvVarStore before validate it

2024-07-14 Thread wojiaohanliyang
From: hanliyang BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4807 In the case of launch a SEV-ES VM with just OVMF_CODE.fd, the validation process in PlatformValidateNvVarStore will trigger MMIO NPF, and the #VC handler will detect that mmio access is invalid because the mmio address range

[edk2-devel] [PATCH 1/3] OvmfPkg/PlatformInitLib: Detect FlashNvVarStore before validate it

2024-07-14 Thread wojiaohanliyang
From: hanliyang BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4807 The commit 4f173db8b45b ("OvmfPkg/PlatformInitLib: Add functions for EmuVariableNvStore") rename the function from TdxValidateCfv to PlatformValidateNvVarStore. PlatformValidateNvVarStore is placed in the PlatformInitLib an