-
Andi Kleen authored
The biggest change is better overflow handling, partly ported from the AMD64 IOMMU code. This is important for some 3d drivers who make use of this and can map a lot of memory. First it increases the default memory usage of swiotlb to 64MB. This was the value used in production systems in 2.4 (e.g. in SLES8) and the default was far too small. Note this is only allocated when the swiotlb is needed. pci_map_single will not panic anymore on an overflow. Instead it returns a pointer to a scratch area and allows the caller to check using dma_mapping_error(). It still panics when the overflow buffer is exceeded. dma_mapping_error support is implemented. pci_map_sg will never panic now, but just return 0. Near all callers of it seem to have proper error checking for this (IDE will even handle it without erroring out) The handling of passing a NULL device is improved, previously it would never map in this case. i386 and other architectures assume NULL means a 4GB limit instead. This code does this now too. I added support for swiotlb=force for easier testing. Patch supplied by Andi Kleen & Suresh Siddha Signed-off-by: Tony Luck <tony.luck@intel.com>
de9b29d1