]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu/amd: Check EFR[EPHSup] bit before enabling PPR
authorVasant Hegde <vasant.hegde@amd.com>
Thu, 30 May 2024 07:11:18 +0000 (07:11 +0000)
committerJoerg Roedel <jroedel@suse.de>
Tue, 4 Jun 2024 11:59:52 +0000 (13:59 +0200)
Check for EFR[EPHSup] bit before enabling PPR. This bit must be set
to enable PPR.

Reported-by: Borislav Petkov <bp@alien8.de>
Fixes: c4cb23111103 ("iommu/amd: Add support for enable/disable IOPF")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218900
Tested-by: Borislav Petkov <bp@alien8.de>
Tested-by: Jean-Christophe Guillain <jean-christophe@guillain.net>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20240530071118.10297-1-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu.h

index 2fde1302a5843ce5610731855998c9bc60039940..2d5945c982bde5077674eb5ec8a35f6493e37761 100644 (file)
@@ -129,7 +129,8 @@ static inline int check_feature_gpt_level(void)
 static inline bool amd_iommu_gt_ppr_supported(void)
 {
        return (check_feature(FEATURE_GT) &&
-               check_feature(FEATURE_PPR));
+               check_feature(FEATURE_PPR) &&
+               check_feature(FEATURE_EPHSUP));
 }
 
 static inline u64 iommu_virt_to_phys(void *vaddr)