From nobody Sat Apr 11 10:48:26 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 D4CA737472D; Tue, 10 Mar 2026 10:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773139627; cv=none; b=pxua9hpdT9E3lqtHZCsxMQdkbwfUkwhwejAVzaRg6qh+4Jq/XvnMbLB6ARz4XVKIOaxVUE9EtTo22oIbz65XFXzFbd2b9b/lfcePnbA+aaIm/OB61Ek+YZDcn/i7k6ZqXbF+5e9mw/TqQFMP0012pksUZCBxBUpqg1ocVP3vXzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773139627; c=relaxed/simple; bh=XJwg8U2hU6Kjn8tr0xa1pJq0L4tY1+x02+Z2htOl8IQ=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=OoVV0ZdnciPEHKU1yCof/KkCVq0e0h4a4Ay79Q2tRg15eBEQ41NwceaD8hnGokzb37lQZC1kcQnODzFOTLtex0FdfSArV3+asog0X3W2YkadAFcqEP+c2puTQ4Gg63lRB3c20gO2fhFIsJU+RWTB9r5dD0A47Ps8vvjULB8gcVE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=O/FJ4t/H; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=AfaKK9DH; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="O/FJ4t/H"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="AfaKK9DH" Date: Tue, 10 Mar 2026 10:47:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773139624; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mNC6BjRT/Zt6JJmkASNcGhG12ApOSxolUCcWuYzPSLw=; b=O/FJ4t/HXiMd7GZGTtZb+zpXtS/K6/OcWOjIos52KqG7lhhStgm8ejr9fFTVGV9gN0puLT XYZGoM0GO4nTn3drAbtdNN/ETIc1QfRg+YnTisobL7H0/ipH0u0D7gvub84IJlsBydZpB+ La6Bl23CdY7kiEbvWQTT+lxP9IbyvKoMn+fmsFjji7PCeM6NMiro0x0QTKHy4I4JZXIcT2 LEV+bYk4/bXjPRD5PjHnjRxS3KKSuDlMMKIRBUcOAau6xo+TDzwXkn0geer3jiOZQsqkXX gzupFrw1ZPKmiwf/5NzGZtyfpgqm6Kiqn/GP6SHEl6AgPWfR+5xoYpq70p75Dw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773139624; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mNC6BjRT/Zt6JJmkASNcGhG12ApOSxolUCcWuYzPSLw=; b=AfaKK9DHuL4xXKPBKAYCSk8xmrwQWEINKEPdFB285TRTNqPxEbJs3U8oQ2BBjKTYx9x+MO Rvs3ibRbBkD4AcDw== From: "tip-bot2 for Tycho Andersen (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sev] x86/virt/sev: Drop support for SNP hotplug Cc: "Tycho Andersen (AMD)" , "Borislav Petkov (AMD)" , Tom Lendacky , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260309180053.2389118-2-tycho@kernel.org> References: <20260309180053.2389118-2-tycho@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177313962304.1647592.13313396001011108501.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/sev branch of tip: Commit-ID: 959d3f7565352fab844ae73a722631c5f615427f Gitweb: https://git.kernel.org/tip/959d3f7565352fab844ae73a722631c5f= 615427f Author: Tycho Andersen (AMD) AuthorDate: Mon, 09 Mar 2026 12:00:43 -06:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 09 Mar 2026 21:48:33 +01:00 x86/virt/sev: Drop support for SNP hotplug During an SNP_INIT(_EX), the SEV firmware checks that all CPUs have the SNP syscfg bit set, and fails if they do not. As such, it does not make sense to have offline CPUs: the firmware will fail initialization because of the offlined ones that the kernel did not initialize. Further, there is a bug: during SNP_INIT(_EX) the firmware requires the MFDM syscfg bit to be set in addition to having SNP enabled, which the previous hotplug code did not do. Since k8_check_syscfg_dram_mod_en() enforces this be cleared, hotplug wouldn't work. Signed-off-by: Tycho Andersen (AMD) Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Tom Lendacky Link: https://patch.msgid.link/20260309180053.2389118-2-tycho@kernel.org --- arch/x86/virt/svm/sev.c | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c index a4f3a36..f404c60 100644 --- a/arch/x86/virt/svm/sev.c +++ b/arch/x86/virt/svm/sev.c @@ -130,33 +130,20 @@ static unsigned long snp_nr_leaked_pages; #undef pr_fmt #define pr_fmt(fmt) "SEV-SNP: " fmt =20 -static int __mfd_enable(unsigned int cpu) +static __init void mfd_enable(void *arg) { - u64 val; - if (!cc_platform_has(CC_ATTR_HOST_SEV_SNP)) - return 0; - - rdmsrq(MSR_AMD64_SYSCFG, val); - - val |=3D MSR_AMD64_SYSCFG_MFDM; - - wrmsrq(MSR_AMD64_SYSCFG, val); + return; =20 - return 0; + msr_set_bit(MSR_AMD64_SYSCFG, MSR_AMD64_SYSCFG_MFDM_BIT); } =20 -static __init void mfd_enable(void *arg) -{ - __mfd_enable(smp_processor_id()); -} - -static int __snp_enable(unsigned int cpu) +static __init void snp_enable(void *arg) { u64 val; =20 if (!cc_platform_has(CC_ATTR_HOST_SEV_SNP)) - return 0; + return; =20 rdmsrq(MSR_AMD64_SYSCFG, val); =20 @@ -164,13 +151,6 @@ static int __snp_enable(unsigned int cpu) val |=3D MSR_AMD64_SYSCFG_SNP_VMPL_EN; =20 wrmsrq(MSR_AMD64_SYSCFG, val); - - return 0; -} - -static __init void snp_enable(void *arg) -{ - __snp_enable(smp_processor_id()); } =20 static void __init __snp_fixup_e820_tables(u64 pa) @@ -553,8 +533,6 @@ int __init snp_rmptable_init(void) on_each_cpu(snp_enable, NULL, 1); =20 skip_enable: - cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/rmptable_init:online", __snp_= enable, NULL); - /* * Setting crash_kexec_post_notifiers to 'true' to ensure that SNP panic * notifier is invoked to do SNP IOMMU shutdown before kdump.