linux/arch/s390/pci
Gerald Schaefer 69eea95c48 s390/pci_dma: fix DMA table corruption with > 4 TB main memory
DMA addresses returned from map_page() are calculated by using an iommu
bitmap plus a start_dma offset. The size of this bitmap is based on the main
memory size. If we have more than (4 TB - start_dma) main memory, the DMA
address calculation will also produce addresses > 4 TB. Such addresses
cannot be inserted in the 3-level DMA page table, instead the entries
modulo 4 TB will be overwritten.

Fix this by restricting the iommu bitmap size to (4 TB - start_dma).
Also set zdev->end_dma to the actual end address of the usable
range, instead of the theoretical maximum as reported by the hardware,
which fixes a sanity check in dma_map() and also the IOMMU API domain
geometry aperture calculation.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2015-11-27 09:24:15 +01:00
..
Makefile s390/kernel: add system calls for PCI memory access 2014-11-19 09:46:43 +01:00
pci_clp.c s390/pci: improve irq number check for msix 2014-11-03 13:30:12 +01:00
pci_debug.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2015-04-20 10:15:33 -07:00
pci_dma.c s390/pci_dma: fix DMA table corruption with > 4 TB main memory 2015-11-27 09:24:15 +01:00
pci_event.c s390/pci: use pci_rescan_remove_lock 2015-07-29 09:11:56 +02:00
pci_insn.c s390/pci: reshuffle struct used to write debug data 2015-10-14 14:32:17 +02:00
pci_mmio.c s390/pci: fix possible information leak in mmio syscall 2015-02-26 09:24:48 +01:00
pci_sysfs.c s390/pci: use pci_rescan_remove_lock 2015-07-29 09:11:56 +02:00
pci.c s390/pci_dma: fix DMA table corruption with > 4 TB main memory 2015-11-27 09:24:15 +01:00