Skip to contentSkip to conversation

IOMMU changes for v2.6.31

GIT PULL Ingo Molnar 1 participant 1 message Jun 10, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest iommu-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git iommu-for-linus

- swiotlb changes: PowerPC32 highmem support finishing touches
- AMD-IOMMU updates
- dma-debug updates/fixes
- fixlets

Thanks,

Ingo

------------------>
Becky Bruce (7):
swiotlb: comment corrections
swiotlb: fix compile warning
swiotlb: map_page fix for highmem systems
swiotlb: allow arch override of address_needs_mapping
swiotlb: rename unmap_single to do_unmap_single
swiotlb: use swiotlb_sync_single instead of duplicating code
swiotlb: change swiotlb_bus_to[phys,virt] prototypes

Chris Wright (1):

      amd iommu: properly detach from protection domain on ->remove

FUJITA Tomonori (6):
x86: calgary: remove IOMMU_DEBUG
dma-debug: add dma_debug_resize_entries() to adjust the number of dma_debug_entries x86 gart: reimplement IOMMU_LEAK feature by using DMA_API_DEBUG
dma-debug: use sg_dma_address accessor instead of using dma_address directly
dma-debug: use sg_dma_len accessor
dma-debug: fix debug_dma_sync_sg_for_cpu and debug_dma_sync_sg_for_device

Jiri Slaby (1):
amd_iommu: fix lock imbalance

Joerg Roedel (43):
dma-debug: re-add dma memory leak detection
amd-iommu: add amd_iommu_dump parameter
amd-iommu: add dump for iommus described in ivrs table
amd-iommu: print ivhd information to dmesg when requested
amd-iommu: print ivmd information to dmesg when requested
amd-iommu: move protection domain printk to dump code x86/iommu: add IOMMU_STRESS Kconfig entry
amd-iommu: disable device isolation with CONFIG_IOMMU_STRESS
amd-iommu: make sure only ivmd entries are parsed
amd-iommu: introduce for_each_iommu* macros
amd-iommu: consolidate hardware initialization to one function
amd-iommu: drop pointless iommu-loop in msi setup code
amd-iommu: remove support for msi-x
amd-iommu: add function to disable all iommus
amd-iommu: add function to flush tlb for all domains
amd-iommu: add function to flush tlb for all devices
amd_iommu: un __init functions required for suspend/resume
amd-iommu: implement suspend/resume
amd-iommu: introduce aperture_range structure
amd-iommu: move page table allocation code to seperate function
amd-iommu: handle page table allocation failures in dma_ops code
amd-iommu: make address allocator aware of multiple aperture ranges
amd-iommu: change dma_dom->next_bit to dma_dom->next_address
amd-iommu: move aperture_range allocation code to seperate function
amd-iommu: handle exlusion ranges and unity mappings in alloc_new_range
amd-iommu: enlarge the aperture dynamically
amd-iommu: remove amd_iommu_size kernel parameter
amd-iommu: disable round-robin allocator for CONFIG_IOMMU_STRESS
amd-iommu: don't preallocate page tables with CONFIG_IOMMU_STRESS
amd-iommu: don't free dma adresses below 512MB with CONFIG_IOMMU_STRESS
dma-debug: add variables and checks for driver filter
dma-debug: add debugfs file for driver filter
dma-debug: add dma_debug_driver kernel command line
dma-debug: add documentation for the driver filter
dma-debug: change hash_bucket_find from first-fit to best-fit
dma-debug: comment style fixes
dma-debug: code style fixes
dma-debug: use pr_* instead of printk(KERN_* ...)
dma-debug: disable/enable irqs only once in device_dma_allocations
dma-debug: simplify logic in driver_filter()
amd-iommu: remove BUS_NOTIFY_BOUND_DRIVER handling
amd-iommu: detach device explicitly before attaching it to a new domain
amd-iommu: remove unnecessary "AMD IOMMU: " prefix

Mark Langsdorf (1):
x86: enable GART-IOMMU only after setting up protection methods

Neil Turton (2):
amd-iommu: fix an off-by-one error in the AMD IOMMU driver.
amd-iommu: fix the handling of device aliases in the AMD IOMMU driver.

 Documentation/DMA-API.txt              |   12 +
 Documentation/kernel-parameters.txt    |   12 +-
 arch/x86/Kconfig.debug                 |   11 +-
 arch/x86/include/asm/amd_iommu.h       |    2 +
 arch/x86/include/asm/amd_iommu_types.h |   55 +++-
 arch/x86/kernel/amd_iommu.c            |  500 +++++++++++++++++++++++---------
 arch/x86/kernel/amd_iommu_init.c       |  273 ++++++++++++------
 arch/x86/kernel/pci-calgary_64.c       |   54 +----
 arch/x86/kernel/pci-gart_64.c          |   55 +---
 arch/x86/kernel/pci-swiotlb.c          |    2 +-
 include/linux/dma-debug.h              |    7 +
 include/linux/swiotlb.h                |    3 +-
 lib/dma-debug.c                        |  432 ++++++++++++++++++++++++---
 lib/swiotlb.c                          |  119 ++++----
 14 files changed, 1099 insertions(+), 438 deletions(-)
Documentation/DMA-API.txt +12 -0
index d9aa43d..25fb8bc 100644
@@ -704,12 +704,24 @@ this directory the following files can currently be found:
 				The current number of free dma_debug_entries
 				in the allocator.
 
+	dma-api/driver-filter
+				You can write a name of a driver into this file
+				to limit the debug output to requests from that
+				particular driver. Write an empty string to
+				that file to disable the filter and see
+				all errors again.
+
 If you have this code compiled into your kernel it will be enabled by default.
 If you want to boot without the bookkeeping anyway you can provide
 'dma_debug=off' as a boot parameter. This will disable DMA-API debugging.
 Notice that you can not enable it again at runtime. You have to reboot to do
 so.
 
+If you want to see debug messages only for a special device driver you can
+specify the dma_debug_driver=<drivername> parameter. This will enable the
+driver filter at boot time. The debug code will only print errors for that
+driver afterwards. This filter can be disabled or changed later using debugfs.
+
 When the code disables itself at runtime this is most likely because it ran
 out of dma_debug_entries. These entries are preallocated at boot. The number
 of preallocated entries is defined per architecture. If it is too low for you
Documentation/kernel-parameters.txt +7 -5
index fd5cac0..8f9e17c 100644
@@ -329,11 +329,6 @@ and is between 256 and 4096 characters. It is defined in the file
 				    flushed before they will be reused, which
 				    is a lot of faster
 
-	amd_iommu_size= [HW,X86-64]
-			Define the size of the aperture for the AMD IOMMU
-			driver. Possible values are:
-			'32M', '64M' (default), '128M', '256M', '512M', '1G'
-
 	amijoy.map=	[HW,JOY] Amiga joystick support
 			Map of devices attached to JOY0DAT and JOY1DAT
 			Format: <a>,<b>
@@ -646,6 +641,13 @@ and is between 256 and 4096 characters. It is defined in the file
 			DMA-API debugging code disables itself because the
 			architectural default is too low.
 
+	dma_debug_driver=<driver_name>
+			With this option the DMA-API debugging driver
+			filter feature can be enabled at boot time. Just
+			pass the driver to filter for as the parameter.
+			The filter can be disabled or changed to another
+			driver later using sysfs.
+
 	dscc4.setup=	[NET]
 
 	dtc3181e=	[HW,SCSI]
arch/x86/Kconfig.debug +9 -2
index d8359e7..33fac6b 100644
@@ -159,10 +159,17 @@ config IOMMU_DEBUG
 	  options. See Documentation/x86_64/boot-options.txt for more
 	  details.
 
+config IOMMU_STRESS
+	bool "Enable IOMMU stress-test mode"
+	---help---
+	  This option disables various optimizations in IOMMU related
+	  code to do real stress testing of the IOMMU code. This option
+	  will cause a performance drop and should only be enabled for
+	  testing.
+
 config IOMMU_LEAK
 	bool "IOMMU leak tracing"
-	depends on DEBUG_KERNEL
-	depends on IOMMU_DEBUG
+	depends on IOMMU_DEBUG && DMA_API_DEBUG
 	---help---
 	  Add a simple leak tracer to the IOMMU code. This is useful when you
 	  are debugging a buggy device driver that leaks IOMMU mappings.
arch/x86/include/asm/amd_iommu.h +2 -0
index f712344..262e028 100644
@@ -27,6 +27,8 @@ extern int amd_iommu_init(void);
 extern int amd_iommu_init_dma_ops(void);
 extern void amd_iommu_detect(void);
 extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
+extern void amd_iommu_flush_all_domains(void);
+extern void amd_iommu_flush_all_devices(void);
 #else
 static inline int amd_iommu_init(void) { return -ENODEV; }
 static inline void amd_iommu_detect(void) { }
arch/x86/include/asm/amd_iommu_types.h +44 -11

74 lines not on this page · raw message

arch/x86/kernel/amd_iommu.c +365 -135

731 lines not on this page · raw message

arch/x86/kernel/amd_iommu_init.c +183 -90

510 lines not on this page · raw message

arch/x86/kernel/pci-calgary_64.c +2 -52

90 lines not on this page · raw message

arch/x86/kernel/pci-gart_64.c +16 -39

110 lines not on this page · raw message

arch/x86/kernel/pci-swiotlb.c +1 -1
index 221a385..a1712f2 100644
@@ -28,7 +28,7 @@ dma_addr_t swiotlb_phys_to_bus(struct device *hwdev, phys_addr_t paddr)
 	return paddr;
 }
 
-phys_addr_t swiotlb_bus_to_phys(dma_addr_t baddr)
+phys_addr_t swiotlb_bus_to_phys(struct device *hwdev, dma_addr_t baddr)
 {
 	return baddr;
 }
include/linux/dma-debug.h +7 -0
index 28d53cb..171ad8a 100644
@@ -32,6 +32,8 @@ extern void dma_debug_add_bus(struct bus_type *bus);
 
 extern void dma_debug_init(u32 num_entries);
 
+extern int dma_debug_resize_entries(u32 num_entries);
+
 extern void debug_dma_map_page(struct device *dev, struct page *page,
 			       size_t offset, size_t size,
 			       int direction, dma_addr_t dma_addr,
@@ -91,6 +93,11 @@ static inline void dma_debug_init(u32 num_entries)
 {
 }
 
+static inline int dma_debug_resize_entries(u32 num_entries)
+{
+	return 0;
+}
+
 static inline void debug_dma_map_page(struct device *dev, struct page *page,
 				      size_t offset, size_t size,
 				      int direction, dma_addr_t dma_addr,
include/linux/swiotlb.h +2 -1
index ac9ff54..cb1a663 100644
@@ -29,7 +29,8 @@ extern void *swiotlb_alloc(unsigned order, unsigned long nslabs);
 
 extern dma_addr_t swiotlb_phys_to_bus(struct device *hwdev,
 				      phys_addr_t address);
-extern phys_addr_t swiotlb_bus_to_phys(dma_addr_t address);
+extern phys_addr_t swiotlb_bus_to_phys(struct device *hwdev,
+				       dma_addr_t address);
 
 extern int swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size);
 
lib/dma-debug.c +387 -45

623 lines not on this page · raw message

lib/swiotlb.c +62 -57

270 lines not on this page · raw message