* [PATCH] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails
@ 2026-10-23 18:50 Dheeraj Kumar Srivastava
0 siblings, 0 replies; only message in thread
From: Dheeraj Kumar Srivastava @ 2026-10-23 18:50 UTC (permalink / raw)
To: joro, suravee.suthikulpanit, vasant.hegde, will, robin.murphy,
seanjc, ashish.kalra, pbonzini, iommu, linux-kernel
Cc: Dheeraj Kumar Srivastava
iommu_snp_enable() checks that the IOMMU can support SNP and sets
amd_iommu_snp_en, then calls snp_rmptable_init() to map the RMP table.
If that call fails, CC_ATTR_HOST_SEV_SNP is cleared but amd_iommu_snp_en
is left set. Later IOMMU initialization uses amd_iommu_snp_en to
configure the IOMMU for SNP, on the assumption that RMP setup succeeded.
Clear amd_iommu_snp_en along with CC_ATTR_HOST_SEV_SNP.
Fixes: 409f45387c93 ("x86/sev: Fix broken SNP support with KVM module built-in")
Signed-off-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
---
drivers/iommu/amd/init.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 8a410d4aa370..d413b1240294 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -3445,6 +3445,7 @@ static __init void iommu_snp_enable(void)
return;
disable_snp:
+ amd_iommu_snp_en = false;
cc_platform_clear(CC_ATTR_HOST_SEV_SNP);
#endif
}
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-23 18:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 18:50 [PATCH] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Dheeraj Kumar Srivastava
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®