Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iommu/amd: Report SEV-TIO support

The SEV-TIO switch in the AMD BIOS is reported to the OS via
the IOMMU Extended Feature 2 register (EFR2), bit 1.

Add helper to parse the bit and report the feature presence.

Signed-off-by: Alexey Kardashevskiy <aik@amd.com>
Link: https://patch.msgid.link/20251202024449.542361-4-aik@amd.com
Acked-by: Joerg Roedel <joerg.roedel@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

authored by

Alexey Kardashevskiy and committed by
Dan Williams
eeb93413 c3859de8

+12
+1
drivers/iommu/amd/amd_iommu_types.h
··· 107 107 108 108 109 109 /* Extended Feature 2 Bits */ 110 + #define FEATURE_SEVSNPIO_SUP BIT_ULL(1) 110 111 #define FEATURE_SNPAVICSUP GENMASK_ULL(7, 5) 111 112 #define FEATURE_SNPAVICSUP_GAM(x) \ 112 113 (FIELD_GET(FEATURE_SNPAVICSUP, x) == 0x1)
+9
drivers/iommu/amd/init.c
··· 2252 2252 if (check_feature(FEATURE_SNP)) 2253 2253 pr_cont(" SNP"); 2254 2254 2255 + if (check_feature2(FEATURE_SEVSNPIO_SUP)) 2256 + pr_cont(" SEV-TIO"); 2257 + 2255 2258 pr_cont("\n"); 2256 2259 } 2257 2260 ··· 4018 4015 return 0; 4019 4016 } 4020 4017 EXPORT_SYMBOL_GPL(amd_iommu_snp_disable); 4018 + 4019 + bool amd_iommu_sev_tio_supported(void) 4020 + { 4021 + return check_feature2(FEATURE_SEVSNPIO_SUP); 4022 + } 4023 + EXPORT_SYMBOL_GPL(amd_iommu_sev_tio_supported); 4021 4024 #endif
+2
include/linux/amd-iommu.h
··· 18 18 struct pci_dev; 19 19 20 20 extern void amd_iommu_detect(void); 21 + extern bool amd_iommu_sev_tio_supported(void); 21 22 22 23 #else /* CONFIG_AMD_IOMMU */ 23 24 24 25 static inline void amd_iommu_detect(void) { } 26 + static inline bool amd_iommu_sev_tio_supported(void) { return false; } 25 27 26 28 #endif /* CONFIG_AMD_IOMMU */ 27 29