From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from BL0PR03CU003.outbound.protection.outlook.com (mail-eastusazon11012061.outbound.protection.outlook.com [52.101.53.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19FCA36493F for ; Thu, 30 Jul 2026 01:50:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.53.61 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785376245; cv=fail; b=tGQ4WDPy+9uA5IBcB8DPsE+MLRCOnEMcIx4U3nxAEdqvQq+qa3qb9xg5URuluH1hkgGAoMKMNFEYzKdJ++pXarXE9xeZNwuBCs1WS3k/M8TnUNTnmtSfFKisAxtEl/MU89L8oSdmGF5gXet6bo5inA2hA2ygMM/h8u7lppQ/yBE= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785376245; c=relaxed/simple; bh=m/BoSxwE8MI5LEIiFjHBSbKy4hTNg30TC+7jInhSFD4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RT0TYrgDsyPCD5r/Hi0lu2nXmYwr5DSmGe0HkL9c5T/6CufoF9pz9zWcZBRq3+qXI0J/9bSqC6AbN+tkGDmDHeqGHmHv0qvnyCRNSXFyILWpiaVhMasZNHkNQ1oDzuYwClWY/NPh7EAXkQ+BfHvfn2Py/jv6fOH6Lf6ilepufjY= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=muRmcvBs; arc=fail smtp.client-ip=52.101.53.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="muRmcvBs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fRg015LCNCp6JHZBvpSMCuHLj5DhRyp4j74SJwOK7PWeIZaKiquuK0YOQQ+wLhKda3RYh8eF74aaNvLYH7AlBfedsuWEtu8SgTpkadiBjlg/BGu2z1XYdCphVKS4px4ei7/MTY18j2uj/IOpllrljUPXvK+rz0sQp6AP9z86D617Itgimv3GQG1KPfK0bjDs4Lm/7wW+QvzQZd1y11Xun1bnn7nw1Z7ZUOwLPXHaf0PqYxi6iiQAD3o8u2aXsJ6jf/2XpOnQfhj89TwyEwF4SqsQFUrSiRYFQ2ZQcGbOoYpICV8BAFnLz8YsuRYHHlJdzlJAF4Nwaxp5triEgCJg1g== 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=MtCOUXQU3QjwTFef10GC4o+jh/0BjHR2c2RsCzSfGn8=; b=pD0O1NE1Jz0Z8tdlWb6qAyTWJ6TMVUn2NQnL07BNl4KnF2Sl35Wcl9B0CGpvgbbi9XtJ0BDWWwXxdeHwWQFIk8Z2opsdofTnsM2ld2I51KUiHsiLdq/MxQUwSS2Nqo5kR3yT3WdXERNe8PzbW6geQlDLCZiyn+IagyyEfscu43/4goc2zoTOuSiJV/8fx3ofp2nledjDxk7i/8UWNW4qE/3+hJO3FPLeYyRo4tUkRmFTz+K/UH3tyJlO3lMa5bFghn2uxkXIyyZUjlv8LGKV45r3t1izGJ9sjZEpZrOk69/7IjmQbcJrPHcblmZIqIM8iPyrIjIavahkdlKpixAzRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.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=MtCOUXQU3QjwTFef10GC4o+jh/0BjHR2c2RsCzSfGn8=; b=muRmcvBs9NT45J5Ce31W9ABsdy70ez8XxrK5YknL90gnjFBZPUc11Wet6iFuJKYefjuxWyhrS1iue1fz+nUr4SKiOEw6mxnmlQtYwatwLlQI8pYbbabjFLA96YL7SwdmUFLv8hnicuDIDF9eDrJ7ktB4tZdSEP7zV7NEXrYj+/c= Received: from CH2PR17CA0010.namprd17.prod.outlook.com (2603:10b6:610:53::20) by IA1PR12MB6258.namprd12.prod.outlook.com (2603:10b6:208:3e6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.13; Thu, 30 Jul 2026 01:50:39 +0000 Received: from CH2PEPF0000013B.namprd02.prod.outlook.com (2603:10b6:610:53:cafe::7c) by CH2PR17CA0010.outlook.office365.com (2603:10b6:610:53::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.13 via Frontend Transport; Thu, 30 Jul 2026 01:50:39 +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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CH2PEPF0000013B.mail.protection.outlook.com (10.167.244.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.292.8 via Frontend Transport; Thu, 30 Jul 2026 01:50:39 +0000 Received: from purico-9dcchost.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 29 Jul 2026 20:50:38 -0500 From: Melody Wang To: CC: LKML , Tom Lendacky , Melody Wang Subject: [PATCH 7/7] x86/sev: Indicate that Alternate Injection is supported in the guest Date: Thu, 30 Jul 2026 01:48:47 +0000 Message-ID: <9929c0d7f856962d4052729ce267872fd8731612.1785375271.git.huibo.wang@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013B:EE_|IA1PR12MB6258:EE_ X-MS-Office365-Filtering-Correlation-Id: c5d2ff04-5b70-4010-17ae-08deeddcf502 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|23010399003|36860700016|56012099006|11063799006|10067099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: J0HT58sqarFUOlCMjBpB55bKyFrWE35/EcAkwRzDQu11ninx8mR62PXTOItAC6f/c28Aequ7esucxgrDNcUGYBGlJTBDcVqoHkpWm3/hXcyQFesDIQ3Cl993u1cZzPs62ys40xpoB9SHlrtthoYiK6s/i7/LIPle2TwY8lUnx0Mmc2nY0OjJrig+vp+KzdEn30r7YDZqF50QOUEVxgFAqKG1z10AoUejbKsRe0r2qLLUkAkuyZ6M5mavFBwqnztB4NT9y5ysJ8i9njc8Dao32UfSI4JAfgHXNC2+ILahvtx5QLeTI0y93y1+iIccekwIEpDNf7QHWeCM/JCErB4OgXSiwVkMeAb1ZwschUZG7w+FIiqEXx3HIKsmQcxw8eOYbtmU3OKR2wkdeXIiSPgH9Fik1PKWb5A3bWntjm6wxIYgIgCeQaB2no1dTA/EUaWXVa+TO0SrzJ6Mga2LcxhJloKIDifGUoU0mBe3gCQWDO1agtJZt/yI+l6LLbdrx8GV0IF/o3as4M0an7n0zP5Xt5yiT8OhuchVAzbzMB+RIeEsrZIqhi5ml0tHyMtdJxcZGtiVKWnMlQBQfZ1DvWVuX7qfTNEo3+UcYy/ebUCJkitp90MttV9z4MaF+LaiKAPF269RoKmI6wQoQvPrNzZlrt0Xqo+refEyffK1y7j2z3YmBgo/ofrbO9orNRLP6t2VimYqKUjvh/Pt3y/Lgj0Evw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(23010399003)(36860700016)(56012099006)(11063799006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xLbvZfzzaLWxiKI6lQ6HG34wXlWVqGftIHKXg115OYxebpvoQlme9ic8D7k4ctdVk2IMFmGka1ccBicED7Shc7ivIwU3E5Q0aqgkRpDAA5p45pEsVK7tN+hsVQ+6677GKLsxeyUbfOZtwMAvjhCCrUzNBkhM9YUQj8YcrHbaNWc08GguBUECG96nwyOKotN+NFau4Z3hJTsvQXwLY6bOWAXYCx792IafvhuRP4uPsFWn0P67aMdW2MiJ2HR8TJrNoI1gqcm/AK30WNpb+gFPXMcshR8daI13HmvBF975R9kE+Ow0dlYgYm5JZ2D2deNxIMtYt6Yx7Evd3td85L8BtFZ7klrsmk5tjtIbR6qaZhAAyhbZWbA2ksBP2WS7DbjVpDUAbHCVL1v8s680vc0uOqP2A7bU6RALDbh8aTXkAD0/bJ5+0r0XwemcGSVNwO5q X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 01:50:39.1782 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5d2ff04-5b70-4010-17ae-08deeddcf502 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000013B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6258 Now the Alternate Injection support is complete, add it to the present SNP features. Signed-off-by: Melody Wang --- arch/x86/boot/compressed/sev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c index a98185b3869a..21731527fa49 100644 --- a/arch/x86/boot/compressed/sev.c +++ b/arch/x86/boot/compressed/sev.c @@ -197,6 +197,12 @@ bool sev_es_check_ghcb_fault(unsigned long address) #define SNP_FEATURE_SECURE_AVIC 0 #endif +#ifdef CONFIG_AMD_ALTERNATE_INJ +#define SNP_FEATURE_ALTERNATE_INJ MSR_AMD64_SNP_ALTERNATE_INJ +#else +#define SNP_FEATURE_ALTERNATE_INJ 0 +#endif + /* * SNP_FEATURES_IMPL is the mask of SNP features that are implemented * by the guest kernel. As and when a new feature is implemented in the @@ -204,7 +210,8 @@ bool sev_es_check_ghcb_fault(unsigned long address) */ #define SNP_FEATURES_IMPL (MSR_AMD64_SNP_DEBUG_SWAP | \ MSR_AMD64_SNP_SECURE_TSC | \ - SNP_FEATURE_SECURE_AVIC) + SNP_FEATURE_SECURE_AVIC | \ + SNP_FEATURE_ALTERNATE_INJ) u64 snp_get_unsupported_features(u64 status) { -- 2.43.0