回复: 回复: [edk2-devel] [PATCH v4 13/14] MdeModulePkg/VariableStandaloneMm: Set PcdFlashNvStorageVariableBase to Pcd

gaoliming gaoliming at byosoft.com.cn
Fri Feb 19 01:15:59 UTC 2021


Ilias:
 If you check other Variable module INF file, you can find they all use [Pcd] section. Module provides the flexibility instead of the limitation. In fact, variable module code has no fixed pcd usage. Platform can decide which PCD type should be used. In future, if other PCD is required to be configured as patchable in module, you don't need to modify variable INF again. 

Thanks
Liming
> -----邮件原件-----
> 发件人: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> 发送时间: 2021年2月18日 17:17
> 收件人: devel at edk2.groups.io; gaoliming at byosoft.com.cn
> 抄送: sughosh.ganu at linaro.org; 'Sami Mujawar' <sami.mujawar at arm.com>;
> 'Ard Biesheuvel' <ardb+tianocore at kernel.org>
> 主题: Re: 回复: [edk2-devel] [PATCH v4 13/14]
> MdeModulePkg/VariableStandaloneMm: Set PcdFlashNvStorageVariableBase
> to Pcd
> 
> On Thu, Feb 18, 2021 at 11:13:21AM +0800, gaoliming wrote:
> > I suggest to directly change [FixedPcd] to [Pcd] section. All Pcds can
> > support FixedAtBuild and PatchableInModule.
> 
> We can, but is there a reason to do that?
> Wouldn't we be better of being more strict on the Pcd context we define for
> each variable?
> 
> The values that were swapped from FixedPcd to Pcd are expected to change
> in
> runtime, while the rest don't.
> 
> Thanks
> /Ilias
> 
> >
> > With this change, Reviewed-by: Liming Gao <gaoliming at byosoft.com.cn>
> >
> > Thanks
> > Liming
> > > -----邮件原件-----
> > > 发件人: bounce+27952+71734+4905953+8761045 at groups.io
> > > <bounce+27952+71734+4905953+8761045 at groups.io> 代表 Sughosh
> Ganu
> > > 发送时间: 2021年2月17日 19:27
> > > 收件人: devel at edk2.groups.io
> > > 抄送: Sami Mujawar <sami.mujawar at arm.com>; Ilias Apalodimas
> > > <ilias.apalodimas at linaro.org>; Ard Biesheuvel
> <ardb+tianocore at kernel.org>
> > > 主题: [edk2-devel] [PATCH v4 13/14]
> MdeModulePkg/VariableStandaloneMm:
> > > Set PcdFlashNvStorageVariableBase to Pcd
> > >
> > > From: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> > >
> > > Instead of running StMM in SPM, OP-TEE creates a new secure partition,
> > > which emulates SPM and isolates StMM from the rest of the Trusted
> > > Applications (TAs). We can then compile StMM as an FD image and run it
> > > in OP-TEE. With the addition of a new RPMB driver, we can leverage
> OP-TEE
> > > and store variables to an RPMB device.
> > >
> > > Since EDK2 upper layers expect byte addressable code, for the RPMB to
> > > work, we need to allocate memory and sync it with the hardware on
> > > read/writes. Since DynamicPCDs are not supported in that context we
> > > can only use PatchablePCDs. So let's switch them to Pcd instead of
> > > FixedPcd and accomodate the new driver.
> > >
> > > Signed-off-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> > > Reviewed-by: Sami Mujawar <sami.mujawar at arm.com>
> > > ---
> > >
> > > Changes since V3: None
> > >
> > >
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> > > | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git
> > >
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.in
> > > f
> > >
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.in
> > > f
> > > index fada0bf3c5..2a25fbdada 100644
> > > ---
> > >
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.in
> > > f
> > > +++
> > >
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.in
> > > f
> > > @@ -119,10 +119,12 @@
> > >    ## SOMETIMES_PRODUCES   ## Variable:L"VarErrorFlag"
> > >    gEdkiiVarErrorFlagGuid
> > >
> > > -[FixedPcd]
> > > -  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
> > > ## CONSUMES
> > > +[Pcd]
> > >    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
> > > ## SOMETIMES_CONSUMES
> > >
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
> > > ## CONSUMES
> > > +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
> > > ## CONSUMES
> > > +
> > > +[FixedPcd]
> > >    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize
> > > ## CONSUMES
> > >    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize
> > > ## CONSUMES
> > >    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize
> > > ## CONSUMES
> > > --
> > > 2.17.1
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> > 
> >
> >




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71795): https://edk2.groups.io/g/devel/message/71795
Mute This Topic: https://groups.io/mt/80745940/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list