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 42653940F8D for ; Wed, 5 Jun 2024 02:11:54 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HWu6zXkMVi5K3l9v0ecSJi7KfcTdKy9/YzPJIvOpbKc=; 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=1717553513; v=1; b=DBrT5ENZ13pLs8ojLB4kloaXhnUprJuBjhBzKoWYMSgbzkih39J6bF2gvVmHe6DAxOmsmYMr cCy6CyZB3gN1gbGyg16i6f5++LwHyXFxMI7WE9jFKaBkd2DHpwfdzgtybeywY/K5OMwcAjJHrWj 5RiPJZ3Cc+sfYyVYFWhE7rAXPIVoFrpYUwdpZtNVB/zUxE9811QZ+4FZY7k5J/6KUj52Hpo/DiM ziBePU/43vcAcR08QI/Jq8UnxGkVjJs+Sl40+gUXX+ddqRO3WjgBCH4WV5+CKfw87E1ubyVk3IK 8eS4GVybry3+v9xK/UPKR2d5dU07A8SWmsSethpLfvBgw== X-Received: by 127.0.0.2 with SMTP id tjgDYY7687511xWoGhEFFzvS; Tue, 04 Jun 2024 19:11:52 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.45]) by mx.groups.io with SMTP id smtpd.web10.5286.1717553511891608418 for ; Tue, 04 Jun 2024 19:11:52 -0700 X-Received: from BL1PR13CA0263.namprd13.prod.outlook.com (2603:10b6:208:2ba::28) by CH2PR12MB4136.namprd12.prod.outlook.com (2603:10b6:610:a4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Wed, 5 Jun 2024 02:11:49 +0000 X-Received: from BL6PEPF00020E65.namprd04.prod.outlook.com (2603:10b6:208:2ba:cafe::84) by BL1PR13CA0263.outlook.office365.com (2603:10b6:208:2ba::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.16 via Frontend Transport; Wed, 5 Jun 2024 02:11:49 +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 BL6PEPF00020E65.mail.protection.outlook.com (10.167.249.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Wed, 5 Jun 2024 02:11:49 +0000 X-Received: from aiemdee.2.ozlabs.ru (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; Tue, 4 Jun 2024 21:11:00 -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 v4 2/5] MdePkg: Add AMD SEV features to PcdConfidentialComputingGuestAttr Date: Wed, 5 Jun 2024 12:09:43 +1000 Message-ID: <20240605020946.1224515-3-aik@amd.com> In-Reply-To: <20240605020946.1224515-1-aik@amd.com> References: <20240605020946.1224515-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: BL6PEPF00020E65:EE_|CH2PR12MB4136:EE_ X-MS-Office365-Filtering-Correlation-Id: 67e42250-1f38-426d-12ac-08dc8504dba8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qJaXJ6uNW2wIDgRCu5cwkLKHHfA64AnSC1r07fU02OBgIFMjd/OJGrDlyX18?= =?us-ascii?Q?p+CiaZJGHOtWh8oBLWRtvvuwsE9eUzRMwtehi2jErv4CKYCE5CEXqPbP1d7A?= =?us-ascii?Q?xTkmIZd/4G7do8c92vsql2ur2GGFqZJKuoo6Y280Thehxe3h2QUPISFAKcL2?= =?us-ascii?Q?923j+tX4EKkqlpVChShvFIRoczo2keUuCRbWiunrjfTqrkXeEajpbhzUCRwL?= =?us-ascii?Q?CZJFdwPo6nYxB6rvA8auBKdm7ED+srLIcaLPA458/mCR8XY55Lfme0Wh10Xc?= =?us-ascii?Q?KeiJqr8Z3x82kJsC3cED3mlDir9q/mSiXx1ccMhbtxGb2SnZx56bKbXZAp1O?= =?us-ascii?Q?yTDLBN9Pg8GjpfdAvjHsk2ojIyEYh3kXkHrSDf/m9neBfg6s4crC1QLDguSK?= =?us-ascii?Q?rnfXBazzwJanN+peMxa0tpbZSIwX/nG+cIOn9amDeQQKwt+K1hs1tfcRObwa?= =?us-ascii?Q?n7pNwN9qHPe/WSMbbH4WYjII110NqvT6xsmV9GHoh1nlDfpVNXB7illJO4Ci?= =?us-ascii?Q?2hmywLue7+08+0yj4VyRsrtm3Y0Kg8yY0Rgv1wCJg2X5pTAlgP1oZCrf6K0c?= =?us-ascii?Q?OXrSoNhgSMWVcmc8x+HLlUDBumnPh5QC2YJqubSHxIV72TJbU/sobzUuDkKV?= =?us-ascii?Q?q5cSTnWVdiNm+cZLSFTEwFoVXh7Bfix9Z/xHe3t7ZUlwHoQZGu73P2vVE9X5?= =?us-ascii?Q?4+pc15IpL8Pmd02S8S+MefeG9Xko3rShQGJOhT9o2c6+Vtb/+TJd92CHc+JE?= =?us-ascii?Q?aUq5s1RmLa6d/oYZYaz6kl1XZNG7g1AEccXaKys/8htVdQITvy7YV7DAsxdg?= =?us-ascii?Q?necylV05KCfp+exsNHCwL8DlIHpqLWtNqBsf7Yq3n3LeGwB7QN7ui6P9zVnr?= =?us-ascii?Q?z/PLBjtdiK0TQ5oAueHuhfE8dI1+5VGl3G8ah4BphGsCTClsrGSXiU+P/6Hs?= =?us-ascii?Q?kiz9HoMTQ7WJO1KKIKtn5gWo3B6LTbvAf2wfcKqsO2v/mrMjW04xzVKs4GxO?= =?us-ascii?Q?IZspe6lB4WlScGMkJGqkx678+Vz/O1Nx3gwqSNcBLM7zg0e9VRE/tvw5REMZ?= =?us-ascii?Q?2WMpfyGG/3dTA+8MZ4k5gn1uFACojZ63uXblSR3UI6FQf42gGftA4riK7Iym?= =?us-ascii?Q?gVTFWyEK8gVYSzANEi06kUAyG4RueQuxH4iDk1cQj8XGJ6akMYBdBd5CzRGs?= =?us-ascii?Q?j7iLNZsk09HrPJXJxrBu4vQ1sttGBVkgrV/8D+YlNm+RAv2cDG5+5kF9bNfc?= =?us-ascii?Q?fZkUkVQ4zcI9IBT5SR+ot8zbExEu2hIKxPUWaX2brDxoo3BQQxjCg0k0BAAT?= =?us-ascii?Q?mICzyhED8gmrJHlx15/ZjJQIByq1yQRZGAbT7ECirFWDBvpwbimaDQVliXW7?= =?us-ascii?Q?LTMZrarH/qTiEiv0S3/qmozvr1IV?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 02:11:49.0575 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67e42250-1f38-426d-12ac-08dc8504dba8 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: BL6PEPF00020E65.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4136 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: Tue, 04 Jun 2024 19:11:52 -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: LdQhWDFY8WU4cvPX11ShWj62x7686176AA= 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=DBrT5ENZ; 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 DebugVirtualization or SecureTsc. Add the feature mask and the DebugVirtualization feature bit to the PCD. Cc: Liming Gao Cc: Michael D Kinney Cc: Zhiguang Liu Reviewed-by: Tom Lendacky Signed-off-by: Alexey Kardashevskiy --- Changes: v4: * s/CCAttrFeatureAmdSevDebugSwap/CCAttrFeatureAmdSevEsDebugVirtualization/ 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..f62158f77e03 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 DebugVirtualization feature is enabled in SEV_STATUS *= / + CCAttrFeatureAmdSevEsDebugVirtualization =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 (#119460): https://edk2.groups.io/g/devel/message/119460 Mute This Topic: https://groups.io/mt/106496083/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-