From: Ashish Kalra <Ashish.Kalra@amd.com>
To: <joro@8bytes.org>, <suravee.suthikulpanit@amd.com>,
<thomas.lendacky@amd.com>, <Sairaj.ArunKodilkar@amd.com>,
<Vasant.Hegde@amd.com>, <herbert@gondor.apana.org.au>
Cc: <seanjc@google.com>, <pbonzini@redhat.com>, <will@kernel.org>,
<robin.murphy@arm.com>, <john.allen@amd.com>,
<davem@davemloft.net>, <michael.roth@amd.com>,
<iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<linux-crypto@vger.kernel.org>, <kvm@vger.kernel.org>
Subject: [PATCH v4 3/4] crypto: ccp: Skip SEV and SNP INIT for kdump boot
Date: Mon, 21 Jul 2025 21:53:18 +0000 [thread overview]
Message-ID: <f42f30fc6c2d1bf2fdfc8995be86f1005a66f4fe.1753133022.git.ashish.kalra@amd.com> (raw)
In-Reply-To: <cover.1753133022.git.ashish.kalra@amd.com>
From: Ashish Kalra <ashish.kalra@amd.com>
If SNP is enabled and initialized in the previous kernel then SNP is
already initialized for kdump boot and attempting SNP INIT again
during kdump boot causes SNP INIT failure and eventually leads to
IOMMU failures.
For SEV avoid SEV INIT failure warnings during kdump boot if SEV
is enabled and initialized in the previous kernel.
Skip SNP and SEV INIT if doing kdump boot.
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
---
drivers/crypto/ccp/sev-dev.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c
index e058ba027792..c204831ca4a6 100644
--- a/drivers/crypto/ccp/sev-dev.c
+++ b/drivers/crypto/ccp/sev-dev.c
@@ -28,6 +28,7 @@
#include <linux/fs_struct.h>
#include <linux/psp.h>
#include <linux/amd-iommu.h>
+#include <linux/crash_dump.h>
#include <asm/smp.h>
#include <asm/cacheflush.h>
@@ -1345,6 +1346,13 @@ static int _sev_platform_init_locked(struct sev_platform_init_args *args)
if (!psp_master || !psp_master->sev_data)
return -ENODEV;
+ /*
+ * Skip SNP/SEV INIT for kdump boot as SEV/SNP is already initialized
+ * in previous kernel if SEV/SNP is enabled.
+ */
+ if (is_kdump_kernel())
+ return 0;
+
sev = psp_master->sev_data;
if (sev->state == SEV_STATE_INIT)
--
2.34.1
next prev parent reply other threads:[~2025-07-21 21:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 21:52 [PATCH v4 0/4] Add host kdump support for SNP Ashish Kalra
2025-07-21 21:52 ` [PATCH v4 1/4] iommu/amd: Add support to remap/unmap IOMMU buffers for kdump Ashish Kalra
2025-07-24 12:00 ` kernel test robot
2025-07-25 10:28 ` Sairaj Kodilkar
2025-07-21 21:53 ` [PATCH v4 2/4] iommu/amd: Reuse device table " Ashish Kalra
2025-07-25 10:29 ` Sairaj Kodilkar
2025-07-21 21:53 ` Ashish Kalra [this message]
2025-07-25 10:30 ` [PATCH v4 3/4] crypto: ccp: Skip SEV and SNP INIT for kdump boot Sairaj Kodilkar
2025-07-21 21:53 ` [PATCH v4 4/4] iommu/amd: Skip enabling command/event buffers for kdump Ashish Kalra
2025-07-25 10:30 ` Sairaj Kodilkar
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=f42f30fc6c2d1bf2fdfc8995be86f1005a66f4fe.1753133022.git.ashish.kalra@amd.com \
--to=ashish.kalra@amd.com \
--cc=Sairaj.ArunKodilkar@amd.com \
--cc=Vasant.Hegde@amd.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=iommu@lists.linux.dev \
--cc=john.allen@amd.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=robin.murphy@arm.com \
--cc=seanjc@google.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=thomas.lendacky@amd.com \
--cc=will@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;
as well as URLs for NNTP newsgroup(s).