[edk2-devel] [RFC PATCH v3 01/43] MdePkg: Create PCDs to be used in support of SEV-ES

Ni, Ray ray.ni at intel.com
Thu Dec 12 06:53:57 UTC 2019


Do you really need to define the PCD in MdePkg?
General guide lines are:
1. Avoid UefiCpuPkg depend on MdeModulePkg.
2. Do not define platform level PCD in core pkgs (MdePkg, MdeModulePkg, UefiCpuPkg, etc)


PcdSevEsIsEnabled seems to be used in OVMF pkg only so how about define that in OvmfPkg.dec?

Thanks,
Ray

> -----Original Message-----
> From: Tom Lendacky <thomas.lendacky at amd.com>
> Sent: Thursday, November 21, 2019 4:06 AM
> To: devel at edk2.groups.io
> Cc: Justen, Jordan L <jordan.l.justen at intel.com>; Laszlo Ersek <lersek at redhat.com>; Ard Biesheuvel
> <ard.biesheuvel at linaro.org>; Kinney, Michael D <michael.d.kinney at intel.com>; Gao, Liming <liming.gao at intel.com>; Dong,
> Eric <eric.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Brijesh Singh <brijesh.singh at amd.com>; Wang, Jian J
> <jian.j.wang at intel.com>; Wu, Hao A <hao.a.wu at intel.com>
> Subject: [RFC PATCH v3 01/43] MdePkg: Create PCDs to be used in support of SEV-ES
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198
> 
> Two new fixed PCSs are needed to support SEV-ES under OVMF:
>   - PcdSecGhcbBase  UINT64 value that is the base address of the GHCB
>                     used during the SEC phase.
>   - PcdSecGhcbSize  UINT64 value that is the size, in bytes, of the GHCB
>                     area used during the SEC phase.
> 
> Three new dynamic PCDs are needed to support SEV-ES under OVMF:
>   - PcdSevEsIsEnabled: BOOLEAN value used to indicate if SEV-ES is enabled
>   - PcdGhcbBase:       UINT64 value that is the base address of the GHCB
>                        allocation.
>   - PcdGhcbSize:       UINT64 value that is the size, in bytes, of the
>                        GHCB allocation (size is dependent on the number of
>                        APs).
> 
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Hao A Wu <hao.a.wu at intel.com>
> Signed-off-by: Tom Lendacky <thomas.lendacky at amd.com>
> ---
>  MdeModulePkg/MdeModulePkg.dec | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
> index 41b9e70a1ac8..c3bdfcc80971 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -1037,6 +1037,14 @@ [PcdsFixedAtBuild]
>    # @Prompt Enable UEFI Stack Guard.
>    gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055
> 
> +  ## The base address of the SEC GHCB page.
> +  # @Prompt SEC GHCB Base Address
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSecGhcbBase|0|UINT32|0x30001056
> +
> +  ## The total size of the SEC GHCB page.
> +  # @Prompt SEC GHCB Size
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSecGhcbSize|0|UINT32|0x30001057
> +
>  [PcdsFixedAtBuild, PcdsPatchableInModule]
>    ## Dynamic type PCD can be registered callback function for Pcd setting action.
>    #  PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function
> @@ -2053,6 +2061,21 @@ [PcdsDynamic, PcdsDynamicEx]
>    # @Prompt If there is any test key used by the platform.
>    gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|BOOLEAN|0x00030003
> 
> +  ## This dynamic PCD indicates whether SEV-ES is enabled
> +  #   TRUE  - SEV-ES is enabled
> +  #   FALSE - SEV-ES is not enabled
> +  # @Prompt SEV-ES Status
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSevEsIsEnabled|FALSE|BOOLEAN|0x00030007
> +
> +  ## This dynamic PCD holds the base address of the GHCB pool allocation.
> +  # @Prompt GHCB Pool Base Address
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase|0|UINT64|0x00030008
> +
> +  ## This dynamic PCD holds the total size of the GHCB pool allocation.
> +  #  The amount of memory allocated for GHCBs is dependent on the number of APs.
> +  # @Prompt GHCB Pool Size
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize|0|UINT64|0x00030009
> +
>  [PcdsDynamicEx]
>    ## This dynamic PCD enables the default variable setting.
>    #  Its value is the default store ID value. The default value is zero as Standard default.
> --
> 2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52147): https://edk2.groups.io/g/devel/message/52147
Mute This Topic: https://groups.io/mt/60973096/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