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 0C6EB740053 for ; Mon, 22 Apr 2024 12:18:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=RN3iXV9CX+/d/bwxQcXshcAGWtfg6DymN/MYXx3du3s=; 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=1713788281; v=1; b=cBIALTlWNwCPnQ6I8rRN/Rm//8l7SBjjril87VUji5rVUhvT4Viju8eV6lpYHvrQ11IkDB8W Okr4zINuWIW4WYgIZWoL6AXXTQGYWBlJ25vsLi4zjatiwr+1R9FL/1WaZGRGDSFPZaiCP5a6bJL 4X5lpzC5zQngC4ogrKaODWE9n4AD+Rg/Dg8sfwvPIUPlAkn/28ndzFVG/4mdk7zFOn7RytkGjyN 8LCtrSQXhfEno7AZypZCTe2oqSJZwN6/nVCyul5pWn9AwviO3HXXYuWbdQs4QkqhhWjDFKnYMof Q4izCiV83vRKCzfkN0hCZ42T0/nmMErvYIBbkRQQiM7Lw== X-Received: by 127.0.0.2 with SMTP id UCySYY7687511xQHhxh7h63J; Mon, 22 Apr 2024 05:18:01 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.61]) by mx.groups.io with SMTP id smtpd.web11.16928.1713788280900820096 for ; Mon, 22 Apr 2024 05:18:01 -0700 X-Received: from PA7P264CA0153.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:36c::6) by SN7PR12MB6959.namprd12.prod.outlook.com (2603:10b6:806:261::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Mon, 22 Apr 2024 12:17:58 +0000 X-Received: from SN1PEPF0002BA52.namprd03.prod.outlook.com (2603:10a6:102:36c:cafe::f9) by PA7P264CA0153.outlook.office365.com (2603:10a6:102:36c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.34 via Frontend Transport; Mon, 22 Apr 2024 12:17:57 +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 SN1PEPF0002BA52.mail.protection.outlook.com (10.167.242.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.19 via Frontend Transport; Mon, 22 Apr 2024 12:17:57 +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; Mon, 22 Apr 2024 07:17:55 -0500 From: "Alexey Kardashevskiy via groups.io" To: CC: Gerd Hoffmann , Tom Lendacky , Alexey Kardashevskiy Subject: [edk2-devel] [PATCH ovmf v2 2/5] MdePkg: Add AMD SEV features to PcdConfidentialComputingGuestAttr Date: Mon, 22 Apr 2024 22:17:01 +1000 Message-ID: <20240422121704.200856-3-aik@amd.com> In-Reply-To: <20240422121704.200856-1-aik@amd.com> References: <20240422121704.200856-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: SN1PEPF0002BA52:EE_|SN7PR12MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: 402bdd64-fa03-483a-52cb-08dc62c63ed1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jvfZouZYkVugq366wPVh98FSgkMxddSBTI4plY92npuY0THObfaO1C4uF79o?= =?us-ascii?Q?FyTzENYMhGrfdUccqh1ngHkJURQFYWG4gRNkQ88HWxCc4NcPifsXBi2ghE/T?= =?us-ascii?Q?33PV35E6hzC/w/BBKC7JOr+NpSH9Lx8oIs/4W/cAzisHRFW3QddCryFyvpPl?= =?us-ascii?Q?70WjeWscWQ2AYxFQdfDypMw0RsJON38aXFe+jQyKS0iU6d1eI0qCPwUI2tum?= =?us-ascii?Q?h2Ws7pgltUWcKOZEHxd0O1Isl/XkHBFvKJKHcmK3uVf/KBO8CBTiTGfutLuq?= =?us-ascii?Q?93wJP4bNAM/3EejaQIHdFrr+3tqz82jSJmAbf8pdiCtDl22PWYKnQ+jEg938?= =?us-ascii?Q?eq816rp2P/qQ0VcSWVeS0sq6/CXQxbWYHX2QyS36zR7BqR8/duY2jXsGd3bL?= =?us-ascii?Q?L5Jmlu2nuQnfOfZrXb0/RPhnySFD1sph6BsgqU2Vj/n741YAiPrFRlYVqWg9?= =?us-ascii?Q?UrCyY+MrSCc67o/nT35ZwAOpgKrsaTsv31D52MX3S82JvCG2qVzTmt0jeeU9?= =?us-ascii?Q?BKFscucydF8erNGTAiavoiMsR1rGdTgkFWpVRcouxVO3niYc3NmGG0Wxe8x2?= =?us-ascii?Q?Cwc9Lr5HMvVXtMcHQDTi/+Iw3bpgAfZy7Ztwk5/8QDR3GqIfEjdcunYrmWw1?= =?us-ascii?Q?49KdQF9qlV34d/ZfmTzJsRO7jC/hK8ig507ZFWKoSPr6G4WsFYVuv8Zef+gm?= =?us-ascii?Q?LipU+9MiZoBrofr/PsXBvC207gbx6X73Vtfqz1K859E95y38JN4Ttm6mChd5?= =?us-ascii?Q?HNBdJBGe8FF4Nq5lJv2vRK70ju8Imwn7OjNqO//wg31KHg+xfzUHt50XD2t2?= =?us-ascii?Q?lrwtLqOdjn0N+PqKl5apsQu8zXZlNQ24NSTcQ6lkUHAnW3sKLPDDYr+Q39m3?= =?us-ascii?Q?fZfGvviBVm0baVEl3CXwzqpRi2uMYHkeh2CkkInpX4iaZ8cc7D0AQm7UvqyX?= =?us-ascii?Q?LtTC1TANfHtTdhV6cYr0qylMaR7XU5ri55yN5V5zQ3r+ljCyxfl12tfakVq+?= =?us-ascii?Q?DVgSKePrSxL+uFXhtkArTiFv/pInNdf/ODz+poznvcuRt9XoT8YA2X9zRTJB?= =?us-ascii?Q?EX95fXrUYFvyXC8w72VlznNog9xitq8sfZGgHeFb2md+gQXvqToxo8yxQdGS?= =?us-ascii?Q?FiLvtoEkxBb3N7hQyjzWfZGluKsb1ZNj8ZKyKCaJCEQEM1JklTgkUuOAKJgM?= =?us-ascii?Q?iMNd5x+mu/8xW/8g+oqJf1IOP8iBB/3V3nyn85WZe3irSE5dsSBwJ0m4SEX/?= =?us-ascii?Q?37Cf1ygD5aes9pypixIIFPO/2DYI/lFXh0q1kdIPTAn8xy24WjGr1vlwiXdI?= =?us-ascii?Q?i88bbaDdJqMe6Ama7I97rmhN1pqTm0KB+RPUfGN2WiFDo86r1voAT4hX6Swk?= =?us-ascii?Q?JMM2yebpOZKYdEgrKnxaVopiepQ1?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2024 12:17:57.6095 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 402bdd64-fa03-483a-52cb-08dc62c63ed1 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: SN1PEPF0002BA52.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6959 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: Mon, 22 Apr 2024 05:18:01 -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: qN2tM9uSO6QB385ZatNy5rx8x7686176AA= 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=cBIALTlW; 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. Signed-off-by: Alexey Kardashevskiy --- Changes: v2: * expanded features mask * added type mask --- MdePkg/Include/ConfidentialComputingGuestAttr.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/MdePkg/Include/ConfidentialComputingGuestAttr.h b/MdePkg/Inclu= de/ConfidentialComputingGuestAttr.h index 44e6df800207..5f706a8f7320 100644 --- a/MdePkg/Include/ConfidentialComputingGuestAttr.h +++ b/MdePkg/Include/ConfidentialComputingGuestAttr.h @@ -29,9 +29,21 @@ 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 CCAttrA= mdSevEs || (x) =3D=3D CCAttrAmdSevSnp) +#define CC_GUEST_IS_SEV(x) _CC_GUEST_IS_SEV((x) & CCAttrTypeMask) =20 #endif --=20 2.41.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 (#118090): https://edk2.groups.io/g/devel/message/118090 Mute This Topic: https://groups.io/mt/105668057/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-