Commit cf1ec453 authored by Lu Baolu's avatar Lu Baolu Committed by Joerg Roedel

iommu/vt-d: Set intel_iommu_gfx_mapped correctly

The intel_iommu_gfx_mapped flag is exported by the Intel
IOMMU driver to indicate whether an IOMMU is used for the
graphic device. In a virtualized IOMMU environment (e.g.
QEMU), an include-all IOMMU is used for graphic device.
This flag is found to be clear even the IOMMU is used.

Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Reported-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
Fixes: c0771df8 ("intel-iommu: Export a flag indicating that the IOMMU is used for iGFX.")
Suggested-by: default avatarKevin Tian <kevin.tian@intel.com>
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 095303e0
...@@ -4053,9 +4053,7 @@ static void __init init_no_remapping_devices(void) ...@@ -4053,9 +4053,7 @@ static void __init init_no_remapping_devices(void)
/* This IOMMU has *only* gfx devices. Either bypass it or /* This IOMMU has *only* gfx devices. Either bypass it or
set the gfx_mapped flag, as appropriate */ set the gfx_mapped flag, as appropriate */
if (dmar_map_gfx) { if (!dmar_map_gfx) {
intel_iommu_gfx_mapped = 1;
} else {
drhd->ignored = 1; drhd->ignored = 1;
for_each_active_dev_scope(drhd->devices, for_each_active_dev_scope(drhd->devices,
drhd->devices_cnt, i, dev) drhd->devices_cnt, i, dev)
...@@ -4894,6 +4892,9 @@ int __init intel_iommu_init(void) ...@@ -4894,6 +4892,9 @@ int __init intel_iommu_init(void)
goto out_free_reserved_range; goto out_free_reserved_range;
} }
if (dmar_map_gfx)
intel_iommu_gfx_mapped = 1;
init_no_remapping_devices(); init_no_remapping_devices();
ret = init_dmars(); ret = init_dmars();
......
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