Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-21 Thread duntan
Hi Sean,

I saw the PR contribution process proposal in community. It looks good.

I agree that the existence of the HOB can indicate if the feature is used or 
not on the consumer side. Will move the reference to 
PcdEnableVariableRuntimeCache on the HOB consumer side. But I think 
PcdEnableVariableRuntimeCache is still needed to decide whether we need to 
build HOB or not.

For other comments, I’ll modify the patch series based on your comments and the 
sample you mentioned. Thanks for you detailed comments.

Thanks,
Dun

From: Sean Brogan 
Sent: Tuesday, May 21, 2024 2:17 AM
To: devel@edk2.groups.io; Tan, Dun 
Cc: Ni, Ray ; Liming Gao ; Wu, 
Jiaxin ; Ard Biesheuvel ; Leif 
Lindholm ; Sami Mujawar ; Gerd 
Hoffmann ; Andrew Fish ; Yao, Jiewen 

Subject: Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime 
cache buffer in PEI


I can't find patch 1 in the series in my email so putting a few comments here.  
I really hope this patch series can wait for PRs so code comments can more 
easily be correlated with code change.

Looking at your PR with commit: Allocate Varaible cache buffer in PEI by td36 · 
Pull Request #5607 · tianocore/edk2 
(github.com)<https://github.com/tianocore/edk2/pull/5607/commits/36c2cac5fa4196be7fc85d842e8056e376010479>

A few comments for now.

Variable is spelled incorrectly in commit message.

I would really prefer to not mix PCDs and Hobs.  It is really confusing what 
has to be turned on and set to what to get the different behaviors.  For a hob 
producer it is OK to take that info from PCDs but lets not mix in the consumer 
code PCDs and hob data.  The HOB definition should not reference a PCD and a 
HOB definition should not be focused on producer/consumer but on the data.

The existence of a hob is also a good indicator that a feature is used so you 
may not need to have "enable" PCDs anymore.

Please don't include other header files in public header files (especially for 
super common headers like PiPei.h.  i know over the last few years this 
practice has become more common but it just creates pain when debugging build 
errors.  The trade off is not worth it.

Hobs really shouldn't use UINTN sizes.  Since hobs helps transfer config state 
across phases where the size of UINTN may be different this causes problems.

Hobs used for cross phase sharing shouldn't have pointers for the reason.

Better and more complete comments on the different field members would be 
helpful.  I assume the "Buffer" fields are physical addresses and the "Pages" 
are number of 4K pages.   I would suggest EFI_PHYSICAL_ADDRESS for addresses 
and UINT64 for lengths.

More details on what the three cache's are would be helpful or at least 
reference the feature of the cache they are supporting.

This hob definition file isn't perfect and I believe some of the comment in the 
file header belong in different places, it is at least a good template for a 
hob definition.

edk2/MdeModulePkg/Include/Guid/VariableFlashInfo.h at 
284dbac43da752ee34825c8b3f6f9e8281cb5a19 · tianocore/edk2 
(github.com)<https://github.com/tianocore/edk2/blob/284dbac43da752ee34825c8b3f6f9e8281cb5a19/MdeModulePkg/Include/Guid/VariableFlashInfo.h>



Thanks

Sean




On 5/17/2024 2:49 AM, duntan wrote:

This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is used 
to store the address and size of the buffer that will be used for variable 
runtime service when the PcdEnableVariableRuntimeCache is TRUE.

In following patches, when PcdEnableVariableRuntimeCache is TRUE, VariablePei 
will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate the 
needed buffer for different type variable runtime cache and build the HOB.

Then VariableSmmRuntimeDxe driver will consume 
gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime cache 
related content. The code to allocate and unblock the runtime cache buffer in 
VariableSmmRuntimeDxe is also removed in this patc set.



PR for review: https://github.com/tianocore/edk2/pull/5607



Cc: Ray Ni <mailto:ray...@intel.com>

Cc: Liming Gao <mailto:gaolim...@byosoft.com.cn>

Cc: Jiaxin Wu <mailto:jiaxin...@intel.com>

Cc: Ard Biesheuvel <mailto:ardb+tianoc...@kernel.org>

Cc: Leif Lindholm <mailto:quic_llind...@quicinc.com>

Cc: Sami Mujawar <mailto:sami.muja...@arm.com>

Cc: Gerd Hoffmann <mailto:kra...@redhat.com>

Cc: Andrew Fish <mailto:af...@apple.com>

Cc: Jiewen Yao <mailto:jiewen@intel.com>



Dun Tan (9):

  MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid

  ArmVirtPkg: Add MmUnblockMemoryLib in DSC

  EmulatorPkg: Add MmUnblockMemoryLib in DSC

  OvmfPkg: Add MmUnblockMemoryLib in DSC

  MdeModulePkg:Create gEdkiiVariableRuntimeCacheInfoHobGuid

  MdeModulePkg:Remove unnecessary global variable

  MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid

  MdeModulePkg: Refine InitVariableCa

Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-20 Thread Sean
I can't find patch 1 in the series in my email so putting a few comments 
here.  I really hope this patch series can wait for PRs so code comments 
can more easily be correlated with code change.


Looking at your PR with commit: Allocate Varaible cache buffer in PEI by 
td36 · Pull Request #5607 · tianocore/edk2 (github.com) 



A few comments for now.

Variable is spelled incorrectly in commit message.

I would really prefer to not mix PCDs and Hobs.  It is really confusing 
what has to be turned on and set to what to get the different 
behaviors.  For a hob producer it is OK to take that info from PCDs but 
lets not mix in the consumer code PCDs and hob data.  The HOB definition 
should not reference a PCD and a HOB definition should not be focused on 
producer/consumer but on the data.


The existence of a hob is also a good indicator that a feature is used 
so you may not need to have "enable" PCDs anymore.


Please don't include other header files in public header files 
(especially for super common headers like PiPei.h.  i know over the last 
few years this practice has become more common but it just creates pain 
when debugging build errors.  The trade off is not worth it.


Hobs really shouldn't use UINTN sizes.  Since hobs helps transfer config 
state across phases where the size of UINTN may be different this causes 
problems.


Hobs used for cross phase sharing shouldn't have pointers for the reason.

Better and more complete comments on the different field members would 
be helpful.  I assume the "Buffer" fields are physical addresses and the 
"Pages" are number of 4K pages.   I would suggest EFI_PHYSICAL_ADDRESS 
for addresses and UINT64 for lengths.


More details on what the three cache's are would be helpful or at least 
reference the feature of the cache they are supporting.


This hob definition file isn't perfect and I believe some of the comment 
in the file header belong in different places, it is at least a good 
template for a hob definition.


edk2/MdeModulePkg/Include/Guid/VariableFlashInfo.h at 
284dbac43da752ee34825c8b3f6f9e8281cb5a19 · tianocore/edk2 (github.com) 




Thanks

Sean



On 5/17/2024 2:49 AM, duntan wrote:

This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is used 
to store the address and size of the buffer that will be used for variable 
runtime service when the PcdEnableVariableRuntimeCache is TRUE.
In following patches, when PcdEnableVariableRuntimeCache is TRUE, VariablePei 
will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate the 
needed buffer for different type variable runtime cache and build the HOB.
Then VariableSmmRuntimeDxe driver will consume 
gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime cache 
related content. The code to allocate and unblock the runtime cache buffer in 
VariableSmmRuntimeDxe is also removed in this patc set.

PR for review:https://github.com/tianocore/edk2/pull/5607

Cc: Ray Ni
Cc: Liming Gao
Cc: Jiaxin Wu
Cc: Ard Biesheuvel
Cc: Leif Lindholm
Cc: Sami Mujawar
Cc: Gerd Hoffmann
Cc: Andrew Fish
Cc: Jiewen Yao

Dun Tan (9):
   MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid
   ArmVirtPkg: Add MmUnblockMemoryLib in DSC
   EmulatorPkg: Add MmUnblockMemoryLib in DSC
   OvmfPkg: Add MmUnblockMemoryLib in DSC
   MdeModulePkg:Create gEdkiiVariableRuntimeCacheInfoHobGuid
   MdeModulePkg:Remove unnecessary global variable
   MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid
   MdeModulePkg: Refine InitVariableCache()
   MdeModulePkg:Add global variable mVariableRtCacheInfo

  ArmVirtPkg/ArmVirtCloudHv.dsc|   2 ++
  EmulatorPkg/EmulatorPkg.dsc  |   1 +
  MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h |  65 
+
  MdeModulePkg/MdeModulePkg.dec|   3 +++
  MdeModulePkg/Universal/Variable/Pei/Variable.c   | 298 
+-
  MdeModulePkg/Universal/Variable/Pei/Variable.h   |   3 +++
  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf  |   8 
+++-
  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c   | 293 

Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-20 Thread duntan
Hi Liming,

I haven't created a Bugzilla for this change.
Is a bugzila needed for this patch set? I can create one if needed.

Thanks,
Dun

-Original Message-
From: gaoliming  
Sent: Monday, May 20, 2024 9:41 AM
To: devel@edk2.groups.io; Tan, Dun 
Cc: Ni, Ray ; Wu, Jiaxin ; 'Ard 
Biesheuvel' ; 'Leif Lindholm' 
; 'Sami Mujawar' ; 'Gerd 
Hoffmann' ; 'Andrew Fish' ; Yao, Jiewen 

Subject: 回复: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime 
cache buffer in PEI

Dun:
  Is there a Bugzilla for this change?

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 duntan
> 发送时间: 2024年5月17日 17:49
> 收件人: devel@edk2.groups.io
> 抄送: Ray Ni ; Liming Gao ; 
> Jiaxin Wu ; Ard Biesheuvel
;
> Leif Lindholm ; Sami Mujawar 
> ; Gerd Hoffmann ; Andrew Fish 
> ; Jiewen Yao 
> 主题: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime 
> cache buffer in PEI
> 
> This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB 
> is used to store the address and size of the buffer that will be used 
> for
variable
> runtime service when the PcdEnableVariableRuntimeCache is TRUE.
> In following patches, when PcdEnableVariableRuntimeCache is TRUE,
VariablePei
> will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate 
> the
needed
> buffer for different type variable runtime cache and build the HOB.
> Then VariableSmmRuntimeDxe driver will consume 
> gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable 
> runtime
cache
> related content. The code to allocate and unblock the runtime cache 
> buffer
in
> VariableSmmRuntimeDxe is also removed in this patc set.
> 
> PR for review: https://github.com/tianocore/edk2/pull/5607
> 
> Cc: Ray Ni 
> Cc: Liming Gao 
> Cc: Jiaxin Wu 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Sami Mujawar 
> Cc: Gerd Hoffmann 
> Cc: Andrew Fish 
> Cc: Jiewen Yao 
> 
> Dun Tan (9):
>   MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid
>   ArmVirtPkg: Add MmUnblockMemoryLib in DSC
>   EmulatorPkg: Add MmUnblockMemoryLib in DSC
>   OvmfPkg: Add MmUnblockMemoryLib in DSC
>   MdeModulePkg:Create gEdkiiVariableRuntimeCacheInfoHobGuid
>   MdeModulePkg:Remove unnecessary global variable
>   MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid
>   MdeModulePkg: Refine InitVariableCache()
>   MdeModulePkg:Add global variable mVariableRtCacheInfo
> 
>  ArmVirtPkg/ArmVirtCloudHv.dsc
> |   2 ++
>  EmulatorPkg/EmulatorPkg.dsc
> |   1 +
>  MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h
> |  65
> +
> 
>  MdeModulePkg/MdeModulePkg.dec
> |   3 +++
>  MdeModulePkg/Universal/Variable/Pei/Variable.c   |
> 298
> +
> +
> +
> +
> +-
>  MdeModulePkg/Universal/Variable/Pei/Variable.h   |
> 3 +++
>  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf  |
> 8 +++-
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
> | 293
> +
> +
>
++--
++
-
> --
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf 
> |
> 5 +++--
>  OvmfPkg/OvmfPkgIa32X64.dsc
> |   2 +-
>  10 files changed, 506 insertions(+), 174 deletions(-)  create mode 
> 100644 MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h
> 
> --
> 2.31.1.windows.1
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119075): https://edk2.groups.io/g/devel/message/119075
Mute This Topic: https://groups.io/mt/106199240/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-20 Thread Ni, Ray
I remember ARM platform could have a PEI-less design so that SEC directly 
invokes DXE.

So I can imagine that a SEC logic to create the VARIABLE_RUNTIME_CACHE_INFO HOB.

Then it comes to how to calculate the size before bios boots.
I think it's doable.
There are 3 caches. Volatile cache size is hardcode by a PCD. NV cache size can 
equal to the bios NV variable region size. HOB cache size can be calculated by:

  1.
collect all default values in IFR/VFR
  2.
convert the default variable to auth/non-auth type depending on the BIOS NV 
variable region format.

Both steps can be performed in bios-build phase. There is no runtime 
information needed.

Thanks,
Ray

From: Nhi Pham 
Sent: Monday, May 20, 2024 9:01
To: devel@edk2.groups.io ; Tan, Dun 
Cc: Ni, Ray ; Liming Gao ; Wu, 
Jiaxin ; Ard Biesheuvel ; Leif 
Lindholm ; Sami Mujawar ; Gerd 
Hoffmann ; Andrew Fish ; Yao, Jiewen 

Subject: Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime 
cache buffer in PEI

On 5/17/2024 4:49 PM, duntan via groups.io wrote:
> This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is used 
> to store the address and size of the buffer that will be used for variable 
> runtime service when the PcdEnableVariableRuntimeCache is TRUE.
> In following patches, when PcdEnableVariableRuntimeCache is TRUE, VariablePei 
> will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate the 
> needed buffer for different type variable runtime cache and build the HOB.
> Then VariableSmmRuntimeDxe driver will consume 
> gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime 
> cache related content. The code to allocate and unblock the runtime cache 
> buffer in VariableSmmRuntimeDxe is also removed in this patc set.
>
> PR for review: https://github.com/tianocore/edk2/pull/5607

Per design, SMM or StandaloneMM needs to access these runtime cache
buffers for cache coherency. I'm not sure how to implement the
MmUnblockMemoryLib for ARM to dynamically request mapping of the
non-secure runtime cache buffers in StandaloneMM (Secure World). Is it
possible to have these runtime buffers allocated statically with
predefined PCD at build time. On ARM, they can also define the buffers
in device tree (manifest)?

Thanks,
Nhi


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119072): https://edk2.groups.io/g/devel/message/119072
Mute This Topic: https://groups.io/mt/106150796/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




回复: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-19 Thread gaoliming via groups.io
Dun:
  Is there a Bugzilla for this change?

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 duntan
> 发送时间: 2024年5月17日 17:49
> 收件人: devel@edk2.groups.io
> 抄送: Ray Ni ; Liming Gao ;
> Jiaxin Wu ; Ard Biesheuvel
;
> Leif Lindholm ; Sami Mujawar
> ; Gerd Hoffmann ; Andrew Fish
> ; Jiewen Yao 
> 主题: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache
> buffer in PEI
> 
> This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is
> used to store the address and size of the buffer that will be used for
variable
> runtime service when the PcdEnableVariableRuntimeCache is TRUE.
> In following patches, when PcdEnableVariableRuntimeCache is TRUE,
VariablePei
> will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate the
needed
> buffer for different type variable runtime cache and build the HOB.
> Then VariableSmmRuntimeDxe driver will consume
> gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime
cache
> related content. The code to allocate and unblock the runtime cache buffer
in
> VariableSmmRuntimeDxe is also removed in this patc set.
> 
> PR for review: https://github.com/tianocore/edk2/pull/5607
> 
> Cc: Ray Ni 
> Cc: Liming Gao 
> Cc: Jiaxin Wu 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Sami Mujawar 
> Cc: Gerd Hoffmann 
> Cc: Andrew Fish 
> Cc: Jiewen Yao 
> 
> Dun Tan (9):
>   MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid
>   ArmVirtPkg: Add MmUnblockMemoryLib in DSC
>   EmulatorPkg: Add MmUnblockMemoryLib in DSC
>   OvmfPkg: Add MmUnblockMemoryLib in DSC
>   MdeModulePkg:Create gEdkiiVariableRuntimeCacheInfoHobGuid
>   MdeModulePkg:Remove unnecessary global variable
>   MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid
>   MdeModulePkg: Refine InitVariableCache()
>   MdeModulePkg:Add global variable mVariableRtCacheInfo
> 
>  ArmVirtPkg/ArmVirtCloudHv.dsc
> |   2 ++
>  EmulatorPkg/EmulatorPkg.dsc
> |   1 +
>  MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h
> |  65
> +
> 
>  MdeModulePkg/MdeModulePkg.dec
> |   3 +++
>  MdeModulePkg/Universal/Variable/Pei/Variable.c   |
> 298
> +
> +
> +
> +
> +-
>  MdeModulePkg/Universal/Variable/Pei/Variable.h   |
> 3 +++
>  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf  |
> 8 +++-
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
> | 293
> +
> +
>
++--
-
> --
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf |
> 5 +++--
>  OvmfPkg/OvmfPkgIa32X64.dsc
> |   2 +-
>  10 files changed, 506 insertions(+), 174 deletions(-)
>  create mode 100644
> MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h
> 
> --
> 2.31.1.windows.1
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119070): https://edk2.groups.io/g/devel/message/119070
Mute This Topic: https://groups.io/mt/106196627/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-19 Thread Nhi Pham via groups.io

On 5/17/2024 4:49 PM, duntan via groups.io wrote:

This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is used 
to store the address and size of the buffer that will be used for variable 
runtime service when the PcdEnableVariableRuntimeCache is TRUE.
In following patches, when PcdEnableVariableRuntimeCache is TRUE, VariablePei 
will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate the 
needed buffer for different type variable runtime cache and build the HOB.
Then VariableSmmRuntimeDxe driver will consume 
gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime cache 
related content. The code to allocate and unblock the runtime cache buffer in 
VariableSmmRuntimeDxe is also removed in this patc set.

PR for review: https://github.com/tianocore/edk2/pull/5607


Per design, SMM or StandaloneMM needs to access these runtime cache 
buffers for cache coherency. I'm not sure how to implement the 
MmUnblockMemoryLib for ARM to dynamically request mapping of the 
non-secure runtime cache buffers in StandaloneMM (Secure World). Is it 
possible to have these runtime buffers allocated statically with 
predefined PCD at build time. On ARM, they can also define the buffers 
in device tree (manifest)?


Thanks,
Nhi


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119068): https://edk2.groups.io/g/devel/message/119068
Mute This Topic: https://groups.io/mt/106150796/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-17 Thread duntan
This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is used 
to store the address and size of the buffer that will be used for variable 
runtime service when the PcdEnableVariableRuntimeCache is TRUE.
In following patches, when PcdEnableVariableRuntimeCache is TRUE, VariablePei 
will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate the 
needed buffer for different type variable runtime cache and build the HOB.
Then VariableSmmRuntimeDxe driver will consume 
gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime cache 
related content. The code to allocate and unblock the runtime cache buffer in 
VariableSmmRuntimeDxe is also removed in this patc set.

PR for review: https://github.com/tianocore/edk2/pull/5607

Cc: Ray Ni 
Cc: Liming Gao 
Cc: Jiaxin Wu 
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Sami Mujawar 
Cc: Gerd Hoffmann 
Cc: Andrew Fish 
Cc: Jiewen Yao 

Dun Tan (9):
  MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid
  ArmVirtPkg: Add MmUnblockMemoryLib in DSC
  EmulatorPkg: Add MmUnblockMemoryLib in DSC
  OvmfPkg: Add MmUnblockMemoryLib in DSC
  MdeModulePkg:Create gEdkiiVariableRuntimeCacheInfoHobGuid
  MdeModulePkg:Remove unnecessary global variable
  MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid
  MdeModulePkg: Refine InitVariableCache()
  MdeModulePkg:Add global variable mVariableRtCacheInfo

 ArmVirtPkg/ArmVirtCloudHv.dsc|   2 ++
 EmulatorPkg/EmulatorPkg.dsc  |   1 +
 MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h |  65 
+
 MdeModulePkg/MdeModulePkg.dec|   3 +++
 MdeModulePkg/Universal/Variable/Pei/Variable.c   | 298 
+-
 MdeModulePkg/Universal/Variable/Pei/Variable.h   |   3 +++
 MdeModulePkg/Universal/Variable/Pei/VariablePei.inf  |   8 
+++-
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c   | 293 
-
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf |   5 
+++--
 OvmfPkg/OvmfPkgIa32X64.dsc   |   2 +-
 10 files changed, 506 insertions(+), 174 deletions(-)
 create mode 100644 MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h

-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119017): https://edk2.groups.io/g/devel/message/119017
Mute This Topic: https://groups.io/mt/106150796/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-