kernel-ark/drivers/pci
Alex Williamson e8bb910d1b intel-iommu: Obey coherent_dma_mask for alloc_coherent on passthrough
The model for IOMMU passthrough is that decent devices that can cope
with DMA to all of memory get passthrough; crappy devices with a limited
dma_mask don't -- they get to use the IOMMU anyway.

This is done on the basis that IOMMU passthrough is usually wanted for
performance reasons, and it's only the decent PCI devices that you
really care about performance for, while the crappy 32-bit ones like
your USB controller can just use the IOMMU and you won't really care.

Unfortunately, the check for this was only looking at dev->dma_mask, not
at dev->coherent_dma_mask. And some devices have a 32-bit
coherent_dma_mask even though they have a full 64-bit dma_mask.

Even more unfortunately, fixing that simple oversight would upset
certain broken HP devices. Not only do they have a 32-bit
coherent_dma_mask, but they also have a tendency to do stray DMA to
unmapped addresses. And then they die when they take the DMA fault they
so richly deserve.

So if we do the 'correct' fix, it'll mean that affected users have to
disable IOMMU support completely on "a large percentage of servers from
a major vendor."

Personally, I have little sympathy -- given that this is the _same_
'major vendor' who is shipping machines which claim to have IOMMU
support but have obviously never _once_ booted a VT-d capable OS to do
any form of QA. But strictly speaking, it _would_ be a regression even
though it only ever worked by fluke.

For 2.6.33, we'll come up with a quirk which gives swiotlb support
for this particular device, and other devices with an inadequate
coherent_dma_mask will just get normal IOMMU mapping.

The simplest fix for 2.6.32, though, is just to jump through some hoops
to try to allocate coherent DMA memory for such devices in a place that
they can reach. We'd use dma_generic_alloc_coherent() for this if it
existed on IA64.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-11-12 02:10:34 +00:00
..
hotplug headers: Fix build after <linux/sched.h> removal 2009-10-13 10:20:16 -07:00
pcie Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2009-10-12 14:38:34 -07:00
.gitignore
access.c PCI: Add pci_bus_set_ops 2009-06-16 14:29:33 -07:00
bus.c PCI AER: support Multiple Error Received and no error source id 2009-06-16 14:30:13 -07:00
dmar.c intel-iommu: Check for 'DMAR at zero' BIOS error earlier. 2009-11-09 22:15:15 +00:00
hotplug-pci.c
hotplug.c
htirq.c
intel-iommu.c intel-iommu: Obey coherent_dma_mask for alloc_coherent on passthrough 2009-11-12 02:10:34 +00:00
intr_remapping.c Merge git://git.infradead.org/iommu-2.6 2009-09-23 10:06:10 -07:00
intr_remapping.h Intel-IOMMU, intr-remap: source-id checking 2009-06-23 22:09:17 +01:00
iov.c PCI SR-IOV: correct broken resource alignment calculations 2009-08-30 08:37:25 -07:00
iova.c intel-iommu: Remove superfluous iova_alloc_lock from IOVA code 2009-07-15 08:17:02 +01:00
irq.c
Kconfig
legacy.c PCI: disable pci_find_device warnings when deprecated pci functions are enabled 2009-09-09 13:29:25 -07:00
Makefile PCI: disable pci_find_device warnings when deprecated pci functions are enabled 2009-09-09 13:29:25 -07:00
msi.c PCI MSI: Style cleanups 2009-09-09 13:29:35 -07:00
msi.h PCI MSI: shorten PCI_MSIX_ENTRY_* symbol names 2009-06-29 12:15:19 -07:00
pci-acpi.c PCI / ACPI PM: Propagate wake-up enable for devices w/o ACPI support 2009-09-09 14:19:24 -07:00
pci-driver.c Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2009-09-16 07:49:54 -07:00
pci-stub.c PCI: pci-stub: add pci_stub.ids parameter 2009-09-09 13:44:34 -07:00
pci-sysfs.c PCI: expose function reset capability in sysfs 2009-09-09 13:29:24 -07:00
pci.c Merge git://git.infradead.org/~dwmw2/iommu-2.6.32 2009-10-13 10:04:40 -07:00
pci.h PCI: Simplify hotplug mch quirk. 2009-09-09 14:06:49 -07:00
probe.c PCI: Clear saved_state after the state has been restored 2009-09-14 13:41:46 -07:00
proc.c
quirks.c ahci / atiixp / pci quirks: rename AMD SB900 into Hudson-2 2009-10-16 06:21:20 -04:00
remove.c
rom.c
search.c PCI: disable pci_find_device warnings when deprecated pci functions are enabled 2009-09-09 13:29:25 -07:00
setup-bus.c Revert "PCI: get larger bridge ranges when space is available" 2009-10-27 09:39:18 -07:00
setup-irq.c
setup-res.c PCI: remove pci_assign_resource_fixed() 2009-10-06 09:42:04 -07:00
slot.c PCI: fix kernel-doc warnings 2009-06-29 12:13:56 -07:00
syscall.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00