From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from netsrv01.beckhoff.com (netsrv01.beckhoff.com [62.159.14.10]) by mx.groups.io with SMTP id smtpd.web12.7582.1631773350207043312 for ; Wed, 15 Sep 2021 23:22:30 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: beckhoff.com, ip: 62.159.14.10, mailfrom: c.koehne@beckhoff.com) Received: from 172.17.5.170 by netsrv01.beckhoff.com (Tls12, Aes256, Sha384, DiffieHellmanEllipticKey256); Thu, 16 Sep 2021 06:22:26 GMT Received: from CorvinK-NB03.beckhoff.com (172.17.62.165) by ex04.beckhoff.com (172.17.5.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.14; Thu, 16 Sep 2021 08:22:17 +0200 From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: CC: , , , , , , =?UTF-8?q?Corvin=20K=C3=B6hne?= Subject: [PATCH v2] OvmfPkg: set a default value for the WorkAreaHeader PCD Date: Thu, 16 Sep 2021 08:21:39 +0200 Message-ID: <20210916062139.1897-1-c.koehne@beckhoff.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Return-Path: c.koehne@beckhoff.com X-Originating-IP: [172.17.62.165] X-ClientProxiedBy: ex03.beckhoff.com (172.17.2.169) To ex04.beckhoff.com (172.17.5.170) Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable SEC checks in IsSevGuest if the PCD defined WorkAreaHeader size matches the= size of the WorkAreaHeader struct definition. Set a default value for the = PCD to avoid unnecessary DSC/FDF file changes in all OVMF DSC/FDF files. Signed-off-by: Corvin K=C3=B6hne --- OvmfPkg/Include/WorkArea.h | 4 ++++ OvmfPkg/OvmfPkg.dec | 7 ++++++- OvmfPkg/OvmfPkgDefines.fdf.inc | 6 ------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/OvmfPkg/Include/WorkArea.h b/OvmfPkg/Include/WorkArea.h index c16030e3ac..0f9b442e43 100644 --- a/OvmfPkg/Include/WorkArea.h +++ b/OvmfPkg/Include/WorkArea.h @@ -25,6 +25,10 @@ typedef enum { // to the structure need to be kept in sync with the // PcdOvmfConfidentialComputingWorkAreaHeader. // +// PcdOvmfConfidentialComputingWorkAreaHeader =3D=3D +// sizeof (CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER) +// +// PcdOvmfConfidentialComputingWorkAreaHeader defined in OvmfPkg/OvmfPkg.d= ec typedef struct _CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER { UINT8 GuestType; UINT8 Reserved1[3]; diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index 75d47e0e00..3ed3811320 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -339,7 +339,12 @@ # The size of this header is used early boot, and is provided through # a fixed PCD. It need to be kept in sync with any changes to the # header definition. - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader|0|= UINT32|0x51 + # + # PcdOvmfConfidentialComputingWorkAreaHeader =3D=3D + # sizeof (CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER) + # + # CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER defined in OvmfPkg/Include/Wor= kArea.h + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader|4|= UINT32|0x51 [PcdsDynamic, PcdsDynamicEx] diff --git a/OvmfPkg/OvmfPkgDefines.fdf.inc b/OvmfPkg/OvmfPkgDefines.fdf.in= c index 3b5e452539..35fd454b97 100644 --- a/OvmfPkg/OvmfPkgDefines.fdf.inc +++ b/OvmfPkg/OvmfPkgDefines.fdf.inc @@ -82,12 +82,6 @@ SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwW= orkingSize =3D $(BLOCK_SIZ SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase =3D gUefi= OvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gEfiMdeModulePk= gTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize =3D $(VAR= S_SPARE_SIZE) -# The OVMF WorkArea contains a fixed size header followed by the actual da= ta. -# The size of header is accessed through a fixed PCD in the reset vector c= ode. -# The value need to be kept in sync with the any changes to the Confidenti= al -# Computing Work Area header defined in the Include/WorkArea.h -SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader = =3D 4 - !if $(SMM_REQUIRE) =3D=3D TRUE SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 =3D gUe= fiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase =3D gUe= fiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase -- 2.11.0 Beckhoff Automation GmbH & Co. KG | Managing Director: Dipl. Phys. Hans Bec= khoff Registered office: Verl, Germany | Register court: Guetersloh HRA 707= 5