public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] OvmfPkg/BhyvePkg: add WorkAreaHeader PCD
@ 2021-09-15  9:27 Corvin Köhne
  2021-09-15 12:57 ` Yao, Jiewen
  0 siblings, 1 reply; 2+ messages in thread
From: Corvin Köhne @ 2021-09-15  9:27 UTC (permalink / raw)
  To: devel
  Cc: ardb+tianocore, jiewen.yao, jordan.l.justen, kraxel, rebecca,
	grehan, Corvin Köhne

SEC phase will throw an assertion in IsSevGuest if
PcdOvmfConfidentialComputingWorkAreaHeader doesn't match the
sizeof CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER.

Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
---
 OvmfPkg/Bhyve/BhyveDefines.fdf.inc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/OvmfPkg/Bhyve/BhyveDefines.fdf.inc b/OvmfPkg/Bhyve/BhyveDefines.fdf.inc
index 66e0e4d270..9f01ef797c 100644
--- a/OvmfPkg/Bhyve/BhyveDefines.fdf.inc
+++ b/OvmfPkg/Bhyve/BhyveDefines.fdf.inc
@@ -82,4 +82,10 @@ SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize = $(BLOCK_SIZ
 SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
 SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize = $(VARS_SPARE_SIZE)

+# The OVMF WorkArea contains a fixed size header followed by the actual data.
+# The size of header is accessed through a fixed PCD in the reset vector code.
+# The value need to be kept in sync with the any changes to the Confidential
+# Computing Work Area header defined in the Include/WorkArea.h
+SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader  = 4
+
 DEFINE MEMFD_BASE_ADDRESS = 0x800000
--
2.11.0

Beckhoff Automation GmbH & Co. KG | Managing Director: Dipl. Phys. Hans Beckhoff Registered office: Verl, Germany | Register court: Guetersloh HRA 7075



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] OvmfPkg/BhyvePkg: add WorkAreaHeader PCD
  2021-09-15  9:27 [PATCH] OvmfPkg/BhyvePkg: add WorkAreaHeader PCD Corvin Köhne
@ 2021-09-15 12:57 ` Yao, Jiewen
  0 siblings, 0 replies; 2+ messages in thread
From: Yao, Jiewen @ 2021-09-15 12:57 UTC (permalink / raw)
  To: Köhne, Corvin, devel@edk2.groups.io
  Cc: ardb+tianocore@kernel.org, Justen, Jordan L, kraxel@redhat.com,
	rebecca@bsdio.com, grehan@freebsd.org, Köhne, Corvin

Hi
To avoid unnecessary change in DSC/FDF, can we change default size to be 4 in DEC?

gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader|4|UINT32|0x51

We shall also add comment on 4 == sizeof(CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER) in OvmfPkg/Include/WorkArea.h.


Thank you
Yao Jiewen


> -----Original Message-----
> From: Corvin Köhne <c.koehne@beckhoff.com>
> Sent: Wednesday, September 15, 2021 5:27 PM
> To: devel@edk2.groups.io
> Cc: ardb+tianocore@kernel.org; Yao, Jiewen <jiewen.yao@intel.com>; Justen,
> Jordan L <jordan.l.justen@intel.com>; kraxel@redhat.com; rebecca@bsdio.com;
> grehan@freebsd.org; Köhne, Corvin <c.koehne@beckhoff.com>
> Subject: [PATCH] OvmfPkg/BhyvePkg: add WorkAreaHeader PCD
> 
> SEC phase will throw an assertion in IsSevGuest if
> PcdOvmfConfidentialComputingWorkAreaHeader doesn't match the
> sizeof CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER.
> 
> Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
> ---
>  OvmfPkg/Bhyve/BhyveDefines.fdf.inc | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/OvmfPkg/Bhyve/BhyveDefines.fdf.inc
> b/OvmfPkg/Bhyve/BhyveDefines.fdf.inc
> index 66e0e4d270..9f01ef797c 100644
> --- a/OvmfPkg/Bhyve/BhyveDefines.fdf.inc
> +++ b/OvmfPkg/Bhyve/BhyveDefines.fdf.inc
> @@ -82,4 +82,10 @@ SET
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize =
> $(BLOCK_SIZ
>  SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase =
> gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase +
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
>  SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize =
> $(VARS_SPARE_SIZE)
> 
> +# The OVMF WorkArea contains a fixed size header followed by the actual data.
> +# The size of header is accessed through a fixed PCD in the reset vector code.
> +# The value need to be kept in sync with the any changes to the Confidential
> +# Computing Work Area header defined in the Include/WorkArea.h
> +SET
> gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeade
> r  = 4
> +
>  DEFINE MEMFD_BASE_ADDRESS = 0x800000
> --
> 2.11.0
> 
> Beckhoff Automation GmbH & Co. KG | Managing Director: Dipl. Phys. Hans
> Beckhoff Registered office: Verl, Germany | Register court: Guetersloh HRA
> 7075
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-15 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-15  9:27 [PATCH] OvmfPkg/BhyvePkg: add WorkAreaHeader PCD Corvin Köhne
2021-09-15 12:57 ` Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox