From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3ABD07803CE for ; Thu, 2 May 2024 14:35:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=vRnUL7D9ki2VcGrhRAldMPyL9Es0VPFZKA9y0poV3L0=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1714660544; v=1; b=qwIhGafcVxq14cjyAjYAL4e4cur7x9hLwAb8+PqdMelY7c7mWIfu8WB89STAtDsdRXKaZU9f AjiOMPF2bYhdtm1QVcTQiQFep+kXSor+4pZ41hJnq0Ls8Mym8yQOWahqBqi3XubxwkhL9Ml3qkJ pNYm53ciRoK1xqxGcy/uZZ3F9tADUwbS4ypOFRT3ZJxx19k7bPpIDjeE3Wx3y0Rs/qAOQkJK4tG 6uxTd1IU7kQNxG80ARDZIANO8C2ELsY3+1WJXJ8xD4waAgQzYjEvhWV8t6Ibcm7o5xJrf2AyGgH sqVtXycY3f3fiG11XOuvS9P7AS4rBLn3zJyJImAmsKmpg== X-Received: by 127.0.0.2 with SMTP id ocwOYY7687511x2o9cdVGrIW; Thu, 02 May 2024 07:35:44 -0700 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.89]) by mx.groups.io with SMTP id smtpd.web11.15231.1714660544045362542 for ; Thu, 02 May 2024 07:35:44 -0700 X-Received: from BLAPR03CA0059.namprd03.prod.outlook.com (2603:10b6:208:32d::34) by LV8PR12MB9333.namprd12.prod.outlook.com (2603:10b6:408:1fa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Thu, 2 May 2024 14:35:41 +0000 X-Received: from MN1PEPF0000F0E1.namprd04.prod.outlook.com (2603:10b6:208:32d:cafe::91) by BLAPR03CA0059.outlook.office365.com (2603:10b6:208:32d::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.30 via Frontend Transport; Thu, 2 May 2024 14:35:41 +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 X-Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000F0E1.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Thu, 2 May 2024 14:35:41 +0000 X-Received: from aiemdee.amd.com (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.2507.35; Thu, 2 May 2024 09:35:38 -0500 From: "Alexey Kardashevskiy via groups.io" To: CC: Tom Lendacky , Liming Gao , Michael D Kinney , Zhiguang Liu , Ard Biesheuvel , Erdem Aktas , "Gerd Hoffmann" , Jiewen Yao , Michael Roth , Min Xu , Alexey Kardashevskiy Subject: [edk2-devel] [PATCH ovmf v3 2/5] MdePkg: Add AMD SEV features to PcdConfidentialComputingGuestAttr Date: Fri, 3 May 2024 00:34:42 +1000 Message-ID: <20240502143445.526098-3-aik@amd.com> In-Reply-To: <20240502143445.526098-1-aik@amd.com> References: <20240502143445.526098-1-aik@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: MN1PEPF0000F0E1:EE_|LV8PR12MB9333:EE_ X-MS-Office365-Filtering-Correlation-Id: 61c93685-e988-406f-0b6a-08dc6ab524c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?le94yBGUVPWNFyjNbYGGU2t3hKxYW/GQB8oKliFaDQapJogvLcE/xmgFqgIh?= =?us-ascii?Q?E9M7I4Q30/vIdjpFq/9+Ksno89YgLmiUN4AwloL6Hf9xwkcMo3rZOjnBX52f?= =?us-ascii?Q?SZ70BuTGhpH4rwtOgY+g4HTtpkQOnrIbhbaDEdN9s+g5QwK6z9z7jo/HjNQq?= =?us-ascii?Q?B+olw33BPN25dnT3ZuwW14YSO/6bTmdXHa+uhSyN30PRK0qHXJEYyBBipdBi?= =?us-ascii?Q?GVqySGcxKY+7y3I5Fj52j6CUFTNaQ60Rnhrv9feMo+lvAy71oAXi+rRilosi?= =?us-ascii?Q?+VCfijF6JK7w/GX9mUGlpM2DP3ikBYhtK00XQeQ0uquYl6d38xkQbBA2dOAT?= =?us-ascii?Q?62Nk9VULGcbHYBand/NXQN5g9ycCqhZD1Ro1g0gwV/gBViTU4VggdqSKKsDc?= =?us-ascii?Q?iMH27FSW2UW+uTDxSj01hoWNr5PbmWFTcoI1WOCVoMPyXfQV9BM4QZ09cZ6E?= =?us-ascii?Q?21tIpNBv3olNHI+Khlf7/d9qn/ORBki241xXAFBbz2vXwskO7aiiz+qy8kjM?= =?us-ascii?Q?vMtaPvAqGeGkywWWAjZvp1zTjgCNwMYmO7IoAPifBLFZjbSw/5/OkAHjFdIe?= =?us-ascii?Q?6cRGKB7O4R2tM3ZX2+V47dykNtFYCCtBKzmcwaak6iiXE3TZV07mfWoExQt7?= =?us-ascii?Q?/mdkFvIo8+zjwxBH+u9ayqUb0ws5jLZSNI8UYk+KowrUGFlIunvfjGhRmheb?= =?us-ascii?Q?DLEQX0QuXFrN/9IOTta+gmH2tMqVeOzRHWTCQbsEm9jbxNmEEbRSawhMtPht?= =?us-ascii?Q?XQI+XUdbRfeT5I1tHm6WMwC3gsZHuRO7oiE8PwT2vAgB1fVF1IZt0QAU5XTD?= =?us-ascii?Q?NiAcQdFn7B9sCshu+J66C7EFA4x/XaGtpf2FwMXQ8OSp8WVjFr/UsVLBTX/E?= =?us-ascii?Q?Mmth56mHOuNarKZxNQRXZLGrr1qmdmzLd/YqlSht6TMqb+lSr1LFmcXJiomd?= =?us-ascii?Q?UDv0RxNAqv0K0IJet3MyPKkd3HOQjeXNIx5umHY0HZnkyJd+z0/til86JSPi?= =?us-ascii?Q?mECqKNAk53sUIio15q3GF2K4Iro5Q4ocTi1PJZupFteeMVUXvIZh/q8Jk3WN?= =?us-ascii?Q?BsMk4SINNTZJPWxhhyRYfH+FeAIK+LsraiIS/lerWTefu1AzRUP2ZatiDZW1?= =?us-ascii?Q?DLlt1DFMTMowdePR94bGWkD//J8dp1ImpibT3aajWnU4t2tda5jqXvL+nH0B?= =?us-ascii?Q?uY9kDHjR7eapcIZKRwxD2qDCfEKRxs1lH3Pyp3T+MdaVBIvKBFI1QXoMpJhQ?= =?us-ascii?Q?iurr9BZeyx4VZyBaKMrQnBs2R9rWBI7tqhlwYNWLRCN5dF1x6wstYzMJANUT?= =?us-ascii?Q?k7e/FTtRME3SycgLc7A7LXIBznRn6sGdc6hqbTYcqlJkd1rGiReppaQ+23hw?= =?us-ascii?Q?jWxpDQSfv+nyhcHL9cln9le4YKED?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2024 14:35:41.6138 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61c93685-e988-406f-0b6a-08dc6ab524c8 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: MN1PEPF0000F0E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9333 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 02 May 2024 07:35:44 -0700 Resent-From: aik@amd.com Reply-To: devel@edk2.groups.io,aik@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: llz5b8nkjfYzuuiCpIIL5a7wx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=qwIhGafc; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io PcdConfidentialComputingGuestAttr so far only contained an SEV mode bit but there are more other features which do not translate to levels such as DebugSwap or SecureTsc. This adds the features mask and the DebugSwap feature bit to a PCD. Cc: Liming Gao Cc: Michael D Kinney Cc: Zhiguang Liu Cc: Tom Lendacky Signed-off-by: Alexey Kardashevskiy --- Changes: v2: * expanded features mask * added type mask --- MdePkg/Include/ConfidentialComputingGuestAttr.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/MdePkg/Include/ConfidentialComputingGuestAttr.h b/MdePkg/Inclu= de/ConfidentialComputingGuestAttr.h index 44e6df800207..c3a3dfb393f0 100644 --- a/MdePkg/Include/ConfidentialComputingGuestAttr.h +++ b/MdePkg/Include/ConfidentialComputingGuestAttr.h @@ -29,9 +29,20 @@ typedef enum { =20 /* The guest is running with Intel TDX memory encryption enabled. */ CCAttrIntelTdx =3D 0x200, + + CCAttrTypeMask =3D 0x000000000000ffff, + + /* Features */ + + /* The AMD SEV-ES DebugSwap feature is enabled in SEV_STATUS */ + CCAttrFeatureAmdSevDebugSwap =3D 0x0000000000010000, + + CCAttrFeatureMask =3D 0xffffffffffff0000, } CONFIDENTIAL_COMPUTING_GUEST_ATTR; =20 -#define CC_GUEST_IS_TDX(x) ((x) =3D=3D CCAttrIntelTdx) -#define CC_GUEST_IS_SEV(x) ((x) =3D=3D CCAttrAmdSev || (x) =3D=3D CCAttrA= mdSevEs || (x) =3D=3D CCAttrAmdSevSnp) +#define _CC_GUEST_IS_TDX(x) ((x) =3D=3D CCAttrIntelTdx) +#define CC_GUEST_IS_TDX(x) _CC_GUEST_IS_TDX((x) & CCAttrTypeMask) +#define _CC_GUEST_IS_SEV(x) ((x) =3D=3D CCAttrAmdSev || (x) =3D=3D CCAttr= AmdSevEs || (x) =3D=3D CCAttrAmdSevSnp) +#define CC_GUEST_IS_SEV(x) _CC_GUEST_IS_SEV((x) & CCAttrTypeMask) =20 #endif --=20 2.44.0 -=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 (#118515): https://edk2.groups.io/g/devel/message/118515 Mute This Topic: https://groups.io/mt/105863820/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-