public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>, Hao Wu <hao.a.wu@intel.com>
Subject: [PATCH 07/12] MdeModulePkg VariablePei: Don't check BOOT_IN_RECOVERY_MODE
Date: Sun, 13 Jan 2019 23:37:50 +0800	[thread overview]
Message-ID: <1547393875-37188-8-git-send-email-star.zeng@intel.com> (raw)
In-Reply-To: <1547393875-37188-1-git-send-email-star.zeng@intel.com>

Don't check BOOT_IN_RECOVERY_MODE, but check PcdEmuVariableNvModeEnable
which platform can configure flexibly.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Universal/Variable/Pei/Variable.c      | 8 +++++---
 MdeModulePkg/Universal/Variable/Pei/VariablePei.inf | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c b/MdeModulePkg/Universal/Variable/Pei/Variable.c
index 77b3eaeb210d..148c1cfefd90 100644
--- a/MdeModulePkg/Universal/Variable/Pei/Variable.c
+++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c
@@ -2,7 +2,7 @@
   Implement ReadOnly Variable Services required by PEIM and install
   PEI ReadOnly Varaiable2 PPI. These services operates the non volatile storage space.
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -584,9 +584,9 @@ GetVariableStore (
       break;
 
     case VariableStoreTypeNv:
-      if (GetBootModeHob () != BOOT_IN_RECOVERY_MODE) {
+      if (!PcdGetBool (PcdEmuVariableNvModeEnable)) {
         //
-        // The content of NV storage for variable is not reliable in recovery boot mode.
+        // Emulated non-volatile variable mode is not enabled.
         //
 
         NvStorageSize = PcdGet32 (PcdFlashNvStorageVariableSize);
@@ -594,6 +594,8 @@ GetVariableStore (
                                                 PcdGet64 (PcdFlashNvStorageVariableBase64) :
                                                 PcdGet32 (PcdFlashNvStorageVariableBase)
                                                );
+        ASSERT (NvStorageBase != 0);
+
         //
         // First let FvHeader point to NV storage base.
         //
diff --git a/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf b/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
index 565efdc02116..3161617a56c2 100644
--- a/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
+++ b/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
@@ -3,7 +3,7 @@
 #
 #  This module implements ReadOnly Variable Services required by PEIM and installs PEI ReadOnly Varaiable2 PPI.
 #
-#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
 #  which accompanies this distribution. The full text of the license may be found at
@@ -68,6 +68,7 @@ [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase      ## SOMETIMES_CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64    ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize      ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable         ## SOMETIMES_CONSUMES
 
 [Depex]
   gEdkiiFaultTolerantWriteGuid
-- 
2.7.0.windows.1



  parent reply	other threads:[~2019-01-13 15:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-13 15:37 [PATCH 00/12] Merge EmuVariable and Real variable driver Star Zeng
2019-01-13 15:37 ` [PATCH 01/12] MdeModulePkg Variable: Add some missing changes for 9b18845 Star Zeng
2019-01-14 10:15   ` Laszlo Ersek
2019-01-14 10:29     ` Zeng, Star
2019-01-13 15:37 ` [PATCH 02/12] MdeModulePkg Variable: Abstract InitRealNonVolatileVariableStore Star Zeng
2019-01-13 15:37 ` [PATCH 03/12] MdeModulePkg Variable: Not get NV PCD in VariableWriteServiceInitialize Star Zeng
2019-01-13 15:37 ` [PATCH 04/12] MdeModulePkg Variable: Abstract VariableWriteServiceInitializeDxe/Smm Star Zeng
2019-01-13 15:37 ` [PATCH 05/12] MdeModulePkg: Add PcdEmuVariableNvModeEnable in dsc Star Zeng
2019-01-14 10:22   ` Laszlo Ersek
2019-01-14 10:30     ` Zeng, Star
2019-01-13 15:37 ` [PATCH 06/12] MdeModulePkg Variable: Add emulated variable NV mode support Star Zeng
2019-01-14 10:57   ` Laszlo Ersek
2019-01-14 15:23     ` Zeng, Star
2019-01-13 15:37 ` Star Zeng [this message]
2019-01-13 15:37 ` [PATCH 08/12] ArmVirtXen: Use merged variable driver for emulated NV mode Star Zeng
2019-01-14 11:40   ` Laszlo Ersek
2019-01-14 15:25     ` Zeng, Star
2019-01-13 15:37 ` [PATCH 09/12] BeagleBoardPkg: " Star Zeng
2019-01-13 15:37 ` [PATCH 10/12] QuarkMin: " Star Zeng
2019-01-13 15:37 ` [PATCH 11/12] CorebootPayloadPkg: " Star Zeng
2019-01-13 15:37 ` [PATCH 12/12] MdeModule: Remove EmuVariableRuntimeDxe Star Zeng
2019-01-23  1:03   ` Wang, Jian J

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1547393875-37188-8-git-send-email-star.zeng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox