From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.2596.1613697364769705627 for ; Thu, 18 Feb 2021 17:16:06 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 19 Feb 2021 09:15:58 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Ilias Apalodimas'" , Cc: , "'Sami Mujawar'" , "'Ard Biesheuvel'" References: <20210217112717.6820-1-sughosh.ganu@linaro.org> <20210217112717.6820-14-sughosh.ganu@linaro.org> <000901d705a4$02f958b0$08ec0a10$@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiDlm57lpI06IFtlZGsyLWRldmVsXSBbUEFUQ0ggdjQgMTMvMTRdIE1kZU1vZHVsZVBrZy9WYXJpYWJsZVN0YW5kYWxvbmVNbTogU2V0IFBjZEZsYXNoTnZTdG9yYWdlVmFyaWFibGVCYXNlIHRvIFBjZA==?= Date: Fri, 19 Feb 2021 09:15:59 +0800 Message-ID: <002b01d7065c$c82477b0$586d6710$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJVIfExuDv3PmCFJgwN2KPvYcE1hwHNtfuYAgYKaq0CYG9P8akw0gxg Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Ilias: If you check other Variable module INF file, you can find they all use [P= cd] section. Module provides the flexibility instead of the limitation. In = fact, variable module code has no fixed pcd usage. Platform can decide whic= h PCD type should be used. In future, if other PCD is required to be config= ured as patchable in module, you don't need to modify variable INF again.= =20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Ilias Apalodimas > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B42=E6=9C=8818=E6=97=A5= 17:17 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; gaoliming@byosoft.com= .cn > =E6=8A=84=E9=80=81: sughosh.ganu@linaro.org; 'Sami Mujawar' ; > 'Ard Biesheuvel' > =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH v4 13/14= ] > MdeModulePkg/VariableStandaloneMm: Set PcdFlashNvStorageVariableBase > to Pcd >=20 > 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. >=20 > 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? >=20 > The values that were swapped from FixedPcd to Pcd are expected to change > in > runtime, while the rest don't. >=20 > Thanks > /Ilias >=20 > > > > With this change, Reviewed-by: Liming Gao > > > > Thanks > > Liming > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > > =E5=8F=91=E4=BB=B6=E4=BA=BA: bounce+27952+71734+4905953+8761045@grou= ps.io > > > =E4=BB=A3=E8=A1=A8 Su= ghosh > Ganu > > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B42=E6=9C=8817=E6= =97=A5 19:27 > > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > > > =E6=8A=84=E9=80=81: Sami Mujawar ; Ilias Apalo= dimas > > > ; Ard Biesheuvel > > > > =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH v4 13/14] > MdeModulePkg/VariableStandaloneMm: > > > Set PcdFlashNvStorageVariableBase to Pcd > > > > > > From: Ilias Apalodimas > > > > > > Instead of running StMM in SPM, OP-TEE creates a new secure partitio= n, > > > 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 t= o > > > 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 > > > Reviewed-by: Sami Mujawar > > > --- > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > >=20 > > > >