Re: [edk2] [PATCH 5/8] OvmfPkg/EmuVariableFvbRuntimeDxe: Disable if flash variables are supported

2013-10-31 Thread Laszlo Ersek
On 10/28/13 22:27, Jordan Justen wrote:
 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.
 
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Jordan Justen jordan.l.jus...@intel.com
 ---
  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
 

This function (the entry point of the EmuVariableFvbRuntimeDxe driver)
would set PcdFlashNvStorageVariableBase64 (64-bit Base address of the
NV variable range in flash device) later on, unconditionally. The OVMF
default value is 0.

Seems logical to me.

One question: how do you ensure that the flash FVB driver in patch #6
runs before this one? (It does seem to work in practice.)

... Ah I can see it in patch #7.

Reviewed-by: Laszlo Ersek ler...@redhat.com

Thanks!
Laszlo

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


[edk2] [PATCH 5/8] OvmfPkg/EmuVariableFvbRuntimeDxe: Disable if flash variables are supported

2013-10-28 Thread Jordan Justen
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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen jordan.l.jus...@intel.com
---
 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


--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel