iommu/amd: Enable Guest Translation after reading IOMMU feature register
Subsystems (2)
Vasant Hegde
maintainerPATCH 1/1 iommu/amd: Enable Guest Translation after reading IOMMU feature register
Commit 8e0179733172 ("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.
--- drivers/iommu/amd/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/amd/init.c +2 -2
@@ -2046,6 +2046,8 @@ static int __init iommu_init_pci(struct amd_iommu *iommu) amd_iommu_max_glx_val = glxval; else amd_iommu_max_glx_val =min (amd_iommu_max_glx_val, glxval); + +iommu_enable_gt (iommu); }if (check_feature (FEATURE_PPR ) &&amd_iommu_alloc_ppr_log (iommu))
@@ -2732,7 +2734,6 @@ static void early_enable_iommu(struct amd_iommu *iommu)iommu_enable_command_buffer (iommu);iommu_enable_event_buffer (iommu);iommu_set_exclusion_range (iommu); -iommu_enable_gt (iommu);iommu_enable_ga (iommu);iommu_enable_xt (iommu);iommu_enable_irtcachedis (iommu);
@@ -2789,7 +2790,6 @@ static void early_enable_iommus(void)iommu_disable_irtcachedis (iommu);iommu_enable_command_buffer (iommu);iommu_enable_event_buffer (iommu); -iommu_enable_gt (iommu);iommu_enable_ga (iommu);iommu_enable_xt (iommu);iommu_enable_irtcachedis (iommu);
Signature · 1 line
2.31.1
Joerg Roedel
maintainerQuoted 11 lines · Vasant Hegde
Commit
8e0179733172("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.
Quoted 8 lines
Fixes 8e0179733172 ("iommu/amd: Enable Guest Translation before registering devices")Reported-by Klara Modin <[email protected]>Signed-off-by Vasant Hegde <[email protected]>Tested-by Klara Modin <[email protected]>--- drivers/iommu/amd/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Wow, that was quick. Applied now, thanks!