From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.4725.1585642703134671485 for ; Tue, 31 Mar 2020 01:18:23 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: guomin.jiang@intel.com) IronPort-SDR: 27ql/BW2hL/cr7+88L7i/Q+cXuJ44T+faaZzgGs1tsR7/6frGwPp8JQ77mTe540k3NYqVYmhR9 mvwFVt2QjvLg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 01:18:15 -0700 IronPort-SDR: R5RiOPiLhDy0jMb2BVQrU0e72MYuK+Jf4FGZRU1a5NuSj0oCPy+O+nutU+kiah1vwvpTqF9B0q BDw7n0t8T0IQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="283918291" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 31 Mar 2020 01:18:14 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 01:18:14 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 01:18:14 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.146]) with mapi id 14.03.0439.000; Tue, 31 Mar 2020 16:18:12 +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 1/3] MdeModulePkg Variable: Return GetVariable() attr if EFI_BUFFER_TOO_SMALL Thread-Topic: [edk2-devel] [PATCH v3 1/3] MdeModulePkg Variable: Return GetVariable() attr if EFI_BUFFER_TOO_SMALL Thread-Index: AQHWBIKRF+YD0WD1qUWgKIjjuAnFUahgBLOAgAJao5A= Date: Tue, 31 Mar 2020 08:18:11 +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 There is a spell error in the comments of VariableServiceGetVariable() in V= ariable.c. - @return EFI_BUFFER_TO_SMALL DataSize is too small for the result. + @return EFI_BUFFER_TOO_SMALL DataSize is too small for the result. Need create new bugs for it or fix in this comment directly? > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Wang, Jian J > Sent: Monday, March 30, 2020 12:16 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 1/3] MdeModulePkg Variable: Return > GetVariable() attr if EFI_BUFFER_TOO_SMALL >=20 >=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 1/3] MdeModulePkg Variable: Return GetVariable() > > attr if EFI_BUFFER_TOO_SMALL > > > > From: Michael Kubacki > > > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2062 > > > > 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/RuntimeDxe/Variable.c | = 10 > > +++++++--- > > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe. > c | > > 10 ++++++---- > > 2 files changed, 13 insertions(+), 7 deletions(-) > > > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > index d23aea4bc712..1e71fc642c76 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > @@ -18,6 +18,8 @@ > > > > Copyright (c) 2006 - 2020, Intel Corporation. All rights > > reserved.
> > (C) Copyright 2015-2018 Hewlett Packard Enterprise Development LP
> > +Copyright (c) Microsoft Corporation.
> > + > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -2379,9 +2381,6 @@ VariableServiceGetVariable ( > > } > > > > CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr, > > mVariableModuleGlobal->VariableGlobal.AuthFormat), VarDataSize); > > - if (Attributes !=3D NULL) { > > - *Attributes =3D Variable.CurrPtr->Attributes; > > - } > > > > *DataSize =3D VarDataSize; > > UpdateVariableInfo (VariableName, VendorGuid, Variable.Volatile, > > TRUE, FALSE, FALSE, FALSE, &gVariableInfo); @@ -2395,6 +2394,11 @@ > > VariableServiceGetVariable ( > > } > > > > Done: > > + if (Status =3D=3D EFI_SUCCESS || Status =3D=3D EFI_BUFFER_TOO_SMALL= ) { > > + if (Attributes !=3D NULL && Variable.CurrPtr !=3D NULL) { > > + *Attributes =3D Variable.CurrPtr->Attributes; > > + } > > + } > > ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal- > > >VariableGlobal.VariableServicesLock); > > return Status; > > } > > diff --git > > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDx > e.c > > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDx > e.c > > index 2cf0ed32ae55..ca833fb0244d 100644 > > --- > > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDx > e.c > > +++ > > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDx > e.c > > @@ -14,6 +14,7 @@ > > InitCommunicateBuffer() is really function to check the variable da= ta size. > > > > Copyright (c) 2010 - 2019, Intel Corporation. All rights > > reserved.
> > +Copyright (c) Microsoft Corporation.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -642,10 +643,6 @@ FindVariableInRuntimeCache ( > > } > > > > CopyMem (Data, GetVariableDataPtr (RtPtrTrack.CurrPtr, > > mVariableAuthFormat), TempDataSize); > > - if (Attributes !=3D NULL) { > > - *Attributes =3D RtPtrTrack.CurrPtr->Attributes; > > - } > > - > > *DataSize =3D TempDataSize; > > > > UpdateVariableInfo (VariableName, VendorGuid, > > RtPtrTrack.Volatile, TRUE, FALSE, FALSE, TRUE, &mVariableInfo); @@ > > -661,6 +658,11 @@ FindVariableInRuntimeCache ( > > } > > > > Done: > > + if (Status =3D=3D EFI_SUCCESS || Status =3D=3D EFI_BUFFER_TOO_SMALL= ) { > > + if (Attributes !=3D NULL && RtPtrTrack.CurrPtr !=3D NULL) { > > + *Attributes =3D RtPtrTrack.CurrPtr->Attributes; > > + } > > + } > > mVariableRuntimeCacheReadLock =3D FALSE; > > > > return Status; > > -- > > 2.16.3.windows.1 >=20 >=20 >=20