From: Jordan Justen Date: Tue, 12 Nov 2013 18:34:43 +0000 (+0000) Subject: OvmfPkg/EmuVariableFvbRuntimeDxe: Disable if flash variables are supported X-Git-Tag: edk2-stable201903~12119 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=4313b26de098b959668e1c061f1242063d20e81e OvmfPkg/EmuVariableFvbRuntimeDxe: Disable if flash variables are supported If QEMU flash is supported, then the PcdFlashNvStorageVariableBase64 will be set by the flash FVB driver. If it is set to a non-zero value, then we disable memory based variables. In future patches we will add the flash FVB driver and force it to run before this driver. Therefore, if QEMU flash writing is supported, then this driver will be disabled. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen Reviewed-by: Laszlo Ersek git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14838 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c index c7c3fcb36f..7a8beb3354 100644 --- a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c +++ b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c @@ -819,6 +819,12 @@ FvbInitialize ( return EFI_INVALID_PARAMETER; } + if (PcdGet64 (PcdFlashNvStorageVariableBase64) != 0) { + DEBUG ((EFI_D_INFO, "Disabling EMU Variable FVB since " + "flash variables appear to be supported.\n")); + return EFI_ABORTED; + } + // // By default we will initialize the FV contents. But, if // PcdEmuVariableNvStoreReserved is non-zero, then we will