Revision: 14844
          http://sourceforge.net/p/edk2/code/14844
Author:   jljusten
Date:     2013-11-12 18:35:32 +0000 (Tue, 12 Nov 2013)
Log Message:
-----------
OvmfPkg/BdsPlatform: don't restore NvVars from disk when flash is present

QemuFlashFvbServicesRuntimeDxe provides actual persistent storage for
non-volatile variables. When it is active, any on-disk NvVars file counts
as a stale source of variables -- hence don't load these files in BDS.

This also allows Secure Boot settings (eg. enrolled keys) to survive cold
VM reboots.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>

Modified Paths:
--------------
    trunk/edk2/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
    trunk/edk2/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf

Modified: trunk/edk2/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
===================================================================
--- trunk/edk2/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c     2013-11-12 
18:35:23 UTC (rev 14843)
+++ trunk/edk2/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c     2013-11-12 
18:35:32 UTC (rev 14844)
@@ -1073,11 +1073,16 @@
 
   ConnectRootBridge ();
 
-  //
-  // Try to restore variables from the hard disk early so
-  // they can be used for the other BDS connect operations.
-  //
-  PlatformBdsRestoreNvVarsFromHardDisk ();
+  if (PcdGetBool (PcdOvmfFlashVariablesEnable)) {
+    DEBUG ((EFI_D_INFO, "PlatformBdsPolicyBehavior: not restoring NvVars "
+      "from disk since flash variables appear to be supported.\n"));
+  } else {
+    //
+    // Try to restore variables from the hard disk early so
+    // they can be used for the other BDS connect operations.
+    //
+    PlatformBdsRestoreNvVarsFromHardDisk ();
+  }
 
   //
   // Init the time out value

Modified: trunk/edk2/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
===================================================================
--- trunk/edk2/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf        
2013-11-12 18:35:23 UTC (rev 14843)
+++ trunk/edk2/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf        
2013-11-12 18:35:32 UTC (rev 14844)
@@ -57,6 +57,7 @@
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformBootTimeOut
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile
   gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable
 
 [Pcd.IA32, Pcd.X64]
   gEfiMdePkgTokenSpaceGuid.PcdFSBClock

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
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-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to