Graphics workaround for AMD IOMMU systems

Joerg Roedel joro at 8bytes.org
Sat Jun 13 13:48:27 PDT 2009


On Fri, Jun 12, 2009 at 12:28:02PM -0700, Chris Wright wrote:
> * Bhavna Sarathy (bnagendr at redhat.com) wrote:
> > +#define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY)
> 
> I think this is too permissive for upstream, and a blacklist would
> be better.  So more like:

Better would be if there were no workaround at all for this. Not for
VT-d and not for AMD IOMMU. But VT-d has it upstream and it doesn't look
like it will be removed anytime soon. This somehow forces such a nasty
workaround for AMD IOMMU in upstream code too :-(

> static const struct pci_device_id pci_broken_gfx_ids[] = {
> 	/* Add your favorite busted card here */	
> 	{ } /* terminate list */
> };
> 
> static inline bool is_broken_gfx_device(struct pci_device *pdev)
> {
> 	struct pci_device_id *broken = NULL
> 
> 	broken = pci_id_match(pci_broken_gfx_ids, pdev);
> 	WARN(broken, "IOMMU: graphics device %s is broken with IOMMU, "
> 		     "disabling IOMMU protection for this device\n", 
> 		     pci_name(pdev));
> 	return !!broken;
> }
> 
> This should be sharable between VT-d and AMD IOMMU.

I think its better to match against the driver name instead of device
ids because we only need this for crappy drivers.

Joerg



More information about the iommu mailing list