From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.424.1649699273930245063 for ; Mon, 11 Apr 2022 10:47:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=DazGB5LL; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [192.168.4.22] (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id A6642209DDA1; Mon, 11 Apr 2022 10:47:52 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A6642209DDA1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1649699273; bh=zmV/OrBMhzPBh8EJuDhsZybKOVj9XlPNIEaBVmxXHxE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DazGB5LLiTAtPoeqwNA5lyBuhKjFAmTjMirMJNz5BuAMV1YqmZVydlkO9di5m01AJ e47GxMIG99xHa8ePrCocLndWX82lVQn0jMrmJk5erNejxKep9M4AlfD4T8JeqYiTIj buV/9Vb/UXc6ElADUSsv3GgQ6NOp0siMrMgni0jc= Message-ID: <97f023ac-b327-0432-d36e-621c916a7bff@linux.microsoft.com> Date: Mon, 11 Apr 2022 13:47:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB To: devel@edk2.groups.io, guo.dong@intel.com Cc: "Wang, Jian J" , "Wu, Hao A" , "Gao, Liming" References: <20220408211733.1332-1-mikuback@linux.microsoft.com> <20220408211733.1332-2-mikuback@linux.microsoft.com> From: "Michael Kubacki" In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I renamed the fields and added comments to the interface file in the v3 patch series. V3: https://edk2.groups.io/g/devel/message/88709 CI PR: https://github.com/tianocore/edk2/pull/2762 That patch series includes all feedback I have received. Maintainers, please review that series as soon as possible. Regards, Michael On 4/10/2022 7:22 PM, Guo Dong wrote: > > Does the range (NvStorageBaseAddress, NvStorageLength) includes FTW spare range and FTW working range? > If not, maybe rename them as (NvVariableBaseAddress, NvVariableLength) to make it clear. > > For these 3 ranges, are there any other requirements (e.g. base address must be 4KB aligned, or FtwSpaceLength >= NvVariablelength)? > If yes, had better add to this interface file to make the HOB producer easy to build the HOB. > > Thanks, > Guo > > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Michael Kubacki > Sent: Friday, April 8, 2022 2:17 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; Gao, Liming > Subject: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB > > From: Michael Kubacki > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479 > > Adds a new GUID that is used to identify a HOB that passes variable flash information to UEFI variable drivers in HOB consumption phases such as DXE, Traditional MM, and Standalone MM. > > This information was previously passed directly with PCDs such as EfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase > and gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize. > > However, the Standalone MM variable driver instance does not have direct access to the PCD database. Therefore, this HOB will first be considered as the source for variable flash information and if platforms do not produce the HOB, reading the information from the PCDs directly will be a backup to provide backward compatibility. > > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Liming Gao > Signed-off-by: Michael Kubacki > --- > MdeModulePkg/Include/Guid/VariableFlashInfo.h | 39 ++++++++++++++++++++ > MdeModulePkg/MdeModulePkg.dec | 4 ++ > 2 files changed, 43 insertions(+) > > diff --git a/MdeModulePkg/Include/Guid/VariableFlashInfo.h b/MdeModulePkg/Include/Guid/VariableFlashInfo.h > new file mode 100644 > index 000000000000..e526e362aab9 > --- /dev/null > +++ b/MdeModulePkg/Include/Guid/VariableFlashInfo.h > @@ -0,0 +1,39 @@ > +/** @file > + This file defines the GUID and data structure used to pass > +information about > + a variable store mapped on flash (i.e. a MMIO firmware volume) to the DXE and MM environment. > + > + Copyright (c) Microsoft Corporation.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef VARIABLE_FLASH_INFO_H_ > +#define VARIABLE_FLASH_INFO_H_ > + > +#define VARIABLE_FLASH_INFO_HOB_GUID \ > + { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2, 0xfb, 0xa2, 0x89, 0x20, > +0xfc, 0x90 }} > + > +#define VARIABLE_FLASH_INFO_HOB_VERSION 1 > + > +extern EFI_GUID gVariableFlashInfoHobGuid; > + > +#pragma pack (push, 1) > + > +/// > +/// This structure can be used to describe UEFI variable /// flash > +information. > +/// > +typedef struct { > + UINT32 Version; > + EFI_PHYSICAL_ADDRESS NvStorageBaseAddress; > + UINT64 NvStorageLength; > + EFI_PHYSICAL_ADDRESS FtwSpareBaseAddress; > + UINT64 FtwSpareLength; > + EFI_PHYSICAL_ADDRESS FtwWorkingBaseAddress; > + UINT64 FtwWorkingLength; > +} VARIABLE_FLASH_INFO; > + > +#pragma pack (pop) > + > +#endif > diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index cf79292ec877..4e82f5836096 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -226,6 +226,10 @@ [Guids] > # Include/Guid/SmmVariableCommon.h > gSmmVariableWriteGuid = { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }} > > + ## Guid of the variable flash information HOB. > + # Include/Guid/VariableFlashInfo.h > + gVariableFlashInfoHobGuid = { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, > + 0xc2, 0xfb, 0xa2, 0x89, 0x20, 0xfc, 0x90 }} > + > ## Performance protocol guid that also acts as the performance HOB guid and performance variable GUID > # Include/Guid/Performance.h > gPerformanceProtocolGuid = { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E, 0x3F, 0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 } } > -- > 2.28.0.windows.1 > > > > -=-=-=-=-=-= > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#88650): https://edk2.groups.io/g/devel/message/88650 > Mute This Topic: https://groups.io/mt/90345653/1781375 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.dong@intel.com] > -=-=-=-=-=-= > > > > > >