diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c index b34298faf8..83051a568f 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c @@ -27,9 +27,7 @@ #include #include #include -#include #include -#include #include "FwBlockService.h" #include "QemuFlash.h" @@ -976,7 +974,6 @@ FvbInitialize ( EFI_PHYSICAL_ADDRESS BaseAddress; UINTN Length; UINTN NumOfBlocks; - RETURN_STATUS PcdStatus; if (EFI_ERROR (QemuFlashInitialize ())) { // @@ -1129,7 +1126,8 @@ FvbInitialize ( // InstallVirtualAddressChangeHandler (); - PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE); - ASSERT_RETURN_ERROR (PcdStatus); + // Abstract dynamic PCD set to support Standalone MM + UpdateQemuFlashVariablesEnable (); + return EFI_SUCCESS; } diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h index 639ad0471c..dda3bc5feb 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h @@ -194,4 +194,9 @@ SetPcdFlashNvStorageBaseAddresses ( VOID ); +VOID +UpdateQemuFlashVariablesEnable ( + VOID + ); + #endif diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c index 61e1f2e196..27812fc02e 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c @@ -244,3 +244,14 @@ SetPcdFlashNvStorageBaseAddresses ( ); ASSERT_RETURN_ERROR (PcdStatus); } + +VOID +UpdateQemuFlashVariablesEnable ( + VOID + ) +{ + RETURN_STATUS PcdStatus; + + PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE); + ASSERT_RETURN_ERROR (PcdStatus); +} diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c index 19bd5aab7c..6acd4b7afe 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c @@ -84,3 +84,14 @@ SetPcdFlashNvStorageBaseAddresses ( // Do nothing. // } + +VOID +UpdateQemuFlashVariablesEnable ( + VOID + ) +{ + RETURN_STATUS PcdStatus; + + PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE); + ASSERT_RETURN_ERROR (PcdStatus); +}