From: "tip-bot2 for Tycho Andersen (AMD)" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Tycho Andersen (AMD)" <tycho@kernel.org>,
"Borislav Petkov (AMD)" <bp@alien8.de>,
Tom Lendacky <thomas.lendacky@amd.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/sev] x86/virt/sev: Drop support for SNP hotplug
Date: Tue, 10 Mar 2026 10:47:03 -0000 [thread overview]
Message-ID: <177313962304.1647592.13313396001011108501.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260309180053.2389118-2-tycho@kernel.org>
The following commit has been merged into the x86/sev branch of tip:
Commit-ID: 959d3f7565352fab844ae73a722631c5f615427f
Gitweb: https://git.kernel.org/tip/959d3f7565352fab844ae73a722631c5f615427f
Author: Tycho Andersen (AMD) <tycho@kernel.org>
AuthorDate: Mon, 09 Mar 2026 12:00:43 -06:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
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) <tycho@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
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
-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 |= MSR_AMD64_SYSCFG_MFDM;
-
- wrmsrq(MSR_AMD64_SYSCFG, val);
+ return;
- return 0;
+ msr_set_bit(MSR_AMD64_SYSCFG, MSR_AMD64_SYSCFG_MFDM_BIT);
}
-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;
if (!cc_platform_has(CC_ATTR_HOST_SEV_SNP))
- return 0;
+ return;
rdmsrq(MSR_AMD64_SYSCFG, val);
@@ -164,13 +151,6 @@ static int __snp_enable(unsigned int cpu)
val |= MSR_AMD64_SYSCFG_SNP_VMPL_EN;
wrmsrq(MSR_AMD64_SYSCFG, val);
-
- return 0;
-}
-
-static __init void snp_enable(void *arg)
-{
- __snp_enable(smp_processor_id());
}
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);
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.
next prev parent reply other threads:[~2026-03-10 10:47 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 19:13 [PATCH 00/11] Move SEV-SNP initialization to ccp driver Tycho Andersen
2026-03-02 19:13 ` [PATCH 01/11] x86/snp: drop support for SNP hotplug Tycho Andersen
2026-03-02 19:56 ` Tom Lendacky
2026-03-05 12:57 ` Borislav Petkov
2026-03-06 15:38 ` Borislav Petkov
2026-03-09 18:00 ` [PATCH v2 00/10] Move SNP initialization to the CCP driver Tycho Andersen
2026-03-09 18:00 ` [PATCH v2 01/10] x86/snp: drop support for SNP hotplug Tycho Andersen
2026-03-10 10:47 ` tip-bot2 for Tycho Andersen (AMD) [this message]
2026-03-09 18:00 ` [PATCH v2 02/10] x86/snp: drop WBINVD before setting SNPEn Tycho Andersen
2026-03-10 10:47 ` [tip: x86/sev] x86/virt/sev: Drop WBINVD before setting MSR_AMD64_SYSCFG_SNP_EN tip-bot2 for Tycho Andersen (AMD)
2026-03-09 18:00 ` [PATCH v2 03/10] x86/snp: Keep the RMP table bookkeeping area mapped Tycho Andersen
2026-03-10 10:47 ` [tip: x86/sev] x86/virt/sev: " tip-bot2 for Tom Lendacky
2026-03-09 18:00 ` [PATCH v2 04/10] x86/snp: Create a function to clear/zero the RMP Tycho Andersen
2026-03-13 16:17 ` Borislav Petkov
2026-03-09 18:00 ` [PATCH v2 05/10] x86/snp: create snp_prepare_for_snp_init() Tycho Andersen
2026-03-09 18:00 ` [PATCH v2 06/10] x86/snp, crypto: move SNP init to ccp driver Tycho Andersen
2026-03-09 18:00 ` [PATCH v2 07/10] x86/snp, crypto: move HSAVE_PA setup to arch/ Tycho Andersen
2026-03-09 18:00 ` [PATCH v2 08/10] x86/snp: create snp_x86_shutdown() Tycho Andersen
2026-03-09 18:00 ` [PATCH v2 09/10] crypto: ccp - implement SNP x86 shutdown Tycho Andersen
2026-03-09 18:00 ` [PATCH v2 10/10] crypto: ccp - Update HV_FIXED page states to allow freeing of memory Tycho Andersen
2026-03-02 19:13 ` [PATCH 02/11] x86/snp: Keep the RMP table bookkeeping area mapped Tycho Andersen
2026-03-06 15:55 ` Borislav Petkov
2026-03-02 19:13 ` [PATCH 03/11] x86/snp: Create a function to clear/zero the RMP Tycho Andersen
2026-03-02 19:13 ` [PATCH 04/11] x86/snp: drop WBINVD before setting SNPEn Tycho Andersen
2026-03-02 20:00 ` Tom Lendacky
2026-03-02 19:13 ` [PATCH 05/11] x86/snp: create snp_prepare_for_snp_init() Tycho Andersen
2026-03-02 20:03 ` Tom Lendacky
2026-03-02 19:13 ` [PATCH 06/11] x86/snp, crypto: move SNP init to ccp driver Tycho Andersen
2026-03-02 20:25 ` Tom Lendacky
2026-03-02 19:13 ` [PATCH 07/11] x86/snp, crypto: move HSAVE_PA setup to arch/ Tycho Andersen
2026-03-02 20:27 ` Tom Lendacky
2026-03-02 19:13 ` [PATCH 08/11] x86/snp: allow disabling MFDM Tycho Andersen
2026-03-02 20:29 ` Tom Lendacky
2026-03-02 19:13 ` [PATCH 09/11] x86/snp: create snp_x86_shutdown() Tycho Andersen
2026-03-02 20:35 ` Tom Lendacky
2026-03-02 21:20 ` Tycho Andersen
2026-03-02 19:13 ` [PATCH 10/11] crypto: ccp - implement SNP x86 shutdown Tycho Andersen
2026-03-02 20:47 ` Tom Lendacky
2026-03-02 19:13 ` [PATCH 11/11] crypto: ccp - Update HV_FIXED page states to allow freeing of memory Tycho Andersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=177313962304.1647592.13313396001011108501.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=thomas.lendacky@amd.com \
--cc=tycho@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®