Skip to content

Commit de111f6

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Enable Guest Translation after reading IOMMU feature register
Commit 8e01797 ("iommu/amd: Enable Guest Translation before registering devices") moved IOMMU Guest Translation (GT) enablement to early init path. It does feature check based on Global EFR value (got from ACPI IVRS table). Later it adjusts EFR value based on IOMMU feature register (late_iommu_features_init()). It seems in some systems BIOS doesn't set gloabl EFR value properly. This is causing mismatch. Hence move IOMMU GT enablement after late_iommu_features_init() so that it does check based on IOMMU EFR value. Fixes: 8e01797 ("iommu/amd: Enable Guest Translation before registering devices") Reported-by: Klara Modin <klarasmodin@gmail.com> Closes: https://lore.kernel.org/linux-iommu/333e6eb6-361c-4afb-8107-2573324bf689@gmail.com/ Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Tested-by: Klara Modin <klarasmodin@gmail.com> Link: https://lore.kernel.org/r/20240506082039.7575-1-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent bbe1e78 commit de111f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iommu/amd/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,6 +2046,8 @@ static int __init iommu_init_pci(struct amd_iommu *iommu)
20462046
amd_iommu_max_glx_val = glxval;
20472047
else
20482048
amd_iommu_max_glx_val = min(amd_iommu_max_glx_val, glxval);
2049+
2050+
iommu_enable_gt(iommu);
20492051
}
20502052

20512053
if (check_feature(FEATURE_PPR) && amd_iommu_alloc_ppr_log(iommu))
@@ -2732,7 +2734,6 @@ static void early_enable_iommu(struct amd_iommu *iommu)
27322734
iommu_enable_command_buffer(iommu);
27332735
iommu_enable_event_buffer(iommu);
27342736
iommu_set_exclusion_range(iommu);
2735-
iommu_enable_gt(iommu);
27362737
iommu_enable_ga(iommu);
27372738
iommu_enable_xt(iommu);
27382739
iommu_enable_irtcachedis(iommu);
@@ -2789,7 +2790,6 @@ static void early_enable_iommus(void)
27892790
iommu_disable_irtcachedis(iommu);
27902791
iommu_enable_command_buffer(iommu);
27912792
iommu_enable_event_buffer(iommu);
2792-
iommu_enable_gt(iommu);
27932793
iommu_enable_ga(iommu);
27942794
iommu_enable_xt(iommu);
27952795
iommu_enable_irtcachedis(iommu);

0 commit comments

Comments
 (0)