public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Kubacki" <mikuback@linux.microsoft.com>
To: devel@edk2.groups.io, hao.a.wu@intel.com
Cc: "Wang, Jian J" <jian.j.wang@intel.com>,
	"Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH v1 0/3] Add Variable Flash Info HOB
Date: Fri, 8 Apr 2022 17:20:47 -0400	[thread overview]
Message-ID: <4f1d5f1f-bdc9-4cb7-28f8-885d6a257336@linux.microsoft.com> (raw)
In-Reply-To: <c50a90f2-b743-cbfe-4bcc-af101116f297@linux.microsoft.com>

Hi Hao,

I addressed all of your feedback including abstraction of the 
information with a library API in v2. It did help clean up the 
consumption code quite a bit.

https://edk2.groups.io/g/devel/message/88649

Thanks,
Michael

On 4/7/2022 7:56 PM, Michael Kubacki wrote:
> Yes, I considered that as well but I was not sure if it was worth adding 
> a new library just for that. I agree though that the code should not be 
> duplicated. I will look into it and include your other suggestions in a 
> v2 series.
> 
> Thanks,
> Michael
> 
> On 4/6/2022 11:31 PM, Wu, Hao A wrote:
>> Sorry for a question:
>> GetVariableFlashInfo() seems being defined multiple times across 
>> modules, do you see value in abstracting it as a library API?
>>
>> Best Regards,
>> Hao Wu
>>
>>> -----Original Message-----
>>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
>>> Kubacki
>>> Sent: Thursday, April 7, 2022 12:27 AM
>>> To: devel@edk2.groups.io
>>> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A 
>>> <hao.a.wu@intel.com>;
>>> Gao, Liming <gaoliming@byosoft.com.cn>
>>> Subject: [edk2-devel] [PATCH v1 0/3] Add Variable Flash Info HOB
>>>
>>> From: Michael Kubacki <michael.kubacki@microsoft.com>
>>>
>>> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479
>>>
>>> The UEFI variable drivers such as VariableRuntimeDxe, VariableSmm,
>>> VariableStandaloneMm, etc. (and their dependent protocol/library
>>> stack), typically acquire UEFI variable store flash information
>>> with PCDs declared in MdeModulePkg.
>>>
>>> For example:
>>> [Pcd]
>>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
>>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
>>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
>>>
>>> These PCDs work as-is in the StandaloneMm driver if they are not
>>> dynamic such as Dynamic or DynamicEx because PCD services are not
>>> readily available in the Standalone MM environment. Platforms that
>>> use Standalone MM today, must define these PCDs as FixedAtBuild in
>>> their platform build. However, the PCDs do allow platforms to treat
>>> the PCDs as Dynamic/DynamicEx and being able to support that is
>>> currently a gap for Standalone MM.
>>>
>>> This patch series introduces a HOB that can be produced by the
>>> platform to provide the same information. The HOB list is
>>> available to Standalone MM.
>>>
>>> The PCD declarations are left as-is in MdeModulePkg for backward
>>> compatibility. This means unless a platform wants to use the HOB,
>>> their code will continue to work with no change (they do not need
>>> to produce the HOB). Only if the HOB is found, is its value used
>>> instead of the PCDs.
>>>
>>> Cc: Jian J Wang <jian.j.wang@intel.com>
>>> Cc: Hao A Wu <hao.a.wu@intel.com>
>>> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>>> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com
>>>
>>> Michael Kubacki (3):
>>>    MdeModulePkg: Add Variable Flash Info HOB
>>>    MdeModulePkg/Variable: Consume Variable Info HOB
>>>    MdeModulePkg/FaultTolerantWrite: Consume Variable Info HOB
>>>
>>>   
>>> MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c                          
>>> |
>>> 111 +++++++++++++++++---
>>>   MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c
>>> |   7 +-
>>>   MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c
>>> |  92 ++++++++++++++--
>>>   
>>> MdeModulePkg/Universal/Variable/Pei/Variable.c                                  
>>> |  66
>>> +++++++++++-
>>>   
>>> MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c                           
>>> |  42
>>> ++++++++
>>>   
>>> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c                        
>>> |
>>> 25 ++++-
>>>   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
>>> |  20 +++-
>>>   
>>> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c                        
>>> |
>>> 20 +++-
>>>   
>>> MdeModulePkg/Include/Guid/VariableFlashInfo.h                                   
>>> |  36
>>> +++++++
>>>   
>>> MdeModulePkg/MdeModulePkg.dec                                                   
>>> |   4 +
>>>   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h
>>> |   9 +-
>>>   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>>> |  11 +-
>>>   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
>>> |  11 +-
>>>
>>> MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandalon
>>> eMm.inf |  11 +-
>>>   MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf
>>> |  10 +-
>>>   
>>> MdeModulePkg/Universal/Variable/Pei/Variable.h                                  
>>> |   2 +
>>>   
>>> MdeModulePkg/Universal/Variable/Pei/VariablePei.inf                             
>>> |   6 +-
>>>   
>>> MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h                           
>>> |  17
>>> +++
>>>   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
>>> |   6 +-
>>>   
>>> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf                      
>>> |
>>> 6 +-
>>>   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
>>> |   6 +-
>>>   21 files changed, 455 insertions(+), 63 deletions(-)
>>>   create mode 100644 MdeModulePkg/Include/Guid/VariableFlashInfo.h
>>>
>>> -- 
>>> 2.28.0.windows.1
>>>
>>>
>>>
>>> -=-=-=-=-=-=
>>> Groups.io Links: You receive all messages sent to this group.
>>> View/Reply Online (#88461): https://edk2.groups.io/g/devel/message/88461
>>> Mute This Topic: https://groups.io/mt/90293658/1768737
>>> Group Owner: devel+owner@edk2.groups.io
>>> Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.wu@intel.com]
>>> -=-=-=-=-=-=
>>>
>>
>>
>>
>> 
>>

      reply	other threads:[~2022-04-08 21:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 16:26 [PATCH v1 0/3] Add Variable Flash Info HOB Michael Kubacki
2022-04-06 16:26 ` [PATCH v1 1/3] MdeModulePkg: " Michael Kubacki
2022-04-06 16:26 ` [PATCH v1 2/3] MdeModulePkg/Variable: Consume Variable " Michael Kubacki
2022-04-07  3:31   ` [edk2-devel] " Wu, Hao A
2022-04-06 16:26 ` [PATCH v1 3/3] MdeModulePkg/FaultTolerantWrite: " Michael Kubacki
2022-04-07  3:31   ` [edk2-devel] " Wu, Hao A
2022-04-07  3:31 ` [edk2-devel] [PATCH v1 0/3] Add Variable Flash " Wu, Hao A
2022-04-07 23:56   ` Michael Kubacki
2022-04-08 21:20     ` 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=4f1d5f1f-bdc9-4cb7-28f8-885d6a257336@linux.microsoft.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