From nobody Thu Dec 26 13:30:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101246+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1678917544308705.3531723598542; Wed, 15 Mar 2023 14:59:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id wEYDYY1788612xUEvh5D2J4N; Wed, 15 Mar 2023 14:59:03 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.50]) by mx.groups.io with SMTP id smtpd.web10.6879.1678917543315207006 for ; Wed, 15 Mar 2023 14:59:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M5RzF1syscCK+AcNm1jjG20ZWxsz9w4L5QrN31nAy0Ta5Hft+JU7OViDjDUGQ187lZoxrbefHT3DrgDECDP0xLtb3a8ALdmsRbMH3Ne/zyh+FVc1Yxck6Uf70E/AGS0S8CHG2PkTY6q+EF91ygiwSKTocyZt3BZfOoFmLZ4XXjG9hJV8hOeKGE3qHiKB5dTnRf0f4y58a73sbVVm5TIX569LTySOIn1CIVuORwsLiVZatVxkfHQSqCx3EQUgfYx7+h3aZBz9WBvGUnpr3Cli0vSYImIdqPaC2qPtMhfazQ4tZTqNa0+BXl1UM/SPZXLHctFfvX0z7h85b9wWFPmPLQ== 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=JtE+1dhxJaPKoWokZik5EUGKZzr+Fo7KqbMY0khrBaY=; b=mgiiK+T+ArZ7msKnuE+cob2TsJBP5R3T7ktP3ihjL3k1nyzi4WxIH7ACFn4sBu3q7zwcyJ4pRhJCeVj1sMZ9g22k769qaJoZi1le+CL9xl/eU/WGkz5S+Udz4nAVoXgaeGhE8b/g8rZbCq7y5O7gHieK/kQTZlCL5Dddc2jTwva3LEkJ8eMNMNY2bHRJqPCb4EedGppPOO/45o8LQSKpe4dVRAcuKpdLjx1Q0QPPzvL/KT5E6PVEdP3ULXz44xbh0nPUfUcXW4a2Z0ZE5dyOlxaPfuCTEWP3JgerEBfQNnS+w70abq2vttrT1asa3r19BFusaQ3J3qGk74q4inK9NQ== 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 X-Received: from MW4PR04CA0287.namprd04.prod.outlook.com (2603:10b6:303:89::22) by PH8PR12MB6772.namprd12.prod.outlook.com (2603:10b6:510:1c7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Wed, 15 Mar 2023 21:59:01 +0000 X-Received: from CO1NAM11FT098.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::e9) by MW4PR04CA0287.outlook.office365.com (2603:10b6:303:89::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26 via Frontend Transport; Wed, 15 Mar 2023 21:59:01 +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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+101246+1787277+3901457@groups.io; helo=mail02.groups.io; 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 X-Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT098.mail.protection.outlook.com (10.13.174.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6199.16 via Frontend Transport; Wed, 15 Mar 2023 21:59:00 +0000 X-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; Wed, 15 Mar 2023 16:58:59 -0500 From: "Roth, Michael via groups.io" To: CC: Tom Lendacky , Jiewen Yao , , Gerd Hoffmann , Erdem Aktas , James Bottomley , Min Xu Subject: [edk2-devel] [PATCH RESEND 2/4] OvmfPkg/AmdSevDxe: Update ConfidentialComputing blob struct definition Date: Wed, 15 Mar 2023 16:57:45 -0500 Message-ID: <20230315215747.1543837-3-michael.roth@amd.com> In-Reply-To: <20230315215747.1543837-1-michael.roth@amd.com> References: <20230315215747.1543837-1-michael.roth@amd.com> MIME-Version: 1.0 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: CO1NAM11FT098:EE_|PH8PR12MB6772:EE_ X-MS-Office365-Filtering-Correlation-Id: 26a39ca3-6b62-4749-7af0-08db25a07c21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: +uzSS9fmEaxPBUesJ5/lSc7McJqOR4hIUqMKG/UBtfBY6tTTDey4J+ZC81QEvCrbroBjSjs0EdOuSV7czYqJc/J+bRkxB0OO7ZsxZS8zoQNPplaXiQEovigprZw1yAg3/FlecFiejVPtftokzZXNdBvyJaqp3uCWuTNtJAJoWYgJ/fF6hTyeeJ58w0Sfesq/G1h2JBv1oZZtIvVCyH2hByJTX91c9CP4zqsOi1vYfnh40vja9R7uO9T7/dK/lRc+eXfuBmmJFtCPzSEUSZerBVABfS4C6bgcNJtyKAleftp8OUmkX33JDU6UbcKSfUwbVGpEVpO75Dgi4+cucLESN9lF2XqTJS/nN+IACTi7hS7EKJIX6Upy0hiqOuwpKaAJmOuc0xqiN+BZCQEz9J/I5yLB91UQpKklI9eJdDhLWfD8CDRAu9Khs6N2v+nat2jwGqAZ4fBny1qjbmwom1ITDR1nI1uxyY912iXaZPY4NCAulm3t7ylqiY1QG64/c13WpA1NzYUhHIB7SrbAQKP3B5dnoni7bZHhsttDtsOL4jrFE1bIAxcN8+yOpvOq+2Zkd3Cu3hJFDFwhaEl9o/ShxMOpQo9A5dRZJNsi3o6scoKRyVMY2UdJGnXG4WUC+bQBDDuMZz6VEgVMkc/kBIK0PaiMpeb+GVuuCLQ2RwrhkP34aca2F6lGrtvAmW5sp5vKKoC1a76uRhF+/uAWhKzbOF6eHJHNp42tc62NzcBetr0= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2023 21:59:00.7183 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 26a39ca3-6b62-4749-7af0-08db25a07c21 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: CO1NAM11FT098.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6772 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,Michael.Roth@amd.com X-Gm-Message-State: ogxVls9XuVbHVDv2aMXhR6VSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678917543; bh=JjQtibEKw5+ROZ+79GQclQ7BYjvNSJhUUXy/sg1a60c=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=d0isnlS2+wzyAW5MHOh55tKbpABAb57A6dA7c/D4Md0QgezVID17Z/19eNh7B2pVdAJ c3ZdSy1YiM3zm33775ChV6YasqlAIyo4XBvvbwXyzf99F5ItZ5jjdsakck+KmiZXnE6Px Aor13rPy30SqCNvHQ2L6zyE/EVOGAy8ZaA8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678917546026100002 Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Michael Roth Acked-by: Gerd Hoffmann --- 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 7250cc90e5..cf074f2c89 100644 --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c @@ -48,11 +48,13 @@ AllocateConfidentialComputingBlob ( =20 CcBlob->Header =3D SIGNATURE_32 ('A', 'M', 'D', 'E'); CcBlob->Version =3D 1; - CcBlob->Reserved1 =3D 0; + CcBlob->Reserved =3D 0; CcBlob->SecretsPhysicalAddress =3D (UINT64)(UINTN)FixedPcdGet32 (PcdOvmf= SnpSecretsBase); CcBlob->SecretsSize =3D FixedPcdGet32 (PcdOvmfSnpSecretsSize); + CcBlob->Reserved1 =3D 0; CcBlob->CpuidPhysicalAddress =3D (UINT64)(UINTN)FixedPcdGet32 (PcdOvmf= CpuidBase); CcBlob->CpuidLSize =3D FixedPcdGet32 (PcdOvmfCpuidSize); + CcBlob->Reserved2 =3D 0; =20 *CcBlobPtr =3D CcBlob; =20 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 }, \ } =20 -typedef struct { +typedef PACKED struct { UINT32 Header; UINT16 Version; - UINT16 Reserved1; + UINT16 Reserved; UINT64 SecretsPhysicalAddress; UINT32 SecretsSize; + UINT32 Reserved1; UINT64 CpuidPhysicalAddress; UINT32 CpuidLSize; + UINT32 Reserved2; } CONFIDENTIAL_COMPUTING_SNP_BLOB_LOCATION; =20 extern EFI_GUID gConfidentialComputingSevSnpBlobGuid; --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#101246): https://edk2.groups.io/g/devel/message/101246 Mute This Topic: https://groups.io/mt/97638497/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-