From nobody Thu Apr 2 06:15:11 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 1ABAF3BFE38; Mon, 30 Mar 2026 10:46:01 +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=1774867563; cv=none; b=ok1xRT/LGdVMQ3gk+IXAUqZr32ulJZNZFBLyaepuS0IZK8a570BJkvkSeu62cByV5ko0h+VL8GXOC6Ng5Z0LgEwOqrBW+b//DSIbCaskXkqRezQ8Wy8+xQqRWyBzE9w55PrNIORsMiBVnXXFpdk/j0qMLDnsKcKj4/CP6GUP5So= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774867563; c=relaxed/simple; bh=TjWnm54t/FG8mihpIck89upZca+//CRfoNY6lgGWzAc=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=iRrLFDpfvi4asd8HMKIUjfRTGHhTzZ8ZOOGtyhAw4aDsNf1hMEUkV+cYg+ediOyfgpcXtt7/scYvHFiHRjjcPbV5jzwGPLaiyD2dHRI+2f+kSny2gZ6TBHYJhrlhksB1nTbwimpN6cAkx03YVAftxoIiZO6Hnu0u3iBvHLckAfw= 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=j4zyrYj9; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Q/eQ9Hds; 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="j4zyrYj9"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Q/eQ9Hds" Date: Mon, 30 Mar 2026 10:45:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774867560; 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=U2M8kToeTjCr/o+urJoGZLe2NRzct7Fdgjk8G8xLzkM=; b=j4zyrYj9TJqq3OFyO6cnG5Mtq3Es8Q1D8QUlBUmK5JSRId3z1drXSWD6BMEOFuaMK1Gf9e ub7jSidEoyZxBArZfTATTZHSdEjXF5+/xnGYf1+PeV+9PvfDlRwWYOhGRIdYKfuwCaYiRr kSIceaVr/IPJDdSyA9Dy2NvgVYb0DNTSqdqp/5qoXzNE7k9zkt2B1Wh0jDYaaKjWvjz7Eo NySPv1SX+qs85zHTtZ9bGkT1rnQomAWhxGBDzAuG1kiR6HLEwHSe7U8VCgfoLMb4PFZMpf rUcX9p7i+RNhxVv5KPl1/Q/IlbXlONQzj3dTCo9A/TNwVZPyiMJbNGsJObF3xQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774867560; 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=U2M8kToeTjCr/o+urJoGZLe2NRzct7Fdgjk8G8xLzkM=; b=Q/eQ9HdsbX6rn/0u3pq05UpESxAiyP1Qw49we0t9aHz8Z1TR921x9Z5tBNtZWIoxSBn1QT uWVO8k8p5pcbkJAg== 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/sev, crypto/ccp: Move SNP init to ccp driver Cc: "Tycho Andersen (AMD)" , "Borislav Petkov (AMD)" , Tom Lendacky , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260324161301.1353976-5-tycho@kernel.org> References: <20260324161301.1353976-5-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: <177486755928.1647592.4712691439659578256.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: 299933b118d1bcf8b93d58076aed34582718b0dd Gitweb: https://git.kernel.org/tip/299933b118d1bcf8b93d58076aed34582= 718b0dd Author: Tycho Andersen (AMD) AuthorDate: Tue, 24 Mar 2026 10:12:58 -06:00 Committer: Borislav Petkov (AMD) CommitterDate: Sun, 29 Mar 2026 12:32:09 +02:00 x86/sev, crypto/ccp: Move SNP init to ccp driver Use the new snp_prepare() to initialize SNP from the ccp driver instead of = at boot time. This means that SNP is not enabled unless it is really going to = be used (i.e. kvm_amd loads the ccp driver automatically). Signed-off-by: Tycho Andersen (AMD) Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Tom Lendacky Link: https://patch.msgid.link/20260324161301.1353976-5-tycho@kernel.org --- arch/x86/virt/svm/sev.c | 2 -- drivers/crypto/ccp/sev-dev.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c index 3b2273d..423fe77 100644 --- a/arch/x86/virt/svm/sev.c +++ b/arch/x86/virt/svm/sev.c @@ -562,8 +562,6 @@ int __init snp_rmptable_init(void) if (!setup_rmptable()) return -ENOSYS; =20 - snp_prepare(); - /* * Setting crash_kexec_post_notifiers to 'true' to ensure that SNP panic * notifier is invoked to do SNP IOMMU shutdown before kdump. diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c index 8b2dfc1..024eab2 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -1373,6 +1373,8 @@ static int __sev_snp_init_locked(int *error, unsigned= int max_snp_asid) return -EOPNOTSUPP; } =20 + snp_prepare(); + /* SNP_INIT requires MSR_VM_HSAVE_PA to be cleared on all CPUs. */ on_each_cpu(snp_set_hsave_pa, NULL, 1); =20