From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.4607.1585641878635917486 for ; Tue, 31 Mar 2020 01:04:38 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: guomin.jiang@intel.com) IronPort-SDR: pGmb6PRNpjAhKL1fOuPcK4KaOuUkQkK+DoFseAgsyeKAzdS7MWSBcoQtwy6P/utig3rvBRtj1+ dqS5mSxalRSQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 01:04:38 -0700 IronPort-SDR: ru3G3qSiHBeiICQQJwXygclfUn9MI2/LNSYFRklcHOXoVa0ifSxZ3duQq35JcuWPQIU81VJvyp VGQd90v9py6A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="328011936" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 31 Mar 2020 01:04:37 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 01:04:37 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 01:04:37 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.89]) with mapi id 14.03.0439.000; Tue, 31 Mar 2020 16:04:35 +0800 From: "Guomin Jiang" To: "devel@edk2.groups.io" , "Wang, Jian J" , "michael.kubacki@outlook.com" CC: Bret Barkelew , "Gao, Liming" , "Kinney, Michael D" , "Wu, Hao A" Subject: Re: [edk2-devel] [PATCH v3 2/3] MdeModulePkg VariablePei: Return GetVariable() attr if EFI_BUFFER_TOO_SMALL Thread-Topic: [edk2-devel] [PATCH v3 2/3] MdeModulePkg VariablePei: Return GetVariable() attr if EFI_BUFFER_TOO_SMALL Thread-Index: AQHWBIKTDZQ3FZ/lzkKEbHNvwEEag6hgBY0AgAJW/xA= Date: Tue, 31 Mar 2020 08:04:34 +0000 Message-ID: References: <20200327215536.9556-1-michael.kubacki@outlook.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: guomin.jiang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Guomin Jiang > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Wang, Jian J > Sent: Monday, March 30, 2020 12:19 PM > To: michael.kubacki@outlook.com; devel@edk2.groups.io > Cc: Bret Barkelew ; Gao, Liming > ; Kinney, Michael D ; > Wu, Hao A > Subject: Re: [edk2-devel] [PATCH v3 2/3] MdeModulePkg VariablePei: > Return GetVariable() attr if EFI_BUFFER_TOO_SMALL >=20 > Reviewed-by: Jian J Wang >=20 > Regards, > Jian >=20 > > -----Original Message----- > > From: michael.kubacki@outlook.com > > Sent: Saturday, March 28, 2020 5:56 AM > > To: devel@edk2.groups.io > > Cc: Bret Barkelew ; Gao, Liming > > ; Kinney, Michael D > > ; Wang, Jian J ; > > Wu, Hao A > > Subject: [PATCH v3 2/3] MdeModulePkg VariablePei: Return GetVariable() > > attr if EFI_BUFFER_TOO_SMALL > > > > From: Michael Kubacki > > > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2062 > > > > This commit makes the behavior for PeiGetVariable() match the > > following specification-defined behavior. It is now consistent with > > the DXE/SMM variable driver implementation. > > > > The UEFI specification v2.8 Errata A Section 8.2 "GetVariable()" > > "Attributes" parameter description states: > > > > "If not NULL, a pointer to the memory location to return the > > attributes bitmask for the variable. See 'Related Definitions.' > > If not NULL, then Attributes is set on output both when EFI_SUCCESS > > and when EFI_BUFFER_TOO_SMALL is returned." > > > > The attributes were previously only returned from the implementation > > in Variable.c on EFI_SUCCESS. They are now returned on EFI_SUCCESS or > > EFI_BUFFER_TOO_SMALL according to spec. > > > > Cc: Bret Barkelew > > Cc: Liming Gao > > Cc: Michael D Kinney > > Cc: Jian J Wang > > Cc: Hao A Wu > > Signed-off-by: Michael Kubacki > > --- > > MdeModulePkg/Universal/Variable/Pei/Variable.c | 19 > > ++++++++++--------- > > 1 file changed, 10 insertions(+), 9 deletions(-) > > > > diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c > > b/MdeModulePkg/Universal/Variable/Pei/Variable.c > > index f61465fc3045..f420b58165b7 100644 > > --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c > > +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c > > @@ -3,6 +3,7 @@ > > PEI ReadOnly Varaiable2 PPI. These services operates the non > > volatile storage space. > > > > Copyright (c) 2006 - 2019, Intel Corporation. All rights > > reserved.
> > +Copyright (c) Microsoft Corporation.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -1047,17 +1048,17 @@ PeiGetVariable ( > > } > > > > GetVariableNameOrData (&StoreInfo, GetVariableDataPtr > > (Variable.CurrPtr, VariableHeader, StoreInfo.AuthFlag), VarDataSize, > > Data); > > - > > - if (Attributes !=3D NULL) { > > - *Attributes =3D VariableHeader->Attributes; > > - } > > - > > - *DataSize =3D VarDataSize; > > - return EFI_SUCCESS; > > + Status =3D EFI_SUCCESS; > > } else { > > - *DataSize =3D VarDataSize; > > - return EFI_BUFFER_TOO_SMALL; > > + Status =3D EFI_BUFFER_TOO_SMALL; > > } > > + > > + if (Attributes !=3D NULL) { > > + *Attributes =3D VariableHeader->Attributes; } *DataSize =3D > > + VarDataSize; > > + > > + return Status; > > } > > > > /** > > -- > > 2.16.3.windows.1 >=20 >=20 >=20