From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5A87A211B5A25 for ; Tue, 15 Jan 2019 23:29:03 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2019 23:29:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,485,1539673200"; d="scan'208";a="267499574" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 15 Jan 2019 23:29:02 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 15 Jan 2019 23:29:02 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 15 Jan 2019 23:29:01 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.196]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.85]) with mapi id 14.03.0415.000; Wed, 16 Jan 2019 15:29:00 +0800 From: "Wu, Hao A" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH V3 11/17] MdeModulePkg VariablePei: Don't check BOOT_IN_RECOVERY_MODE Thread-Index: AQHUrL1H0YtsbAYur0KZ7CD9QjzoRqWxctrg Date: Wed, 16 Jan 2019 07:28:59 +0000 Message-ID: References: <1547548179-42552-1-git-send-email-star.zeng@intel.com> <1547548179-42552-12-git-send-email-star.zeng@intel.com> In-Reply-To: <1547548179-42552-12-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH V3 11/17] MdeModulePkg VariablePei: Don't check BOOT_IN_RECOVERY_MODE X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2019 07:29:03 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao Wu Best Regards, Hao Wu > -----Original Message----- > From: Zeng, Star > Sent: Tuesday, January 15, 2019 6:30 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star; Wang, Jian J; Wu, Hao A > Subject: [PATCH V3 11/17] MdeModulePkg VariablePei: Don't check > BOOT_IN_RECOVERY_MODE >=20 > Don't check BOOT_IN_RECOVERY_MODE, but check > PcdEmuVariableNvModeEnable > which platform can configure flexibly. >=20 > Cc: Jian J Wang > Cc: Hao Wu > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Universal/Variable/Pei/Variable.c | 8 +++++--- > MdeModulePkg/Universal/Variable/Pei/VariablePei.inf | 3 ++- > 2 files changed, 7 insertions(+), 4 deletions(-) >=20 > 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. >=20 > -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BS= D > License > which accompanies this distribution. The full text of the license may b= e > found at > @@ -584,9 +584,9 @@ GetVariableStore ( > break; >=20 > case VariableStoreTypeNv: > - if (GetBootModeHob () !=3D BOOT_IN_RECOVERY_MODE) { > + if (!PcdGetBool (PcdEmuVariableNvModeEnable)) { > // > - // The content of NV storage for variable is not reliable in rec= overy > boot mode. > + // Emulated non-volatile variable mode is not enabled. > // >=20 > NvStorageSize =3D PcdGet32 (PcdFlashNvStorageVariableSize); > @@ -594,6 +594,8 @@ GetVariableStore ( > PcdGet64 (PcdFlashNvStor= ageVariableBase64) : > PcdGet32 (PcdFlashNvStor= ageVariableBase) > ); > + ASSERT (NvStorageBase !=3D 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. > +# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved. > # 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 >=20 > [Depex] > gEdkiiFaultTolerantWriteGuid > -- > 2.7.0.windows.1