From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web11.91252.1682454867174175600 for ; Tue, 25 Apr 2023 13:34:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=pDMVUkNd; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.236.41, mailfrom: michael.roth@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XOZgTi2kWxTqpNVoqOEZY3l4Bnr+/WE1Ooc4R4c66oh+XBaIGD0dydOYXzegXSEclwf5DZur0De5q+nc5SnbfFi/xZfJytI4umywpFBbPDgVBvtcQ1E92LASebMCltiMPoiIMYUXC0sZ5rzebwV70to1cR0rWBIiCnrBh7Cs+8O+nj6WQo18R7TsN22VTo9Rv6S83Y9s7dDSjvbGV3ny7+30PSDvelKh7I/xSIGwnW3qwqQV3OgafKM8Y1+iyyGyvgeYIw/6myUHMOmeUqbCDYKWblw8LRcCFrRvFzxrjyjuTcE3QUVOHWGCBsn6ETIOQ5bHqJ8ThTa8uN6pNWo+7A== 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=LU0TLOihRyLUfYJBRj8/PyOgZRWlffz2ftDO4jqqdxc=; b=RTtpLytljj3e8LgML1Yry8eS7tZnD6Kthv147v8pPBDmYuLN0dnV8XoaKrzno7xVMPcPG98ebuS4f0Ob4Oc/Cwmu+jPq9CNfbs6Gvic8SKDo5SJ4vJEbY6AavCXxiph3MmmON612wPuiRWEjHuOaSfkjeVkXE36Yq2p6Ce10NtnnVGm7ZcA0O+qRjmiP3ucHGubkXIWFYAm7DjtnrUQ60K+zHSjX1rUB0CzAFpg33w7ifiamiTQRwZl+ecywLJBPZkDQ52oe+iD8UVAkkAAza/h1F0naT3Ck26VYKiUJAzUR/ZSAMZ0znzpzU1v2E578yWgSrYbqDwWr8T0q6IQ1Tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LU0TLOihRyLUfYJBRj8/PyOgZRWlffz2ftDO4jqqdxc=; b=pDMVUkNdIOV229BvJxpBe3ekOQ4z7dAM6BIQOOuV6lKtivtTDRvkTXQF15xmpG8zh5yG4/xTfX089ajf9Mwf+sR/3sxoKDthgmJ6xr5wIhVnTjp7FZ6ZNH+G5croFhcTd2zp+cPIhHC9xES12QABn5GmDMCa9CoTzlA99on2M6g= Received: from BN1PR10CA0011.namprd10.prod.outlook.com (2603:10b6:408:e0::16) by DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 20:34:24 +0000 Received: from BN8NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e0:cafe::8c) by BN1PR10CA0011.outlook.office365.com (2603:10b6:408:e0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34 via Frontend Transport; Tue, 25 Apr 2023 20:34:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT067.mail.protection.outlook.com (10.13.177.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6340.21 via Frontend Transport; Tue, 25 Apr 2023 20:34:24 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 25 Apr 2023 15:34:23 -0500 From: "Roth, Michael" To: CC: Ard Biesheuvel , Tom Lendacky , Jiewen Yao , , Gerd Hoffmann , Erdem Aktas , James Bottomley , Min Xu Subject: [PATCH v2 2/4] OvmfPkg/AmdSevDxe: Update ConfidentialComputing blob struct definition Date: Tue, 25 Apr 2023 15:32:56 -0500 Message-ID: <20230425203258.255583-3-michael.roth@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230425203258.255583-1-michael.roth@amd.com> References: <20230425203258.255583-1-michael.roth@amd.com> MIME-Version: 1.0 Return-Path: Michael.Roth@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT067:EE_|DM4PR12MB5373:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b42616e-9783-48be-7289-08db45cc7538 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J/S2Esnr+meSrFeAEs7BqIn8ji8UGftg9wzPj+y/uIdKFNjDIGItwRliQfCdxHQ7v4r+IRrdwQAfkxQnqwCf2VmXGdQsh9BV9AwsTT/oOvsOwUcEYnJsK/vmz9sMA1Ihj7bff1/GvCyrk46wKR+Fk/lMpuuYhWLf9w5NqfSdHTWx5gjijj4yv5Hks0r3oDPfIcfdPpYj2R5XyZIm4yzIi4FR1uNWUHMJFGlVO6AK2zL17sGyDhGTEhnrquWQMaqI2OtuICl8IiduEpKjPkUcauhECnNdOXs3v58GDwv8en62UBTz9e1BjiyFCrYxhTaSzDQG3Gsdex2qOJbVx2N4OoZ/S3tsp0oi1KZVqMpGtsNHYAm0FdYvvoLF7Wgh7FXze068Wckq0TmD1H7OUtfXqjS5TY+IjVOB1KqTzoF/1o2sKBRMgBnE9DceyOddWaTy6IPQ+0E2W2G/j11YuCFag73I3yw1TIYWvC1YoV1MzkzbSYQivetUxyuaijccQfXi9OJHv4uWHHkTTuNtrj/IPGbm+XfG+4UXeo+H8R+mzfYHa+ACp2rCrajRfV/d5JRLTiiAeCgjnxCvMUpDdrIo/cxze5i5v8rLnjcJRbO2eFsIOln/yc5nrhXPjvuRSpbkaRrwRba8kIdGw75pQoRrpwTTfAFiH2+I6WjQReij/89DcJKCJsu9wzxQrg26Snx55K+QMS3zGvVasq9XcnT4VUew8wx+JxEjPzU5XxRmzDA= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(346002)(376002)(451199021)(36840700001)(46966006)(40470700004)(70586007)(70206006)(82740400003)(83380400001)(44832011)(2906002)(36860700001)(40480700001)(26005)(1076003)(82310400005)(316002)(6666004)(4326008)(6916009)(47076005)(2616005)(356005)(426003)(336012)(8676002)(81166007)(15650500001)(41300700001)(5660300002)(8936002)(54906003)(86362001)(478600001)(40460700003)(16526019)(36756003)(186003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 20:34:24.4866 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b42616e-9783-48be-7289-08db45cc7538 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5373 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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. While at it, also fix up the Reserved fields to match the numbering used in the kernel. No functional changes (for currently-supported environments, at least). Reviewed-by: Tom Lendacky Acked-by: Jiewen Yao Acked-by: Gerd Hoffmann Signed-off-by: Michael Roth --- OvmfPkg/AmdSevDxe/AmdSevDxe.c | 4 +++- OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c index df807066fa..db3675ae86 100644 --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c @@ -48,11 +48,13 @@ AllocateConfidentialComputingBlob ( =0D CcBlob->Header =3D SIGNATURE_32 ('A', 'M', 'D', 'E');=0D CcBlob->Version =3D 1;=0D - CcBlob->Reserved1 =3D 0;=0D + CcBlob->Reserved =3D 0;=0D CcBlob->SecretsPhysicalAddress =3D (UINT64)(UINTN)FixedPcdGet32 (PcdOvmf= SnpSecretsBase);=0D CcBlob->SecretsSize =3D FixedPcdGet32 (PcdOvmfSnpSecretsSize)= ;=0D + CcBlob->Reserved1 =3D 0;=0D CcBlob->CpuidPhysicalAddress =3D (UINT64)(UINTN)FixedPcdGet32 (PcdOvmf= CpuidBase);=0D CcBlob->CpuidLSize =3D FixedPcdGet32 (PcdOvmfCpuidSize);=0D + CcBlob->Reserved2 =3D 0;=0D =0D *CcBlobPtr =3D CcBlob;=0D =0D diff --git a/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h b/OvmfP= kg/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 }, \=0D }=0D =0D -typedef struct {=0D +typedef PACKED struct {=0D UINT32 Header;=0D UINT16 Version;=0D - UINT16 Reserved1;=0D + UINT16 Reserved;=0D UINT64 SecretsPhysicalAddress;=0D UINT32 SecretsSize;=0D + UINT32 Reserved1;=0D UINT64 CpuidPhysicalAddress;=0D UINT32 CpuidLSize;=0D + UINT32 Reserved2;=0D } CONFIDENTIAL_COMPUTING_SNP_BLOB_LOCATION;=0D =0D extern EFI_GUID gConfidentialComputingSevSnpBlobGuid;=0D --=20 2.25.1