From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.9842.1672996480840570955 for ; Fri, 06 Jan 2023 01:14:41 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NlGYokn1; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: jiewen.yao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672996480; x=1704532480; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=TacX2OGidI2I94eyOgFcLH6V2OHgsyruogyDHRVdMg4=; b=NlGYokn13/C0AgJUYwJHw1MNIq6CtHtxEN1fvgMwn5No9R7uN1XQ8m6L PJT06UQx1FJQ3PF4P+8jcW95KzoeQpNLv1Nk9NaWjjm3yCYih7CjS7e7t yZNjmY0LAkQBAu7LUPocV9nn0Hzm3Gbt1zeop60wleqw4qToqmgi5nn9A TbG35mkfPryYdd5ndTayDwwCl/9T/6yM5AaGhALDBN+OgMO0iNY6M4fo0 Z6HhyIha7Co97gTR0K3j+xbEH1svcsKNQJsY3M3fGi0RPg4dlqtvYAPFX yLJvFobAbGj//ksKBVpBsdWBwjZ4tmShhovBnd8qjlmt500nTkc3N8R2/ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="322510224" X-IronPort-AV: E=Sophos;i="5.96,304,1665471600"; d="scan'208";a="322510224" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2023 01:14:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="901233358" X-IronPort-AV: E=Sophos;i="5.96,304,1665471600"; d="scan'208";a="901233358" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga006.fm.intel.com with ESMTP; 06 Jan 2023 01:14:40 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 6 Jan 2023 01:14:39 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 6 Jan 2023 01:14:39 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.49) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 6 Jan 2023 01:14:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I0jwdeEltJx/cA79jaKamq7Z49NrJJH47b9NVg0ZmEqnDG248C5hl2zEIswYUmmaf7A/7Bx7WRjUjSjXU4hZLcKCVSC2wx88eu/W6QH6LyfAfYak9oosSW/fNgPjpSpLUnhBNURX/ndRPGeaKcTUJJ2jUA4j0IdZpDvk+evlDjH8jZ/7KiYQ+WvZ5L49J0GBx+pvss+2U142r7pe8GoTHJbDNQ6PxBiJN4iFa+W+Qzuz3z2JfwGoo+JvVUCkZZGavDH0vJI5lPPm9ptj1sa5k9WReSdacsvM4VPM6g7tuD769Y9LqFSphIzY0hN6dPUuTawiPoNk0ICn/eELm0MxaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Bo97GUKzD4rAnUDXHtVvM5KeneKij61ZrWkR/3cePWk=; b=HAMYxIz8wGXwNjhZ+wLo3R42xS26ZweeIFjIVks8Ak6gua0Dfte9yPZtZ03goD4jdZVWUupmuOVC3lPpJj4qN15MJ3i9ilYCW2hocDvYA61hIkKofvcHI0rsV3HP7aXYv6nmt+5ZqvfexHHkVE15n+QF5oRzkj4zr+F7uUSeaEkI5RScdktNTrOqAtkzy67EQzAs+0stc8hVgZQzGQjKfQYPtcIshaw1vFcH8MgNaBUY+uh7u3+SRcv5IeKmbtWBTOmiHceV+h7ph6TxeTL+RZZCgY4W2Dk9FGi50g+KTyZh7u28CqytzDXOMrMoz66WpW1nu2CjPe5Ppm8vvNhQTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by SJ0PR11MB5814.namprd11.prod.outlook.com (2603:10b6:a03:423::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Fri, 6 Jan 2023 09:14:32 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::5f56:1bdc:2eae:c041]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::5f56:1bdc:2eae:c041%9]) with mapi id 15.20.5944.019; Fri, 6 Jan 2023 09:14:32 +0000 From: "Yao, Jiewen" To: "devel@edk2.groups.io" , "Michael.Roth@amd.com" CC: Tom Lendacky , "Ni, Ray" Subject: Re: [edk2-devel] [PATCH 2/4] OvmfPkg/AmdSevDxe: Update ConfidentialComputing blob struct definition Thread-Topic: [edk2-devel] [PATCH 2/4] OvmfPkg/AmdSevDxe: Update ConfidentialComputing blob struct definition Thread-Index: AQHZFYKg00/pJGmm7UGGe1jsRQAJTq6RMtWw Date: Fri, 6 Jan 2023 09:14:32 +0000 Message-ID: References: <20221221160651.182143-1-michael.roth@amd.com> <20221221160651.182143-3-michael.roth@amd.com> In-Reply-To: <20221221160651.182143-3-michael.roth@amd.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|SJ0PR11MB5814:EE_ x-ms-office365-filtering-correlation-id: 03cffce4-f83b-4c39-09d6-08daefc66c30 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: h2X8gxPtnGMxRfZhA6e/qppHhIiop9oWr50rf0g/8Y/vRanK6vQLjnImdqpI0Ao/k8gYsmjUkyRQgO7U/6kRC/1KnTK1OkI1ujnPEVeKNxOfxO4AsY+Nxlw1movAxmbnLIx4hdb4ibh8amJ5p1/FFB+L3sKuwOOB0mprvS1r/IjsaT32Vhgy/2cCm9+zrzvdJYGxObGDjTv/WXTdEQIIhtaFhGu43DUFWe7YGT0DkG6IP0y7EhfhMNodFv3rbl6og/k6W8jp/qypvW4Sz/ahQDO6WawqO+Cs6iuziHDWHyLkTkaZDRqkNVUComkRwnqlPAzbhFyqmkxwnuylPAn0LkTWPUSjOcXbAG5wkVYQfUqtuhPMDaibSENEFc7s8ts5MDaE/YZ0d6ZNfFO0kkly1MriQVdeGNJ1Jlw0/gRxv60EjdYKiWdoYtx9ePG7wlE8vQDjn4X+gDgDuQUCMNMw38b+YXeiMRaWEz/98fBbBKgWrxx8hUM4BVDD4DhLWOnoYeUmgI1flI5hr3OHvG2UbiBGi0Y2XfJTlYZFSITDSjy6h0tiOFPWdmNgeJXZXqjOselXnyK6rDuHhY4Pu95dwcEccnJO6tOADQkF1/NXNAonpt4uJo6Ut9WI48fdZFI1/8ZhwT3OhrsO4V7DzOXaAJlhjuIvkyPdJ0T1aiJHcbw3NqWjJaKw4VbJyiG3/ZQbHxjqihNyFOVTxN8noXANKMII92+R/mD/XrpG3V6o7t5PuFyJbssNaWvcWn7LR3NMgI7tlRPFogyy8SgcbJWsgg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5872.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39860400002)(396003)(376002)(346002)(136003)(451199015)(66899015)(52536014)(76116006)(5660300002)(316002)(54906003)(15650500001)(2906002)(41300700001)(66446008)(4326008)(64756008)(66946007)(8676002)(8936002)(66556008)(66476007)(83380400001)(478600001)(110136005)(6506007)(107886003)(53546011)(71200400001)(26005)(186003)(9686003)(966005)(82960400001)(7696005)(86362001)(33656002)(38100700002)(122000001)(38070700005)(55016003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?2CHHUcXEuUKFa0SgTDfoHX2nCRJEIuEJXkPWVAqtam6Td3LwuiD8y1nLWAis?= =?us-ascii?Q?xTmqm+AutK9QjijsD01taCiA596YbY+DvONYNbRAdqPpbjfqzRN2ZrDVm/it?= =?us-ascii?Q?OaOPdxofav3eHaVTX0jQFaYToH1UcXueI7CnxYOtg7ZBsSWa2B0flGR+if9k?= =?us-ascii?Q?UGruZN9BZGJQQIj8qb/e8gqh1u32pcMTH764JY6gfW2b0fo6d/72VNt6g1xj?= =?us-ascii?Q?8+47HaRw1Tn02NwUw/IXEXn9FWAhBuL61d1MbMqTx62bpu2kZbsbrhJY47uR?= =?us-ascii?Q?tNvoVgH4fFLR1Go4anshjpleH8vLMYFn9SWz+XQgu8E/Eb3kcmLXc7jB9VXB?= =?us-ascii?Q?rGRrKAGKdKKyodF7HcP4NkQtFWv3jWnAXyKSwT9tpO+5k5ZgPVi8Jrhi1X6Y?= =?us-ascii?Q?Yk5wUHLDOdN38fE4VBwKvWVwAi7rzfUUM+VSwGKm1Tz1/odE8rT2riguqnvO?= =?us-ascii?Q?RK0mwsqLrK62/eVtivJPfLGkWiS/yrLmYDtUbvRnXK2AAHgVm9nqLrFYrTin?= =?us-ascii?Q?MHgYQWMgk2Xn410BSuI2sTEEvTPHnQBs5I/isGH/gwlPx8yZNvMyVm16xD/Q?= =?us-ascii?Q?6H4VfbecU/lscHK4Y1R/2cbkw5TwnDCLdB6jIi7PBEMmDwt1QG2RBBZQabi8?= =?us-ascii?Q?AEEzp/qpfmW9mIY8fglTbvpml4LtWVPwp2cTHe+t9yKKMrYSl+DRgDTq8jU3?= =?us-ascii?Q?8NzbzEnWR4iFGnNsWwlQaHsgi4Z880M04X+owkiLT1DWj6UolSxxachW+7oX?= =?us-ascii?Q?sqMdcn663AZnKDzYNbCwmU+1PZe1OGyVj9P+sAHXxMoYwETfRto88s4geh0k?= =?us-ascii?Q?n1WalOjDt4G1HVU5J1IslNpeCIRpIdJBb8NrzvgqSrsIL87zDiFpskCVHHDZ?= =?us-ascii?Q?TdCDRUndEfLRwi8Yxq1cNybpPhLatFkjTz6Yom49BWR0yrP8/A/pnao00G1i?= =?us-ascii?Q?85rP8z0zE+V1+p43J1HV9Zu/YmxstddmamUdhKUg4CO2IVk7dWJt+PIn52GE?= =?us-ascii?Q?dm4a3Q0l45pKeJGmLn36xy+QvViTxk50vwWSfkfmEXNb9+pzBIKV9rVJquR4?= =?us-ascii?Q?6bReF4TvZQudgj4pJeQEGDVB62z9mGvBLwoQ6p/2cRCJWalMl0vRIRVS2D2F?= =?us-ascii?Q?e86bzGa3ZaXutHUJtUwkIIJfXMH8j8MwruQQ4b4INNn+eY4QZBdv2Gii65yx?= =?us-ascii?Q?0WaVyVTYVX0eE7uygTAZyrx0OqB1PV9bLAdINc93AzomoxhM2iWGK6wLV19A?= =?us-ascii?Q?QEYUAXqWCxRhYFOa6S7bGbuGPSwyLERNEffbftzRktAEacJU0Jj3RusJfN9/?= =?us-ascii?Q?tB/6+usBegVBjUSIoOwlkrDPcmRLxTPFSEDsGPr6M7nDdwUav41+dR1s7Cec?= =?us-ascii?Q?CUdtr05mze74dZ87CE4OENH57SmlSE9qkcgnEvVdq4DfUGSk68+G2Q9cVAd/?= =?us-ascii?Q?X2H/vCVH7Uae/IPH9ptmafvaEaId8A9c6D9Lkz9HwIPq2csXxgxkWQnbiCaI?= =?us-ascii?Q?h3hilq/jceYgj33KV6CZiph1BYiN16JuJEvKxYkSdD9eMaqV8E5vbtep/1Jv?= =?us-ascii?Q?8Tu3Nc8/m1u8U+u+Trl4yTIkE1f+smjpRriMqQnX?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 03cffce4-f83b-4c39-09d6-08daefc66c30 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2023 09:14:32.3528 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SzUCxGYxsmxJ8hGvGOxrUNNyd07OcG7ptaADcrbZP+onTCfiWAwHhRKg198GtnOVDZ39dgk23AYG6eQj36hZrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5814 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Acked-by: Jiewen Yao > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Roth, > Michael via groups.io > Sent: Thursday, December 22, 2022 12:07 AM > To: devel@edk2.groups.io > Cc: Tom Lendacky ; Ni, Ray > Subject: [edk2-devel] [PATCH 2/4] OvmfPkg/AmdSevDxe: Update > ConfidentialComputing blob struct definition >=20 > The Confidential Computing blob defined here is intended to match the > definition defined by linux guest kernel. Previously, both definitions > relied on natural alignment, but that relies on both OVMF and kernel > being compiled as 64-bit. While there aren't currently any plans to > enable SNP support for 32-bit compilations, the kernel definition has > since been updated to use explicit padding/reserved fields to avoid > this dependency. Update OVMF to match that definition. >=20 > While at it, also fix up the Reserved fields to match the numbering > used in the kernel. >=20 > No functional changes (for currently-supported environments, at least). >=20 > Reviewed-by: Tom Lendacky > Signed-off-by: Michael Roth > --- > OvmfPkg/AmdSevDxe/AmdSevDxe.c | 4 +++- > OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h | 6 ++++-- > 2 files changed, 7 insertions(+), 3 deletions(-) >=20 > diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c > b/OvmfPkg/AmdSevDxe/AmdSevDxe.c > index 8dfda961d7..00bb6e5d96 100644 > --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c > +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c > @@ -41,11 +41,13 @@ AllocateConfidentialComputingBlob ( >=20 >=20 > CcBlob->Header =3D SIGNATURE_32 ('A', 'M', 'D', 'E'); >=20 > CcBlob->Version =3D 1; >=20 > - CcBlob->Reserved1 =3D 0; >=20 > + CcBlob->Reserved =3D 0; >=20 > CcBlob->SecretsPhysicalAddress =3D (UINT64)(UINTN)FixedPcdGet32 > (PcdOvmfSnpSecretsBase); >=20 > CcBlob->SecretsSize =3D FixedPcdGet32 (PcdOvmfSnpSecretsSiz= e); >=20 > + CcBlob->Reserved1 =3D 0; >=20 > CcBlob->CpuidPhysicalAddress =3D (UINT64)(UINTN)FixedPcdGet32 > (PcdOvmfCpuidBase); >=20 > CcBlob->CpuidLSize =3D FixedPcdGet32 (PcdOvmfCpuidSize); >=20 > + CcBlob->Reserved2 =3D 0; >=20 >=20 >=20 > *CcBlobPtr =3D CcBlob; >=20 >=20 >=20 > diff --git a/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h > b/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h > index b328310fd0..83620e31b8 100644 > --- a/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h > +++ b/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h > @@ -18,14 +18,16 @@ > { 0x85, 0x54, 0x93, 0xd7, 0x77, 0x91, 0x2d, 0x42 }, \ >=20 > } >=20 >=20 >=20 > -typedef struct { >=20 > +typedef PACKED struct { >=20 > UINT32 Header; >=20 > UINT16 Version; >=20 > - UINT16 Reserved1; >=20 > + UINT16 Reserved; >=20 > UINT64 SecretsPhysicalAddress; >=20 > UINT32 SecretsSize; >=20 > + UINT32 Reserved1; >=20 > UINT64 CpuidPhysicalAddress; >=20 > UINT32 CpuidLSize; >=20 > + UINT32 Reserved2; >=20 > } CONFIDENTIAL_COMPUTING_SNP_BLOB_LOCATION; >=20 >=20 >=20 > extern EFI_GUID gConfidentialComputingSevSnpBlobGuid; >=20 > -- > 2.25.1 >=20 >=20 >=20 >=20 >=20