]>
Commit | Line | Data |
---|---|---|
bb104d9e SL |
1 | From 1e77f44c4825fc69ed0782e3e1351fa723354399 Mon Sep 17 00:00:00 2001 |
2 | From: Lu Baolu <baolu.lu@linux.intel.com> | |
3 | Date: Thu, 2 May 2019 09:34:25 +0800 | |
4 | Subject: iommu/vt-d: Set intel_iommu_gfx_mapped correctly | |
5 | ||
6 | [ Upstream commit cf1ec4539a50bdfe688caad4615ca47646884316 ] | |
7 | ||
8 | The intel_iommu_gfx_mapped flag is exported by the Intel | |
9 | IOMMU driver to indicate whether an IOMMU is used for the | |
10 | graphic device. In a virtualized IOMMU environment (e.g. | |
11 | QEMU), an include-all IOMMU is used for graphic device. | |
12 | This flag is found to be clear even the IOMMU is used. | |
13 | ||
14 | Cc: Ashok Raj <ashok.raj@intel.com> | |
15 | Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> | |
16 | Cc: Kevin Tian <kevin.tian@intel.com> | |
17 | Reported-by: Zhenyu Wang <zhenyuw@linux.intel.com> | |
18 | Fixes: c0771df8d5297 ("intel-iommu: Export a flag indicating that the IOMMU is used for iGFX.") | |
19 | Suggested-by: Kevin Tian <kevin.tian@intel.com> | |
20 | Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> | |
21 | Signed-off-by: Joerg Roedel <jroedel@suse.de> | |
22 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
23 | --- | |
24 | drivers/iommu/intel-iommu.c | 7 ++++--- | |
25 | 1 file changed, 4 insertions(+), 3 deletions(-) | |
26 | ||
27 | diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c | |
28 | index 28feb1744710..25cc6ae87039 100644 | |
29 | --- a/drivers/iommu/intel-iommu.c | |
30 | +++ b/drivers/iommu/intel-iommu.c | |
31 | @@ -4119,9 +4119,7 @@ static void __init init_no_remapping_devices(void) | |
32 | ||
33 | /* This IOMMU has *only* gfx devices. Either bypass it or | |
34 | set the gfx_mapped flag, as appropriate */ | |
35 | - if (dmar_map_gfx) { | |
36 | - intel_iommu_gfx_mapped = 1; | |
37 | - } else { | |
38 | + if (!dmar_map_gfx) { | |
39 | drhd->ignored = 1; | |
40 | for_each_active_dev_scope(drhd->devices, | |
41 | drhd->devices_cnt, i, dev) | |
42 | @@ -4870,6 +4868,9 @@ int __init intel_iommu_init(void) | |
43 | goto out_free_reserved_range; | |
44 | } | |
45 | ||
46 | + if (dmar_map_gfx) | |
47 | + intel_iommu_gfx_mapped = 1; | |
48 | + | |
49 | init_no_remapping_devices(); | |
50 | ||
51 | ret = init_dmars(); | |
52 | -- | |
53 | 2.20.1 | |
54 |