diff options
| author | Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com> | 2026-11-05 16:32:16 +0000 |
|---|---|---|
| committer | Joerg Roedel <joerg.roedel@amd.com> | 2026-11-06 13:22:43 +0100 |
| commit | ec91bb159dc24eefe144ef8867937f4a055dd0e2 (patch) | |
| tree | 00787bab9a3345387259654cdbf6fa0645cc3dfb | |
| parent | b32ecac779bba6e7ac7caeae8c40db4280941634 (diff) | |
iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails
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>
Reviewed-by: Ankit Soni <Ankit.Soni@amd.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| -rw-r--r-- | drivers/iommu/amd/init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index 0cb9aeb0597b..78c7079dec9d 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -3514,6 +3514,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 } |
