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 <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
---
 OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c 
b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c
index c7c3fcb..7a8beb3 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
-- 
1.7.10.4


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to