mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails
@ 2026-10-23 18:50 Dheeraj Kumar Srivastava
  2026-10-27 16:31 ` Ankit Soni
  2026-11-02 14:59 ` Vasant Hegde
  0 siblings, 2 replies; 3+ messages 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] 3+ messages in thread

* Re: [PATCH] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails
  2026-10-23 18:50 [PATCH] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Dheeraj Kumar Srivastava
@ 2026-10-27 16:31 ` Ankit Soni
  2026-11-02 14:59 ` Vasant Hegde
  1 sibling, 0 replies; 3+ messages in thread
From: Ankit Soni @ 2026-10-27 16:31 UTC (permalink / raw)
  To: Dheeraj Kumar Srivastava
  Cc: joro, suravee.suthikulpanit, vasant.hegde, will, robin.murphy,
	seanjc, ashish.kalra, pbonzini, iommu, linux-kernel

On Sat, Oct 24, 2026 at 12:20:41AM +0530, Dheeraj Kumar Srivastava wrote:
> 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")

Reviewed-by: Ankit Soni <Ankit.Soni@amd.com>

> 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] 3+ messages in thread

* Re: [PATCH] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails
  2026-10-23 18:50 [PATCH] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Dheeraj Kumar Srivastava
  2026-10-27 16:31 ` Ankit Soni
@ 2026-11-02 14:59 ` Vasant Hegde
  1 sibling, 0 replies; 3+ messages in thread
From: Vasant Hegde @ 2026-11-02 14:59 UTC (permalink / raw)
  To: Dheeraj Kumar Srivastava, joro, suravee.suthikulpanit, will,
	robin.murphy, seanjc, ashish.kalra, pbonzini, iommu,
	linux-kernel



On 10/24/2026 12:20 AM, Dheeraj Kumar Srivastava wrote:
> 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>

Thanks. Queued for rc.

-Vasant


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-02 14:59 UTC | newest]

Thread overview: 3+ messages (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
2026-10-27 16:31 ` Ankit Soni
2026-11-02 14:59 ` Vasant Hegde

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®