Graphics workaround for AMD IOMMU systems

Chris Wright chrisw at sous-sol.org
Sat Jun 13 16:01:30 PDT 2009


* Joerg Roedel (joro at 8bytes.org) wrote:
> 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 :-(

I agree, it's nasty, you don't have to take it ;-)  I'm just looking for
a way to  limit the damage if you want to accept a work around.

> > 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.

Ah, you mean for devices where there's a reasonably functional open
source driver as well as a busted proprietary driver?  Makes sense.

thanks,
-chris


More information about the iommu mailing list