View | Details | Raw Unified | Return to bug 206571
Collapse All | Expand All

(-)a/drivers/iommu/intel/dmar.c (+1 lines)
Lines 1102-1107 static int alloc_iommu(struct dmar_drhd_unit *drhd) Link Here
1102
	}
1102
	}
1103
1103
1104
	drhd->iommu = iommu;
1104
	drhd->iommu = iommu;
1105
	iommu->drhd = drhd;
1105
1106
1106
	return 0;
1107
	return 0;
1107
1108
(-)a/drivers/iommu/intel/iommu.c (+26 lines)
Lines 356-361 static int intel_iommu_strict; Link Here
356
static int intel_iommu_superpage = 1;
356
static int intel_iommu_superpage = 1;
357
static int iommu_identity_mapping;
357
static int iommu_identity_mapping;
358
static int intel_no_bounce;
358
static int intel_no_bounce;
359
static int iommu_skip_te_disable;
359
360
360
#define IDENTMAP_GFX		2
361
#define IDENTMAP_GFX		2
361
#define IDENTMAP_AZALIA		4
362
#define IDENTMAP_AZALIA		4
Lines 1633-1638 static void iommu_disable_translation(struct intel_iommu *iommu) Link Here
1633
	u32 sts;
1634
	u32 sts;
1634
	unsigned long flag;
1635
	unsigned long flag;
1635
1636
1637
	if (iommu_skip_te_disable && iommu->drhd->gfx_dedicated &&
1638
	    (cap_read_drain(iommu->cap) || cap_write_drain(iommu->cap)))
1639
		return;
1640
1636
	raw_spin_lock_irqsave(&iommu->register_lock, flag);
1641
	raw_spin_lock_irqsave(&iommu->register_lock, flag);
1637
	iommu->gcmd &= ~DMA_GCMD_TE;
1642
	iommu->gcmd &= ~DMA_GCMD_TE;
1638
	writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
1643
	writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
Lines 4043-4048 static void __init init_no_remapping_devices(void) Link Here
4043
4048
4044
		/* This IOMMU has *only* gfx devices. Either bypass it or
4049
		/* This IOMMU has *only* gfx devices. Either bypass it or
4045
		   set the gfx_mapped flag, as appropriate */
4050
		   set the gfx_mapped flag, as appropriate */
4051
		drhd->gfx_dedicated = 1;
4046
		if (!dmar_map_gfx) {
4052
		if (!dmar_map_gfx) {
4047
			drhd->ignored = 1;
4053
			drhd->ignored = 1;
4048
			for_each_active_dev_scope(drhd->devices,
4054
			for_each_active_dev_scope(drhd->devices,
Lines 6160-6165 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_g Link Here
6160
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt);
6166
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt);
6161
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt);
6167
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt);
6162
6168
6169
static void quirk_igfx_skip_te_disable(struct pci_dev *dev)
6170
{
6171
	unsigned short ver;
6172
6173
	if (!IS_GFX_DEVICE(dev))
6174
		return;
6175
6176
	ver = (dev->device >> 8) & 0xff;
6177
	if (ver != 0x45 && ver != 0x4e && ver != 0x8a &&
6178
	    ver != 0x98 && ver != 0x9a && ver != 0x46 && ver != 0x4c)
6179
		return;
6180
6181
	if (risky_device(dev))
6182
		return;
6183
6184
	pci_info(dev, "Skip IOMMU disabling for graphics\n");
6185
	iommu_skip_te_disable = 1;
6186
}
6187
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_igfx_skip_te_disable);
6188
6163
/* On Tylersburg chipsets, some BIOSes have been known to enable the
6189
/* On Tylersburg chipsets, some BIOSes have been known to enable the
6164
   ISOCH DMAR unit for the Azalia sound device, but not give it any
6190
   ISOCH DMAR unit for the Azalia sound device, but not give it any
6165
   TLB entries, which causes it to deadlock. Check for that.  We do
6191
   TLB entries, which causes it to deadlock. Check for that.  We do
(-)a/include/linux/dmar.h (+1 lines)
Lines 48-53 struct dmar_drhd_unit { Link Here
48
	u16	segment;		/* PCI domain		*/
48
	u16	segment;		/* PCI domain		*/
49
	u8	ignored:1; 		/* ignore drhd		*/
49
	u8	ignored:1; 		/* ignore drhd		*/
50
	u8	include_all:1;
50
	u8	include_all:1;
51
	u8	gfx_dedicated:1;	/* graphic dedicated	*/
51
	struct intel_iommu *iommu;
52
	struct intel_iommu *iommu;
52
};
53
};
53
54
(-)a/include/linux/intel-iommu.h (-1 / +2 lines)
Lines 600-605 struct intel_iommu { Link Here
600
	struct iommu_device iommu;  /* IOMMU core code handle */
600
	struct iommu_device iommu;  /* IOMMU core code handle */
601
	int		node;
601
	int		node;
602
	u32		flags;      /* Software defined flags */
602
	u32		flags;      /* Software defined flags */
603
604
	struct dmar_drhd_unit *drhd;
603
};
605
};
604
606
605
/* PCI domain-device relationship */
607
/* PCI domain-device relationship */
606
- 

Return to bug 206571