Commit ba00196
iommu/vt-d: Decouple igfx_off from graphic identity mapping
A kernel command called igfx_off was introduced in commit <ba39592764ed>
("Intel IOMMU: Intel IOMMU driver"). This command allows the user to
disable the IOMMU dedicated to SOC-integrated graphic devices.
Commit <9452618e7462> ("iommu/intel: disable DMAR for g4x integrated gfx")
used this mechanism to disable the graphic-dedicated IOMMU for some
problematic devices. Later, more problematic graphic devices were added
to the list by commit <1f76249cc3beb> ("iommu/vt-d: Declare Broadwell igfx
dmar support snafu").
On the other hand, commit <19943b0e30b05> ("intel-iommu: Unify hardware
and software passthrough support") uses the identity domain for graphic
devices if CONFIG_DMAR_BROKEN_GFX_WA is selected.
+ if (iommu_pass_through)
+ iommu_identity_mapping = 1;
+#ifdef CONFIG_DMAR_BROKEN_GFX_WA
+ else
+ iommu_identity_mapping = 2;
+#endif
...
static int iommu_should_identity_map(struct pci_dev *pdev, int startup)
{
+ if (iommu_identity_mapping == 2)
+ return IS_GFX_DEVICE(pdev);
...
In the following driver evolution, CONFIG_DMAR_BROKEN_GFX_WA and
quirk_iommu_igfx() are mixed together, causing confusion in the driver's
device_def_domain_type callback. On one hand, dmar_map_gfx is used to turn
off the graphic-dedicated IOMMU as a workaround for some buggy hardware;
on the other hand, for those graphic devices, IDENTITY mapping is required
for the IOMMU core.
Commit <4b8d18c0c986> "iommu/vt-d: Remove INTEL_IOMMU_BROKEN_GFX_WA" has
removed the CONFIG_DMAR_BROKEN_GFX_WA option, so the IDENTITY_DOMAIN
requirement for graphic devices is no longer needed. Therefore, this
requirement can be removed from device_def_domain_type() and igfx_off can
be made independent.
Fixes: 4b8d18c ("iommu/vt-d: Remove INTEL_IOMMU_BROKEN_GFX_WA")
Signed-off-by: Lu Baolu <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>1 parent 886f816 commit ba00196
1 file changed
+6
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | 219 | | |
221 | 220 | | |
222 | 221 | | |
| 222 | + | |
223 | 223 | | |
224 | | - | |
225 | 224 | | |
226 | 225 | | |
227 | 226 | | |
| |||
260 | 259 | | |
261 | 260 | | |
262 | 261 | | |
263 | | - | |
| 262 | + | |
264 | 263 | | |
265 | 264 | | |
266 | 265 | | |
| |||
2211 | 2210 | | |
2212 | 2211 | | |
2213 | 2212 | | |
2214 | | - | |
2215 | | - | |
2216 | | - | |
2217 | 2213 | | |
2218 | 2214 | | |
2219 | 2215 | | |
| |||
2514 | 2510 | | |
2515 | 2511 | | |
2516 | 2512 | | |
2517 | | - | |
2518 | | - | |
2519 | | - | |
2520 | 2513 | | |
2521 | 2514 | | |
2522 | 2515 | | |
| |||
2607 | 2600 | | |
2608 | 2601 | | |
2609 | 2602 | | |
2610 | | - | |
| 2603 | + | |
2611 | 2604 | | |
2612 | 2605 | | |
2613 | 2606 | | |
| |||
4649 | 4642 | | |
4650 | 4643 | | |
4651 | 4644 | | |
4652 | | - | |
| 4645 | + | |
4653 | 4646 | | |
4654 | 4647 | | |
4655 | 4648 | | |
| |||
4730 | 4723 | | |
4731 | 4724 | | |
4732 | 4725 | | |
4733 | | - | |
4734 | | - | |
| 4726 | + | |
| 4727 | + | |
4735 | 4728 | | |
4736 | 4729 | | |
4737 | 4730 | | |
| |||
0 commit comments