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 <n...@os.amperecomputing.com>
Sent: Monday, May 20, 2024 9:01
To: devel@edk2.groups.io <devel@edk2.groups.io>; Tan, Dun <dun....@intel.com>
Cc: Ni, Ray <ray...@intel.com>; Liming Gao <gaolim...@byosoft.com.cn>; Wu, 
Jiaxin <jiaxin...@intel.com>; Ard Biesheuvel <ardb+tianoc...@kernel.org>; Leif 
Lindholm <quic_llind...@quicinc.com>; Sami Mujawar <sami.muja...@arm.com>; Gerd 
Hoffmann <kra...@redhat.com>; Andrew Fish <af...@apple.com>; Yao, Jiewen 
<jiewen....@intel.com>
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]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to