]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg Variable: Before EndOfDxe, just record the current boot VarErrorFlag...
authorStar Zeng <star.zeng@intel.com>
Mon, 2 Feb 2015 03:18:10 +0000 (03:18 +0000)
committerlzeng14 <lzeng14@Edk2>
Mon, 2 Feb 2015 03:18:10 +0000 (03:18 +0000)
And leave the variable error flag in NV flash as the last boot variable error flag.
After EndOfDxe in InitializeVarErrorFlag (), the variable error flag in NV flash
will be initialized to this local current boot variable error flag.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16685 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/VariableAuthenticated/RuntimeDxe/Variable.c

index 7a42d971e0caf191ce193cb43bd33045dcfca032..83d69899f705e936e6b4c27a1230bbf83c529adf 100644 (file)
@@ -58,7 +58,10 @@ BOOLEAN                mEndOfDxe              = FALSE;
 ///\r
 BOOLEAN                mEnableLocking         = TRUE;\r
 \r
 ///\r
 BOOLEAN                mEnableLocking         = TRUE;\r
 \r
-/**\r
+//\r
+// It will record the current boot error flag before EndOfDxe.\r
+//\r
+VAR_ERROR_FLAG         mCurrentBootVarErrFlag = VAR_ERROR_FLAG_NO_ERROR;\r
 \r
   SecureBoot Hook for auth variable update.\r
 \r
 \r
   SecureBoot Hook for auth variable update.\r
 \r
@@ -579,6 +582,17 @@ RecordVarErrorFlag (
     }\r
   );\r
 \r
     }\r
   );\r
 \r
+  if (!mEndOfDxe) {\r
+    //\r
+    // Before EndOfDxe, just record the current boot variable error flag to local variable,\r
+    // and leave the variable error flag in NV flash as the last boot variable error flag.\r
+    // After EndOfDxe in InitializeVarErrorFlag (), the variable error flag in NV flash\r
+    // will be initialized to this local current boot variable error flag.\r
+    //\r
+    mCurrentBootVarErrFlag &= Flag;\r
+    return;\r
+  }\r
+\r
   //\r
   // Record error flag (it should have be initialized).\r
   //\r
   //\r
   // Record error flag (it should have be initialized).\r
   //\r
@@ -637,7 +651,7 @@ InitializeVarErrorFlag (
     return;\r
   }\r
 \r
     return;\r
   }\r
 \r
-  Flag = VAR_ERROR_FLAG_NO_ERROR;\r
+  Flag = mCurrentBootVarErrFlag;\r
   DEBUG ((EFI_D_INFO, "Initialize variable error flag (%02x)\n", Flag));\r
 \r
   Status = FindVariable (\r
   DEBUG ((EFI_D_INFO, "Initialize variable error flag (%02x)\n", Flag));\r
 \r
   Status = FindVariable (\r