dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers/infiniband/hw/ipath
FUJITA Tomonori 8d8bb39b9e dma-mapping: add the device argument to dma_mapping_error()
Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER
architecture does:

This enables us to cleanly fix the Calgary IOMMU issue that some devices
are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423).

I think that per-device dma_mapping_ops support would be also helpful for
KVM people to support PCI passthrough but Andi thinks that this makes it
difficult to support the PCI passthrough (see the above thread).  So I
CC'ed this to KVM camp.  Comments are appreciated.

A pointer to dma_mapping_ops to struct dev_archdata is added.  If the
pointer is non NULL, DMA operations in asm/dma-mapping.h use it.  If it's
NULL, the system-wide dma_ops pointer is used as before.

If it's useful for KVM people, I plan to implement a mechanism to register
a hook called when a new pci (or dma capable) device is created (it works
with hot plugging).  It enables IOMMUs to set up an appropriate
dma_mapping_ops per device.

The major obstacle is that dma_mapping_error doesn't take a pointer to the
device unlike other DMA operations.  So x86 can't have dma_mapping_ops per
device.  Note all the POWER IOMMUs use the same dma_mapping_error function
so this is not a problem for POWER but x86 IOMMUs use different
dma_mapping_error functions.

The first patch adds the device argument to dma_mapping_error.  The patch
is trivial but large since it touches lots of drivers and dma-mapping.h in
all the architecture.

This patch:

dma_mapping_error() doesn't take a pointer to the device unlike other DMA
operations.  So we can't have dma_mapping_ops per device.

Note that POWER already has dma_mapping_ops per device but all the POWER
IOMMUs use the same dma_mapping_error function.  x86 IOMMUs use device
argument.

[akpm@linux-foundation.org: fix sge]
[akpm@linux-foundation.org: fix svc_rdma]
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: fix bnx2x]
[akpm@linux-foundation.org: fix s2io]
[akpm@linux-foundation.org: fix pasemi_mac]
[akpm@linux-foundation.org: fix sdhci]
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: fix sparc]
[akpm@linux-foundation.org: fix ibmvscsi]
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-26 12:00:03 -07:00
..
Kconfig IB/ipath: Remove dependency on PCI_MSI || HT_IRQ 2008-04-21 18:19:14 -07:00
Makefile IB/ipath: Build IBA7220 code unconditionally 2008-04-21 18:19:14 -07:00
ipath_7220.h IB/ipath: Isolate 7220-specific content 2008-04-16 21:09:30 -07:00
ipath_common.h IB/ipath: Update copyright dates for files changed in 2008 2008-04-16 21:09:32 -07:00
ipath_cq.c RDMA/core: Add memory management extensions support 2008-07-14 23:48:45 -07:00
ipath_debug.h IB/ipath: Prevent link-recovery code from negating admin disable 2008-04-16 21:09:26 -07:00
ipath_diag.c IB: convert struct class_device to struct device 2008-04-19 19:10:30 -07:00
ipath_dma.c [SG] Update drivers to use sg helpers 2007-10-22 21:19:53 +02:00
ipath_driver.c IB/ipath: Change ipath_devdata.ipath_sdma_status to be unsigned long 2008-05-13 11:51:23 -07:00
ipath_eeprom.c IB/ipath: Update copyright dates for files changed in 2008 2008-04-16 21:09:32 -07:00
ipath_file_ops.c device create: infiniband: convert device_create to device_create_drvdata 2008-07-21 21:54:43 -07:00
ipath_fs.c IB/ipath: Remove unnecessary cast 2008-01-25 14:17:46 -08:00
ipath_iba6110.c IB/ipath: Add support for 7220 receive queue changes 2008-04-16 21:09:29 -07:00
ipath_iba6120.c IB/ipath: Update copyright dates for files changed in 2008 2008-04-16 21:09:32 -07:00
ipath_iba7220.c IB/ipath: Simplify code using ARRAY_SIZE() macro 2008-07-14 23:48:44 -07:00
ipath_init_chip.c IB/ipath: Need to always request and handle PIO avail interrupts 2008-05-07 11:00:15 -07:00
ipath_intr.c IB/ipath: Need to always request and handle PIO avail interrupts 2008-05-07 11:00:15 -07:00
ipath_kernel.h IB/ipath: Avoid test_bit() on u64 SDMA status value 2008-05-26 15:20:34 -07:00
ipath_keys.c IB/ipath: Clean up some comments 2008-01-25 14:15:38 -08:00
ipath_mad.c IB/ipath: Use IEEE OUI for vendor_id reported by ibv_query_device() 2008-07-14 23:48:52 -07:00
ipath_mmap.c IB/ipath: Update copyright dates 2007-07-09 20:12:26 -07:00
ipath_mr.c IB: expand ib_umem_get() prototype 2008-04-29 08:06:12 -07:00
ipath_qp.c IB/ipath: Fix many locking issues when switching to error state 2008-05-13 11:41:29 -07:00
ipath_rc.c RDMA/core: Add memory management extensions support 2008-07-14 23:48:45 -07:00
ipath_registers.h IB/ipath: Header file changes to support IBA7220 2008-04-16 21:09:30 -07:00
ipath_ruc.c RDMA/core: Add memory management extensions support 2008-07-14 23:48:45 -07:00
ipath_sd7220.c IB/ipath: Support for SerDes portion of IBA7220 2008-04-16 21:09:31 -07:00
ipath_sd7220_img.c IB/ipath: Add IBA7220-specific SERDES initialization data 2008-04-16 21:09:31 -07:00
ipath_sdma.c dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
ipath_srq.c IB/ipath: Update copyright dates for files changed in 2008 2008-04-16 21:09:32 -07:00
ipath_stats.c IB/ipath: Update copyright dates for files changed in 2008 2008-04-16 21:09:32 -07:00
ipath_sysfs.c IB/ipath: Update copyright dates for files changed in 2008 2008-04-16 21:09:32 -07:00
ipath_uc.c RDMA/core: Add memory management extensions support 2008-07-14 23:48:45 -07:00
ipath_ud.c RDMA/core: Add memory management extensions support 2008-07-14 23:48:45 -07:00
ipath_user_pages.c IB/ipath: Remove ipath_get_user_pages_nocopy() 2007-07-17 18:37:43 -07:00
ipath_user_sdma.c dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
ipath_user_sdma.h IB/ipath: Fix many locking issues when switching to error state 2008-05-13 11:41:29 -07:00
ipath_verbs.c Merge branch 'core/rcu' into core/rcu-for-linus 2008-07-15 21:10:12 +02:00
ipath_verbs.h IB/ipath: Fix RDMA read response sequence checking 2008-05-13 11:42:20 -07:00
ipath_verbs_mcast.c rcu: split list.h and move rcu-protected lists into rculist.h 2008-05-19 10:01:37 +02:00
ipath_wc_ppc64.c IB/ipath: Update copyright dates 2007-07-09 20:12:26 -07:00
ipath_wc_x86_64.c IB/ipath: Update copyright dates 2007-07-09 20:12:26 -07:00