From nobody Sat Apr 5 00:33:47 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1738971335; cv=pass; d=zohomail.com; s=zohoarc; b=DSLbg+Kk5SZ1eEXwpfWAeq+wsdPFDaKGgWSRdC2ZOOT0fBb8FfTJ/g8v853R3jZNzaplaBM+4kGRFZFv6NHOrvm0f9PgVQhwX47YyQ09rX8nTXixfbCB3ti6oNdCpEyAOveAVMqMIy3O+xJ4Vl8+EFrBVzS13Oe6n58n2ltJA/s= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738971335; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z0xS9rd3QNnBYpqjhQA/EMaz5sY+O/1DMgGIdd9YymA=; b=ZieUK4rCqCRUT1xo8btoigrOuXX/2B6gvKoGVvIP/Fk7u7O1lJeARfW+925FHdekYd34Euvz8idA6yX65HNXgex1ewK1LxWdlBGdt9jjQPlEMKx3gzGphzcp8ZXs3bCoFOa2Ekr28GvwWV0YhL7eRmpSwRltI6Zrwtl5Spi1hmQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1738971335600943.8456118179116; Fri, 7 Feb 2025 15:35:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tgXry-0005bR-Gf; Fri, 07 Feb 2025 18:34:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tgXrv-0005b9-Vm for qemu-devel@nongnu.org; Fri, 07 Feb 2025 18:34:44 -0500 Received: from mail-mw2nam04on2061e.outbound.protection.outlook.com ([2a01:111:f403:240a::61e] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tgXrs-0005pq-Up for qemu-devel@nongnu.org; Fri, 07 Feb 2025 18:34:42 -0500 Received: from BN9PR03CA0361.namprd03.prod.outlook.com (2603:10b6:408:f7::6) by MN0PR12MB6030.namprd12.prod.outlook.com (2603:10b6:208:3ce::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8422.10; Fri, 7 Feb 2025 23:34:35 +0000 Received: from BL02EPF0001A0FD.namprd03.prod.outlook.com (2603:10b6:408:f7:cafe::14) by BN9PR03CA0361.outlook.office365.com (2603:10b6:408:f7::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8398.31 via Frontend Transport; Fri, 7 Feb 2025 23:34:35 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0001A0FD.mail.protection.outlook.com (10.167.242.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8398.14 via Frontend Transport; Fri, 7 Feb 2025 23:34:35 +0000 Received: from zweier.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.39; Fri, 7 Feb 2025 17:34:34 -0600 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XMMLyCg+nWuw8BeAE/XHh2JDgAH2RFpNPJTGT0zCdg5kT5D9MwuQ5oyRFepbaxQ8jlLeY2rvlDTq7X4WASpb599obmLvUSYCHO0OKbpvuXiWU8qrzjF/3hv/NYPLy3ZUR1F/mlPRonhoZu0VKKpq6ENO/2D0T9HGbmlcVPd9SkCfBT08hQaJdAcBIDynC8xM9ZVhNG/VernICiJYgh0Ihou8egXQSbPhdeH2hFJScCasFHmG7RjDIJe3qKewZLmiGA6R1nquIZ341iN/sidSbYg4TgKm38JJ8LoRUKKovdY+P7y8SPPZh1kfHXwWFRiUYuBgPQGztHWpsu42kGgN3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Z0xS9rd3QNnBYpqjhQA/EMaz5sY+O/1DMgGIdd9YymA=; b=F1CDsrPjk2uxH4WrvGLk5p/5iXpuI1FCDiAcfZHzBSdl26Ave7ksi1VSkPqAFvvWjeKHLHXfIf7sPIPBdGa5X/6ijjKw9t3dNaT6SNRcPgUEDJh4ros39dloIqzYJpOYMtK43kuNjZ+V7Ah4GZxJEq4AE0AaQmBsWg337i3aElKz0Xh7ndNyB/rOwTinST7fnf/HjlgvgRjAbpz4TZ34D6mf4+Ot573WpwlFnC6AMpKT3Kxy+sB82STTrd1q717kKxr9u2s+J4or4njjNF7uD94sJzuP0QSih9JmeYSBKibkP6O08RVrgUtgqUFqcPkIftSopXf0XQOZZGIw9SCyzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org 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 (0) 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=Z0xS9rd3QNnBYpqjhQA/EMaz5sY+O/1DMgGIdd9YymA=; b=fSG3hPvob94QpYfjk0HuUMvKlVeCEvEffqly6H2UFwM8JY9U19M4Gp/caTyOXVsBIc6QAQrTL1oVJ1lKNOlF1ACYeJsNDpNT87PPomi5K0vctqMFh+A3zi3h5Qxp/5YEGWRXFsNI3RRAKxE8spPWYTGQJIV4JzfVf3xAWR2JFoI= 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 gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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 From: Kim Phillips To: , CC: Tom Lendacky , Michael Roth , Ashish Kalra , "Nikunj A . Dadhania" , Borislav Petkov , Dave Hansen , Sean Christopherson , "Paolo Bonzini" , Kishon Vijay Abraham I , "Kim Phillips" Subject: [PATCH v3 1/2] x86/cpufeatures: Add "Allowed SEV Features" Feature Date: Fri, 7 Feb 2025 17:34:08 -0600 Message-ID: <20250207233410.130813-2-kim.phillips@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250207233410.130813-1-kim.phillips@amd.com> References: <20250207233410.130813-1-kim.phillips@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: BL02EPF0001A0FD:EE_|MN0PR12MB6030:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f26e1c3-2d3b-4414-610b-08dd47cffb5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?XFE3d0BMgl+n001RhznZpUWbE1VLyICSu8SfEXqqGjAOtPqP8mHjHhG9talf?= =?us-ascii?Q?Uhfw/FOyXVULH9JQOZOalhQ9s5Ds8K5RHHIIxr7vZzkxugl/8sFJxPo67Ibh?= =?us-ascii?Q?O5K1W5QL5fP+tOc3jkvwAmaNsQgfgWifsRqtPbTEFy2EqEoZlbctyCca0r+Y?= =?us-ascii?Q?eKUVMtrsY6EMVt2wiCQV1iAuqHWxg+JYMJjpFZNhns9TQg1zAxbxK1eo3q2/?= =?us-ascii?Q?BQ9TVZKbLjjMei+GRkQU+D6ubeTAtqdN4VJN/kg418xdh6zTtZqqBAlS4HGU?= =?us-ascii?Q?Yjkak7KhN1E9oF38NDH3KRb2Q5AXlUvrMUHV4dbgHqm38r2oJelT/Fe24r5G?= =?us-ascii?Q?DHYepLw3DN3b3Zq5tCpbsX7QDSlhVkoABKsxZjFvgIKZSy8FDxQHVt7P8lQ2?= =?us-ascii?Q?vgwFnD356WENZxeIzASb2Uwet717bgIvgEGcw9Qj4/eLchXatRf4+n1VlYMY?= =?us-ascii?Q?hK0I8ZJUIAqmlPmYIEc39SyrwMunXRPIFjwT8C8TE6C8MucFM7l1q/C/12Ti?= =?us-ascii?Q?IX0O8IrmnE61p1Zt83PF6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chzy8s/?= =?us-ascii?Q?XojywIF2nbExpLJd6HY1DcXtVLjFcpuMf6tCfzJJdxFdaxF7gnvHkifCouwH?= =?us-ascii?Q?l6+q1H77XWQvhhU=3D?= 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:(13230040)(82310400026)(1800799024)(36860700013)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2025 23:34:35.6856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f26e1c3-2d3b-4414-610b-08dd47cffb5d 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: BL02EPF0001A0FD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6030 Received-SPF: permerror client-ip=2a01:111:f403:240a::61e; envelope-from=kim.phillips@amd.com; helo=NAM04-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1738971337883019000 Content-Type: text/plain; charset="utf-8" From: Kishon Vijay Abraham I Add CPU feature detection for "Allowed SEV Features" to allow the Hypervisor to enforce that SEV-ES and SEV-SNP guest VMs cannot enable features (via SEV_FEATURES) that the Hypervisor does not support or wish to be enabled. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Kim Phillips Reviewed-by: Tom Lendacky --- arch/x86/include/asm/cpufeatures.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpuf= eatures.h index 508c0dad116b..a80a4164d110 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -453,6 +453,7 @@ #define X86_FEATURE_DEBUG_SWAP (19*32+14) /* "debug_swap" SEV-ES full deb= ug state swap support */ #define X86_FEATURE_RMPREAD (19*32+21) /* RMPREAD instruction */ #define X86_FEATURE_SEGMENTED_RMP (19*32+23) /* Segmented RMP support */ +#define X86_FEATURE_ALLOWED_SEV_FEATURES (19*32+27) /* Allowed SEV Feature= s */ #define X86_FEATURE_SVSM (19*32+28) /* "svsm" SVSM present */ #define X86_FEATURE_HV_INUSE_WR_ALLOWED (19*32+30) /* Allow Write to in-us= e hypervisor-owned pages */ =20 --=20 2.43.0