public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Kubacki" <michael.kubacki@outlook.com>
To: Laszlo Ersek <lersek@redhat.com>, devel@edk2.groups.io
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>,
	Liming Gao <liming.gao@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>,
	Hao A Wu <hao.a.wu@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg/Variable: Return GetVariable() attr if EFI_BUFFER_TOO_SMALL
Date: Tue, 24 Mar 2020 20:04:11 -0700	[thread overview]
Message-ID: <MWHPR07MB344020DA89F7AC570C678621E9CE0@MWHPR07MB3440.namprd07.prod.outlook.com> (raw)
In-Reply-To: <b0fbce6b-2389-b899-25f0-29e0d2938db3@redhat.com>

Hi Laszlo,

I sent a v2 patch series with that commit reverted as patch 2/2.

Thanks,
Michael

On 3/24/2020 6:57 PM, Laszlo Ersek wrote:
> Hello Michael,
> 
> On 03/24/20 23:04, Michael Kubacki wrote:
>> From: Michael Kubacki <michael.kubacki@microsoft.com>
>>
>> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2062
>>
>> 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 <Bret.Barkelew@microsoft.com>
>> Cc: Liming Gao <liming.gao@intel.com>
>> Cc: Michael D Kinney <michael.d.kinney@intel.com>
>> Cc: Jian J Wang <jian.j.wang@intel.com>
>> Cc: Hao A Wu <hao.a.wu@intel.com>
>> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
>> ---
>>   MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c              | 10 +++++++---
>>   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 10 ++++++----
>>   2 files changed, 13 insertions(+), 7 deletions(-)
> 
> per <https://bugzilla.tianocore.org/show_bug.cgi?id=2062#c2>:
> 
> Can you please turn this submission into a two-part patch series, and
> append a revert of commit 6896efdec270, as second patch?
> 
> Thank you,
> Laszlo
> 
>> 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.<BR>
>>   (C) Copyright 2015-2018 Hewlett Packard Enterprise Development LP<BR>
>> +Copyright (c) Microsoft Corporation.<BR>
>> +
>>   SPDX-License-Identifier: BSD-2-Clause-Patent
>>   
>>   **/
>> @@ -2379,9 +2381,6 @@ VariableServiceGetVariable (
>>       }
>>   
>>       CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr, mVariableModuleGlobal->VariableGlobal.AuthFormat), VarDataSize);
>> -    if (Attributes != NULL) {
>> -      *Attributes = Variable.CurrPtr->Attributes;
>> -    }
>>   
>>       *DataSize = VarDataSize;
>>       UpdateVariableInfo (VariableName, VendorGuid, Variable.Volatile, TRUE, FALSE, FALSE, FALSE, &gVariableInfo);
>> @@ -2395,6 +2394,11 @@ VariableServiceGetVariable (
>>     }
>>   
>>   Done:
>> +  if (Status == EFI_SUCCESS || Status == EFI_BUFFER_TOO_SMALL) {
>> +    if (Attributes != NULL && Variable.CurrPtr != NULL) {
>> +      *Attributes = Variable.CurrPtr->Attributes;
>> +    }
>> +  }
>>     ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);
>>     return Status;
>>   }
>> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
>> index 2cf0ed32ae55..ca833fb0244d 100644
>> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
>> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
>> @@ -14,6 +14,7 @@
>>     InitCommunicateBuffer() is really function to check the variable data size.
>>   
>>   Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
>> +Copyright (c) Microsoft Corporation.<BR>
>>   SPDX-License-Identifier: BSD-2-Clause-Patent
>>   
>>   **/
>> @@ -642,10 +643,6 @@ FindVariableInRuntimeCache (
>>           }
>>   
>>           CopyMem (Data, GetVariableDataPtr (RtPtrTrack.CurrPtr, mVariableAuthFormat), TempDataSize);
>> -        if (Attributes != NULL) {
>> -          *Attributes = RtPtrTrack.CurrPtr->Attributes;
>> -        }
>> -
>>           *DataSize = TempDataSize;
>>   
>>           UpdateVariableInfo (VariableName, VendorGuid, RtPtrTrack.Volatile, TRUE, FALSE, FALSE, TRUE, &mVariableInfo);
>> @@ -661,6 +658,11 @@ FindVariableInRuntimeCache (
>>     }
>>   
>>   Done:
>> +  if (Status == EFI_SUCCESS || Status == EFI_BUFFER_TOO_SMALL) {
>> +    if (Attributes != NULL && RtPtrTrack.CurrPtr != NULL) {
>> +      *Attributes = RtPtrTrack.CurrPtr->Attributes;
>> +    }
>> +  }
>>     mVariableRuntimeCacheReadLock = FALSE;
>>   
>>     return Status;
>>
> 

      reply	other threads:[~2020-03-25  3:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 22:04 [PATCH v1 1/1] MdeModulePkg/Variable: Return GetVariable() attr if EFI_BUFFER_TOO_SMALL Michael Kubacki
2020-03-25  1:57 ` [edk2-devel] " Laszlo Ersek
2020-03-25  3:04   ` Michael Kubacki [this message]

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=MWHPR07MB344020DA89F7AC570C678621E9CE0@MWHPR07MB3440.namprd07.prod.outlook.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