From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.372.1571243845638137634 for ; Wed, 16 Oct 2019 09:37:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=xnFSzGye; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: michael.a.kubacki@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 09:37:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,304,1566889200"; d="scan'208";a="225847906" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 16 Oct 2019 09:37:24 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 16 Oct 2019 09:37:24 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 16 Oct 2019 09:37:24 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.56) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 16 Oct 2019 09:37:24 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bd6FgwF+UEvbyoy0xV4NdG75Z8BWRgFAm4WWytrOLa+1jiJ7ZIinNDEQ5xXdU+KyU8rEnjxiwSjgu974cJQmpbHSEpxwP6aH4vIbzioK2Lxk5zZzzP7JqV4Xlus86rNLLPtn6014neK0NTb+Fm2q2H7gJWCx+tFEhXr2dxWxf1HinDWatGszGroSnVvJSIFKDuIxSK00MbZTQn6KlW80zm0xT+Sd4eumHCfKIdiW9axREaatipZsX0mpMrC3USlNbfkp6UabqYb856eCxdpmuZclbmyGvWv49xGaGP6F8cpBT7NlEEzo8RERcJyyRE3JdyD/NdwQaTT8YRLUwjodtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mbVHwnz5G+Ej9+5AV31zF7ti+uQsVSbDHjXDcEcj3IU=; b=FxVnSbfKmjfHpP9uQI3kysppunDnYEYB1pSqNtmmDeclNWAK+PaSuw6MvxjIlXArbMhVEA6nas4/bWAzaHH5ihThcoxor5bDdisKKver5tE7fQqVpCsftGOjNfbwK2M9lLwVYNQl1zwakq+uepKHO+wE6IP1JTnFFRDESAhQBUP9k5T25GIA6xjv/34ejEH+ByBSrGtgKP8L+e2mPRnQvHP+Y3zsLC3Tg10kMrld3uqlulF3z+y8v1TIOo6Y2hXDtNNX7wUZ0mKNdpLw5TkFoIUxnh3YfPpihErbTvcFmYuzamnAh8Q+azhOC2ENFc7bMUcbn73+jZr7wtFdTrXwIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mbVHwnz5G+Ej9+5AV31zF7ti+uQsVSbDHjXDcEcj3IU=; b=xnFSzGye/qhg2NtP1YTEgMV1qpZYCfQWNaWsUH8fxK+4MNX6OVONoM+YMaCEgbzBthslR6R83EO4J/aUuAhr/JLCHTqr6olrbw3RbEBm89nvBlOHbNK82ExeNespIPR8LzfZQNxZGz6YS06A3ls2WbvWhsivFNtpNC3WGo+e3fY= Received: from DM6PR11MB3834.namprd11.prod.outlook.com (20.179.17.87) by DM6PR11MB4410.namprd11.prod.outlook.com (52.132.249.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Wed, 16 Oct 2019 16:37:22 +0000 Received: from DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::21f7:6d8d:919b:d755]) by DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::21f7:6d8d:919b:d755%6]) with mapi id 15.20.2347.023; Wed, 16 Oct 2019 16:37:22 +0000 From: "Kubacki, Michael A" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: "Bi, Dandan" , Ard Biesheuvel , "Dong, Eric" , Laszlo Ersek , "Gao, Liming" , "Kinney, Michael D" , "Ni, Ray" , "Wang, Jian J" , "Yao, Jiewen" Subject: Re: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add local auth status in VariableParsing Thread-Topic: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add local auth status in VariableParsing Thread-Index: AQHVecEgBh+IMrhGiEKotiaH5kD0SqdJNwRggBPDjoCAAI7YoA== Date: Wed, 16 Oct 2019 16:37:21 +0000 Message-ID: References: <20190928014717.31372-1-michael.a.kubacki@intel.com> <20190928014717.31372-5-michael.a.kubacki@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzE2OGVlOWQtYzVjMy00N2IwLWE4N2UtZDlmMmY5M2M0YWQ5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiem5qZ1orN1l0TFc0SjNwV3JmV1M3QUZ6NEhWaTRmK2lHR3J6RzIrdnFvTmxvOHVXYmhIaXk3ak9ueWNzYU9HWSJ9 dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=michael.a.kubacki@intel.com; x-originating-ip: [134.134.136.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d68e2a2b-ec33-4bc6-1e02-08d752571e61 x-ms-traffictypediagnostic: DM6PR11MB4410: x-ms-exchange-purlcount: 3 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0192E812EC x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(346002)(376002)(396003)(366004)(13464003)(199004)(189003)(110136005)(33656002)(102836004)(76176011)(316002)(66946007)(54906003)(52536014)(66476007)(66556008)(7696005)(76116006)(64756008)(66446008)(5660300002)(99286004)(30864003)(2501003)(6506007)(26005)(186003)(53546011)(66066001)(25786009)(14454004)(6246003)(966005)(229853002)(478600001)(6306002)(6116002)(3846002)(55016002)(107886003)(9686003)(305945005)(6436002)(74316002)(7736002)(4326008)(446003)(11346002)(476003)(14444005)(256004)(71190400001)(2906002)(71200400001)(8936002)(486006)(86362001)(8676002)(81156014)(81166006);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR11MB4410;H:DM6PR11MB3834.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7iNW0wvJhClUZ5QCxjyOm63dJBYmfNYBrS6xChgn166JUDuA6FUfSkztM3jXbcEJc6KZKf/OFOSgBCZqYPMPr3hR8Cj0VkFP25KJLciFKbJsG49HCx9C/zHSY0CmmNOPLDr82vWZH+H+kgt74FelYaSQAjQvu8ZFbF/96NJnTvAijd/pDJpSwJS0kmPTeGlh6ebpnd4Fmuhg/dtYInvo8s0IR0WInE8EmxfDwC59V9UeqQ391nfNuU6Ru2HV1cqqQJjcdlzVbUJgGQ/kH1mRx5WQQuSny6XiaJJr/Wfbt5PQCXhl5k7ekSkuoA4diG0jlYAhXx+NN054VPopklyKAXZQXBoemfOUxpo7LAxhpalOmIAH0BYbLpp+iG7qKC98bS0uYAYxHFPc65ZTuHxRuaYDdvGj4MA84DO7pUMUrcijE6ovGdjqjnJWoDLhkFXm6ucuqR02iNMINdIJQoOzIg== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d68e2a2b-ec33-4bc6-1e02-08d752571e61 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2019 16:37:21.9169 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: n38Ioq81DIzlwYtA/Pk95mauGyELUCxVkWZF3oAj1qmUASWAhL3GBH7ir+kxKesbGywANujfYSvjjXfQPSkAvlYuRB7t7PgaHEhVdUQRM10= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4410 Return-Path: michael.a.kubacki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The InitVariableParsing () function has already been removed entirely in V3= + to prevent issues like this. I strongly believe this is the right direction. = It is only a matter of time before someone else modifies the global and forgets to call InitVariableParsing (). Furthermore, VariablePei has already added a parameter to most of the equi= valent functions implemented in that driver so there's some potential to further consolidate the variable parsing implementation in the future. Thanks, Michael > -----Original Message----- > From: Wu, Hao A > Sent: Wednesday, October 16, 2019 12:55 AM > To: Kubacki, Michael A ; > devel@edk2.groups.io > Cc: Bi, Dandan ; Ard Biesheuvel > ; Dong, Eric ; Laszlo Er= sek > ; Gao, Liming ; Kinney, Michael > D ; Ni, Ray ; Wang, Jian J > ; Yao, Jiewen > Subject: RE: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add loca= l > auth status in VariableParsing >=20 > > -----Original Message----- > > From: Kubacki, Michael A > > Sent: Friday, October 04, 2019 2:35 AM > > To: Wu, Hao A; devel@edk2.groups.io > > Cc: Bi, Dandan; Ard Biesheuvel; Dong, Eric; Laszlo Ersek; Gao, Liming; > > Kinney, Michael D; Ni, Ray; Wang, Jian J; Yao, Jiewen > > Subject: RE: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add > > local auth status in VariableParsing > > > > I will make the following changes in V3: > > > > > InitVariableParsing() seems an internal function, the 'EFIAPI' > > > keyword can > > be > > > dropped. Please help to update the function definition in .C file as= well. > > > > I will remove the EFIAPI keyword. > > > > > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > > > index 1a57d7e1ba..53d797152c 100644 > > > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > > > @@ -3326,6 +3326,9 @@ InitNonVolatileVariableStore ( > > > > mVariableModuleGlobal->MaxVariableSize =3D PcdGet32 > > > > (PcdMaxVariableSize); > > > > mVariableModuleGlobal->MaxAuthVariableSize =3D ((PcdGet32 > > > > (PcdMaxAuthVariableSize) !=3D 0) ? PcdGet32 (PcdMaxAuthVariableSiz= e) > : > > > > mVariableModuleGlobal->MaxVariableSize); > > > > > > > > + Status =3D InitVariableParsing (mVariableModuleGlobal- > > > > >VariableGlobal.AuthFormat); > > > > + ASSERT_EFI_ERROR (Status); > > > > + > > > > > > > > > After the above initialization, mVariableModuleGlobal- > > > >VariableGlobal.AuthFormat > > > will be changed temporarily within > > > ConvertNormalVarStorageToAuthVarStorage() if normal HOB variable > > > store will be converted to the auth format: > > > > > > VOID * > > > ConvertNormalVarStorageToAuthVarStorage ( > > > VARIABLE_STORE_HEADER *NormalVarStorage > > > ) > > > { > > > ... > > > // > > > // Set AuthFormat as FALSE for normal variable storage > > > // > > > mVariableModuleGlobal->VariableGlobal.AuthFormat =3D FALSE; > > > ... > > > // > > > // Restore AuthFormat > > > // > > > mVariableModuleGlobal->VariableGlobal.AuthFormat =3D TRUE; > > > return AuthVarStorage; > > > } > > > > > > > > > I think there will be issues in such converting, since I found that > > > at least > > > GetVariableHeaderSize() and NameSizeOfVariable() get called during > > > the execution of ConvertNormalVarStorageToAuthVarStorage(). And > they > > > are checking 'mAuthFormat' rather than 'mVariableModuleGlobal- > > > >VariableGlobal.AuthFormat'. > > > > > > > > > > You're right that will be a problem. I missed this temporary change in > > the value. > > I'm going to have all the functions dependent on authentication status > > in VariableParsing.c take it as a parameter and let the respective > > drivers linked against it maintain their own single copy of the authen= tication > state. >=20 >=20 > I am really sorry for not raising this question until I saw the latest p= atch > series: >=20 > Is it possible to call the InitVariableParsing() function (maybe a renam= e for > the function for better understanding) for the temporary changes for > 'mVariableModuleGlobal->VariableGlobal.AuthFormat' in function > ConvertNormalVarStorageToAuthVarStorage()? >=20 > In my opinion, doing so can avoid changing many function interfaces. >=20 > Best Regards, > Hao Wu >=20 >=20 > > > > > > // > > > > // Parse non-volatile variable data and get last variable offse= t. > > > > // > > > > @@ -3756,18 +3759,13 @@ VariableCommonInitialize ( > > > > > > > > // > > > > // mVariableModuleGlobal->VariableGlobal.AuthFormat > > > > - // has been initialized in InitNonVolatileVariableStore(). > > > > + // is initialized in InitNonVolatileVariableStore(). > > > > // > > > > if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > > > DEBUG ((EFI_D_INFO, "Variable driver will work with auth > > > > variable format!\n")); > > > > - // > > > > - // Set AuthSupport to FALSE first, VariableWriteServiceInitia= lize() will > > > > initialize it. > > > > - // > > > > - mVariableModuleGlobal->VariableGlobal.AuthSupport =3D FALSE; > > > > VariableGuid =3D &gEfiAuthenticatedVariableGuid; > > > > } else { > > > > DEBUG ((EFI_D_INFO, "Variable driver will work without auth > > > > variable support!\n")); > > > > - mVariableModuleGlobal->VariableGlobal.AuthSupport =3D FALSE; > > > > > > > > > Not sure why the above changes belong to this patch. > > > Could you help to double confirm? > > > > This was used during testing and is not needed. I will remove it. > > > > Thanks, > > Michael > > > > > -----Original Message----- > > > From: Wu, Hao A > > > Sent: Thursday, October 3, 2019 1:04 AM > > > To: devel@edk2.groups.io; Kubacki, Michael A > > > > > > Cc: Bi, Dandan ; Ard Biesheuvel > > > ; Dong, Eric ; > > > Laszlo > > Ersek > > > ; Gao, Liming ; Kinney, > > Michael > > > D ; Ni, Ray ; Wang, > > > Jian J ; Yao, Jiewen > > > Subject: RE: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add > > local > > > auth status in VariableParsing > > > > > > Inline comments below: > > > > > > > > > > -----Original Message----- > > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf > > Of > > > > Kubacki, Michael A > > > > Sent: Saturday, September 28, 2019 9:47 AM > > > > To: devel@edk2.groups.io > > > > Cc: Bi, Dandan; Ard Biesheuvel; Dong, Eric; Laszlo Ersek; Gao, > > > > Liming; Kinney, Michael D; Ni, Ray; Wang, Jian J; Wu, Hao A; Yao, > > > > Jiewen > > > > Subject: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add > > > > local auth status in VariableParsing > > > > > > > > The file VariableParsing.c provides generic functionality related > > > > to parsing variable related structures and information. In order > > > > to calculate offsets for certain operations, the functions must > > > > know if authenticated variables are enabled as this increases the > > > > size of variable headers. > > > > > > > > This change removes linking against a global variable in an > > > > external file in favor of a statically scoped variable in > > > > VariableParsing.c Because this file is unaware of how the > > > > authenticated variable status is determined, the variable is set > > > > through a function interface invoked during variable driver initia= lization. > > > > > > > > Cc: Dandan Bi > > > > Cc: Ard Biesheuvel > > > > Cc: Eric Dong > > > > Cc: Laszlo Ersek > > > > Cc: Liming Gao > > > > Cc: Michael D Kinney > > > > Cc: Ray Ni > > > > Cc: Jian J Wang > > > > Cc: Hao A Wu > > > > Cc: Jiewen Yao > > > > Signed-off-by: Michael Kubacki > > > > --- > > > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h | > 14 > > > > +++++++++ > > > > MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 10 > > +++--- > > > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c | > 33 > > > > ++++++++++++++++---- > > > > 3 files changed, 45 insertions(+), 12 deletions(-) > > > > > > > > diff --git > > > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > > > index 6f2000f3ee..3eba590634 100644 > > > > --- > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > > > +++ > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > > > @@ -308,4 +308,18 @@ UpdateVariableInfo ( > > > > IN OUT VARIABLE_INFO_ENTRY **VariableInfo > > > > ); > > > > > > > > +/** > > > > + Initializes context needed for variable parsing functions. > > > > + > > > > + @param[in] AuthFormat If true then indicates aut= henticated > > > > variables are supported > > > > + > > > > + @retval EFI_SUCCESS Initialized successfully > > > > + @retval Others An error occurred during i= nitialization > > > > +**/ > > > > +EFI_STATUS > > > > +EFIAPI > > > > +InitVariableParsing ( > > > > > > > > > InitVariableParsing() seems an internal function, the 'EFIAPI' > > > keyword can > > be > > > dropped. Please help to update the function definition in .C file as= well. > > > > > > > > > > + IN BOOLEAN AuthFormat > > > > + ); > > > > + > > > > #endif > > > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > > > index 1a57d7e1ba..53d797152c 100644 > > > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > > > @@ -3326,6 +3326,9 @@ InitNonVolatileVariableStore ( > > > > mVariableModuleGlobal->MaxVariableSize =3D PcdGet32 > > > > (PcdMaxVariableSize); > > > > mVariableModuleGlobal->MaxAuthVariableSize =3D ((PcdGet32 > > > > (PcdMaxAuthVariableSize) !=3D 0) ? PcdGet32 (PcdMaxAuthVariableSiz= e) > : > > > > mVariableModuleGlobal->MaxVariableSize); > > > > > > > > + Status =3D InitVariableParsing (mVariableModuleGlobal- > > > > >VariableGlobal.AuthFormat); > > > > + ASSERT_EFI_ERROR (Status); > > > > + > > > > > > > > > After the above initialization, mVariableModuleGlobal- > > > >VariableGlobal.AuthFormat > > > will be changed temporarily within > > > ConvertNormalVarStorageToAuthVarStorage() if normal HOB variable > > > store will be converted to the auth format: > > > > > > VOID * > > > ConvertNormalVarStorageToAuthVarStorage ( > > > VARIABLE_STORE_HEADER *NormalVarStorage > > > ) > > > { > > > ... > > > // > > > // Set AuthFormat as FALSE for normal variable storage > > > // > > > mVariableModuleGlobal->VariableGlobal.AuthFormat =3D FALSE; > > > ... > > > // > > > // Restore AuthFormat > > > // > > > mVariableModuleGlobal->VariableGlobal.AuthFormat =3D TRUE; > > > return AuthVarStorage; > > > } > > > > > > > > > I think there will be issues in such converting, since I found that > > > at least > > > GetVariableHeaderSize() and NameSizeOfVariable() get called during > > > the execution of ConvertNormalVarStorageToAuthVarStorage(). And > they > > > are checking 'mAuthFormat' rather than 'mVariableModuleGlobal- > > > >VariableGlobal.AuthFormat'. > > > > > > > > > > // > > > > // Parse non-volatile variable data and get last variable offse= t. > > > > // > > > > @@ -3756,18 +3759,13 @@ VariableCommonInitialize ( > > > > > > > > // > > > > // mVariableModuleGlobal->VariableGlobal.AuthFormat > > > > - // has been initialized in InitNonVolatileVariableStore(). > > > > + // is initialized in InitNonVolatileVariableStore(). > > > > // > > > > if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > > > DEBUG ((EFI_D_INFO, "Variable driver will work with auth > > > > variable format!\n")); > > > > - // > > > > - // Set AuthSupport to FALSE first, VariableWriteServiceInitia= lize() will > > > > initialize it. > > > > - // > > > > - mVariableModuleGlobal->VariableGlobal.AuthSupport =3D FALSE; > > > > VariableGuid =3D &gEfiAuthenticatedVariableGuid; > > > > } else { > > > > DEBUG ((EFI_D_INFO, "Variable driver will work without auth > > > > variable support!\n")); > > > > - mVariableModuleGlobal->VariableGlobal.AuthSupport =3D FALSE; > > > > > > > > > Not sure why the above changes belong to this patch. > > > Could you help to double confirm? > > > > > > Best Regards, > > > Hao Wu > > > > > > > > > > VariableGuid =3D &gEfiVariableGuid; > > > > } > > > > > > > > diff --git > > > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > > > index 394195342d..0a47f6d10d 100644 > > > > --- > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > > > +++ > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > > > @@ -9,6 +9,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > #include "VariableParsing.h" > > > > > > > > +STATIC BOOLEAN mAuthFormat; > > > > + > > > > /** > > > > > > > > This code checks if variable header is valid or not. > > > > @@ -88,7 +90,7 @@ GetVariableHeaderSize ( { > > > > UINTN Value; > > > > > > > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > > > + if (mAuthFormat) { > > > > Value =3D sizeof (AUTHENTICATED_VARIABLE_HEADER); > > > > } else { > > > > Value =3D sizeof (VARIABLE_HEADER); @@ -114,7 +116,7 @@ > > > > NameSizeOfVariable ( > > > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > > > + if (mAuthFormat) { > > > > if (AuthVariable->State =3D=3D (UINT8) (-1) || > > > > AuthVariable->DataSize =3D=3D (UINT32) (-1) || > > > > AuthVariable->NameSize =3D=3D (UINT32) (-1) || @@ -149,7 > > > > +151,7 @@ SetNameSizeOfVariable ( > > > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > > > + if (mAuthFormat) { > > > > AuthVariable->NameSize =3D (UINT32) NameSize; > > > > } else { > > > > Variable->NameSize =3D (UINT32) NameSize; @@ -173,7 +175,7 @@ > > > > DataSizeOfVariable ( > > > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > > > + if (mAuthFormat) { > > > > if (AuthVariable->State =3D=3D (UINT8) (-1) || > > > > AuthVariable->DataSize =3D=3D (UINT32) (-1) || > > > > AuthVariable->NameSize =3D=3D (UINT32) (-1) || @@ -208,7 > > > > +210,7 @@ SetDataSizeOfVariable ( > > > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > > > + if (mAuthFormat) { > > > > AuthVariable->DataSize =3D (UINT32) DataSize; > > > > } else { > > > > Variable->DataSize =3D (UINT32) DataSize; @@ -248,7 +250,7 @@ > > > > GetVendorGuidPtr ( > > > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > > > + if (mAuthFormat) { > > > > return &AuthVariable->VendorGuid; > > > > } else { > > > > return &Variable->VendorGuid; @@ -746,3 +748,22 @@ > > > > UpdateVariableInfo ( > > > > } > > > > } > > > > } > > > > + > > > > +/** > > > > + Initializes context needed for variable parsing functions. > > > > + > > > > + @param[in] AuthFormat If true then indicates aut= henticated > > > > variables are supported > > > > + > > > > + @retval EFI_SUCCESS Initialized successfully > > > > + @retval Others An error occurred during i= nitialization > > > > +**/ > > > > +EFI_STATUS > > > > +EFIAPI > > > > +InitVariableParsing ( > > > > + IN BOOLEAN AuthFormat > > > > + ) > > > > +{ > > > > + mAuthFormat =3D AuthFormat; > > > > + > > > > + return EFI_SUCCESS; > > > > +} > > > > -- > > > > 2.16.2.windows.1 > > > > > > > > > > > >=20 > > > > > >=20