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.web11.21222.1675961196512798117 for ; Thu, 09 Feb 2023 08:46:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=dCjwUIxo; 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.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id 1A71920C8AEC; Thu, 9 Feb 2023 08:46:34 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1A71920C8AEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1675961196; bh=tFwebxdSGHaUeG2XBpXkZ0BHRXfQGSFeEtZHyiVAmjY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dCjwUIxo/l1QHcHgvFTdpL9FOB2700j4M4rX9NJxmhA/eLsUKzVc3GYmsAtZH+xmx hingRivCuUYn3WnsZLLs34ABjT4HVOUjrnqE6ZekDfKGBZ9HcpTeLfU/+i7YRcRPiw 1gNidBTxmv8Z7pPK1CsuBfuPIpZk0hHtFpmujBl0= Message-ID: <1da91c1e-18e8-f81f-bcba-44983d4cb8af@linux.microsoft.com> Date: Thu, 9 Feb 2023 11:46:33 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [edk2-devel] [edk2-platforms: PATCH] IntelSiliconPkg/SpiFvbServiceSmm: Support Other NVS variable region. To: devel@edk2.groups.io, isaac.w.oram@intel.com, "Chiu, Chasel" Cc: "S, Ashraf Ali" , "Chaganty, Rangasai V" , "Ni, Ray" , "Kubacki, Michael" References: <20230209051402.1319-1-chasel.chiu@intel.com> <62c9fe71-b3fc-5272-eac3-f39165b0b5fd@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 Thanks, that's useful background. @chasel, you should probably put this info in the commit message so it is captured in source history. Given the default value is zero, it seems reasonable. I was also initially confused by the name of the PCD. Another idea would be something like "PcdFlashNvStorageAdditionalSize". Please do at least update the commit message to include additional context. Reviewed-by: Michael Kubacki On 2/9/2023 11:04 AM, Isaac Oram wrote: > It is a legacy that exists in current and past implementations. There is a complex arbitrary relationship between the runtime updateable regions in existing platform designs. > There is something like: > - Variable store (large) > - Error log (small) > - Fault tolerant working area (>= size of prior 2 regions) > - Fault tolerant metadata (small). > And there are assumptions about ordering and packing built into board flash layouts. > > I don't think that we should introduce "other variable" as a concept, because variable solutions don't support two regions, so it isn't a UEFI variable region. OtherUpdatable might be ok, but still seems confusing to me. > I think that we should add the support for the *ErrorLog* region so that the open FvbServices can be used by current implementations. Then we should eliminate the "ErrorLog" use completely. My thought is that this makes the connection to legacy clear. And also motivates us to eliminate all the vestigial references to the ErrorLog in edk2 and edk2-platforms. > > New updateable regions should not be hard-coded into this area and should have a cleaner solution, as Michael suggests. > > I understand if we don't want to support legacy or workarounds, but I think that currently adoption and use of the open content is higher priority. Which is why we are requesting this workaround to match "proprietary" FVB services behavior. > > Regards, > Isaac > > -----Original Message----- > From: Michael Kubacki > Sent: Thursday, February 9, 2023 7:40 AM > To: devel@edk2.groups.io; Chiu, Chasel > Cc: S, Ashraf Ali ; Oram, Isaac W ; Chaganty, Rangasai V ; Ni, Ray ; Kubacki, Michael > Subject: Re: [edk2-devel] [edk2-platforms: PATCH] IntelSiliconPkg/SpiFvbServiceSmm: Support Other NVS variable region. > > Is there a reason this other content can't go into it's own FV? > > On 2/9/2023 12:14 AM, Chiu, Chasel wrote: >> Platform may implement Other NVS variable region following Regular >> variable region and in this case SpiFvbService should include both >> region size when calculating the total NVS region size. >> >> One usage model is EventLog NVS region and there could be others. >> >> Cc: Ashraf Ali S >> Cc: Isaac Oram >> Cc: Rangasai V Chaganty >> Cc: Ray Ni >> Cc: Michael Kubacki >> Signed-off-by: Chasel Chiu >> --- >> Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c | 7 +++++++ >> Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf | 7 ++++--- >> Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 8 ++++++++ >> 3 files changed, 19 insertions(+), 3 deletions(-) >> >> diff --git >> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ >> iceCommon.c >> b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ >> iceCommon.c >> index 942abf95a6..bcde98131d 100644 >> --- >> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ >> iceCommon.c >> +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvb >> +++ ServiceCommon.c >> @@ -568,6 +568,13 @@ GetVariableFvInfo ( >> return; >> >> } >> >> >> >> + // >> >> + // GetVariableFlashNvStorageInfo () only reports regular variable >> + region information, >> >> + // if platform implemented a separate Other variable region >> + following the regular variable region, >> >> + // the size should be included as overall NVS variable region size. >> >> + // >> >> + NvStoreLength += PcdGet32 (PcdFlashNvStorageOtherVariableSize); >> >> + >> >> Status = GetVariableFlashFtwSpareInfo (&NvBaseAddress, &Length64); >> >> if (!EFI_ERROR (Status)) { >> >> // Stay within the current UINT32 size assumptions in the variable stack. >> >> diff --git >> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ >> iceSmm.inf >> b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ >> iceSmm.inf >> index 73049eceb2..f40067418a 100644 >> --- >> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ >> iceSmm.inf >> +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvb >> +++ ServiceSmm.inf >> @@ -43,9 +43,10 @@ >> IntelSiliconPkg/IntelSiliconPkg.dec >> >> >> >> [Pcd] >> >> - gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONSUMES >> >> - gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONSUMES >> >> - gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType ## SOMETIMES_CONSUMES >> >> + gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONSUMES >> >> + gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONSUMES >> >> + gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType ## SOMETIMES_CONSUMES >> >> + gIntelSiliconPkgTokenSpaceGuid.PcdFlashNvStorageOtherVariableSize >> + ## CONSUMES >> >> >> >> [Sources] >> >> FvbInfo.c >> >> diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec >> b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec >> index 63dae756ad..7034ab93b0 100644 >> --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec >> +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec >> @@ -194,3 +194,11 @@ >> # Other value: reserved for future use.
>> >> # @Prompt Flash Variable Store type. >> >> >> gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType|0x00|UINT8|0x >> 0000000E >> >> + >> >> + ## Declares Separate NVS Variable Region Size.

>> >> + # Platform may implement a Regular variable region and an Other >> + variable region, which will require this PCD >> >> + # to tell SpiFvbService to include both regions.
>> >> + # 0: No separate Other variable region.
>> >> + # non-zero: The size of a separate Other variable region following >> + the Regular variable region.
>> >> + # @Prompt Separate NVS Variable Region Size. >> >> + >> + gIntelSiliconPkgTokenSpaceGuid.PcdFlashNvStorageOtherVariableSize|0x >> + 00000000|UINT32|0x0000000F >> > > > > >