linux/arch/mips/mm
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
..
c-r3k.c [MIPS] Atlas, decstation: Fix section mismatches triggered by defconfigs 2008-07-08 19:33:46 +01:00
c-r4k.c smp_call_function: get rid of the unused nonatomic/retry argument 2008-06-26 11:24:35 +02:00
c-tx39.c [MIPS] Handle aliases in vmalloc correctly. 2008-04-07 22:31:04 +01:00
cache.c [MIPS] Allow setting of the cache attribute at run time. 2008-04-28 17:14:25 +01:00
cerr-sb1.c [MIPS] Sibyte: Replace use of removed IO_SPACE_BASE with IOADDR. 2007-11-15 23:21:49 +00:00
cex-gen.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cex-sb1.S [MIPS] Fix loads of section missmatches 2008-03-12 14:14:41 +00:00
dma-default.c dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
extable.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
fault.c pid namespaces: define is_global_init() and is_container_init() 2007-10-19 11:53:37 -07:00
highmem.c [MIPS] unexport __kmap_atomic_to_page 2008-05-12 16:46:51 +01:00
init.c [MIPS] Export empty_zero_page for sake of the ext4 module. 2008-06-16 15:14:46 +01:00
ioremap.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
Makefile [MIPS] Reimplement clear_page/copy_page 2008-04-28 17:14:23 +01:00
page.c [MIPS] Fix 32bit kernels on R4k with 128 byte cache line size 2008-07-08 19:33:46 +01:00
pgtable-32.c [MIPS] Add external declaration of pagetable_init() to pgalloc.h 2007-02-18 21:31:36 +00:00
pgtable-64.c [MIPS] Add external declaration of pagetable_init() to pgalloc.h 2007-02-18 21:31:36 +00:00
pgtable.c [MIPS] remove redundant display of free swap space in show_mem() 2008-04-28 17:14:27 +01:00
sc-ip22.c [MIPS] Fix loads of section missmatches 2008-03-12 14:14:41 +00:00
sc-mips.c [MIPS] Fix loads of section missmatches 2008-03-12 14:14:41 +00:00
sc-r5k.c [MIPS] Fix loads of section missmatches 2008-03-12 14:14:41 +00:00
sc-rm7k.c [MIPS] Atlas, decstation: Fix section mismatches triggered by defconfigs 2008-07-08 19:33:46 +01:00
tlb-r3k.c [MIPS] Fix loads of section missmatches 2008-03-12 14:14:41 +00:00
tlb-r4k.c [MIPS] All MIPS32 processors support64-bit physical addresses. 2008-04-28 17:14:25 +01:00
tlb-r8k.c [MIPS] Fix loads of section missmatches 2008-03-12 14:14:41 +00:00
tlbex-fault.S [MIPS] Stacktrace build-fix and improvement 2006-10-01 23:16:58 +01:00
tlbex.c [MIPS] R4700: Fix build_tlb_probe_entry 2008-06-05 18:13:14 +01:00
uasm.c [MIPS] Make two functions static 2008-07-15 18:44:29 +01:00
uasm.h [MIPS] Make two functions static 2008-07-15 18:44:29 +01:00