Commit 7a6a3a08 authored by Joerg Roedel's avatar Joerg Roedel

amd-iommu: handle alias entries correctly in init code

An alias entry in the ACPI table means that the device can send requests to the
IOMMU with both device ids, its own and the alias. This is not handled properly
in the ACPI init code. This patch fixes the issue.
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent 6a047d8b
...@@ -691,6 +691,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, ...@@ -691,6 +691,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
devid = e->devid; devid = e->devid;
devid_to = e->ext >> 8; devid_to = e->ext >> 8;
set_dev_entry_from_acpi(iommu, devid , e->flags, 0);
set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0); set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0);
amd_iommu_alias_table[devid] = devid_to; amd_iommu_alias_table[devid] = devid_to;
break; break;
...@@ -749,10 +750,12 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, ...@@ -749,10 +750,12 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
devid = e->devid; devid = e->devid;
for (dev_i = devid_start; dev_i <= devid; ++dev_i) { for (dev_i = devid_start; dev_i <= devid; ++dev_i) {
if (alias) if (alias) {
amd_iommu_alias_table[dev_i] = devid_to; amd_iommu_alias_table[dev_i] = devid_to;
set_dev_entry_from_acpi(iommu, set_dev_entry_from_acpi(iommu,
amd_iommu_alias_table[dev_i], devid_to, flags, ext_flags);
}
set_dev_entry_from_acpi(iommu, dev_i,
flags, ext_flags); flags, ext_flags);
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment