kernel-ark/include/asm-xtensa
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
..
platform-iss
variant-fsf [XTENSA] Add support for configurable registers and coprocessors 2008-02-13 17:41:43 -08:00
a.out.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
asmmacro.h
atomic.h
auxvec.h
bitops.h forbid asm/bitops.h direct inclusion 2007-10-19 11:53:41 -07:00
bootparam.h
bug.h
bugs.h [XTENSA] Remove extraneous include statement 2007-08-27 13:53:27 -07:00
byteorder.h [XTENSA] clean-up header files 2007-05-31 17:47:01 -07:00
cache.h [XTENSA] Add support for cache-aliasing 2007-08-27 13:54:16 -07:00
cacheasm.h
cacheflush.h [XTENSA] Fix cache flush macro for D$/I$ aliasing/non-aliasing 2008-02-13 17:43:26 -08:00
checksum.h
coprocessor.h [XTENSA] Exclude thread-global registers from the xtregs structures. 2008-02-13 17:43:00 -08:00
cpumask.h
cputime.h
current.h
delay.h
device.h
div64.h
dma-mapping.h dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
dma.h
elf.h [XTENSA] Allow debugger to modify the WINDOWBASE register. 2008-02-13 17:45:36 -08:00
emergency-restart.h
errno.h
fb.h fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
fcntl.h Xtensa: use asm-generic/fcntl.h 2007-05-31 20:18:25 -07:00
futex.h
hardirq.h
highmem.h
hw_irq.h
io.h [XTENSA] Add support for cache-aliasing 2007-08-27 13:54:16 -07:00
ioctl.h
ioctls.h [patch 1/2] Xtensa: enable arbitary tty speed setting ioctls 2007-08-27 13:54:25 -07:00
ipcbuf.h
irq_regs.h
irq.h
Kbuild
kdebug.h move die notifier handling to common code 2007-05-08 11:15:04 -07:00
kmap_types.h
linkage.h
local.h
mman.h
mmu_context.h [XTENSA] clean-up header files 2007-05-31 17:47:01 -07:00
mmu.h
module.h [XTENSA] Fix modules for non-exec processor configurations 2008-02-13 17:23:26 -08:00
msgbuf.h
mutex.h
namei.h
page.h PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
param.h asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
pci-bridge.h
pci.h PCI: remove pci_dac_dma_... APIs 2007-07-11 16:02:11 -07:00
percpu.h
pgalloc.h [XTENSA] Fix non-existent pte_token_t typedef to pgtable_t 2008-02-13 16:25:09 -08:00
pgtable.h mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
platform.h
poll.h
posix_types.h asm-*/posix_types.h: scrub __GLIBC__ 2008-02-08 09:22:34 -08:00
processor.h [XTENSA] Add support for configurable registers and coprocessors 2008-02-13 17:41:43 -08:00
ptrace.h include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
regs.h [XTENSA] Add support for configurable registers and coprocessors 2008-02-13 17:41:43 -08:00
resource.h
rmap.h [PATCH] xtensa: Architecture support for Tensilica Xtensa Part 6 2005-06-24 00:05:22 -07:00
rwsem.h
scatterlist.h Add CONFIG_DEBUG_SG sg validation 2007-10-22 21:20:03 +02:00
sections.h
segment.h
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h [XTENSA] clean-up header files 2007-05-31 17:47:01 -07:00
sigcontext.h [XTENSA] Add support for configurable registers and coprocessors 2008-02-13 17:41:43 -08:00
siginfo.h
signal.h
smp.h
socket.h [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
sockios.h
spinlock.h
stat.h [XTENSA] Clean up stat structs. 2008-02-13 17:27:03 -08:00
statfs.h
string.h
syscall.h [XTENSA] Fix fadvise64_64 2007-08-27 13:53:32 -07:00
system.h [XTENSA] Add support for configurable registers and coprocessors 2008-02-13 17:41:43 -08:00
termbits.h [patch 1/2] Xtensa: enable arbitary tty speed setting ioctls 2007-08-27 13:54:25 -07:00
termios.h [patch 1/2] Xtensa: enable arbitary tty speed setting ioctls 2007-08-27 13:54:25 -07:00
thread_info.h clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
timex.h [XTENSA] Add volatile keyword to asm statements accessing counter registers 2008-02-13 17:24:47 -08:00
tlb.h add mm argument to pte/pmd/pud/pgd_free 2008-02-05 09:44:18 -08:00
tlbflush.h remove unused flush_tlb_pgtables 2007-10-19 11:53:34 -07:00
topology.h
types.h xtensa: types: use <asm-generic/int-*.h> for the xtensa architecture 2008-05-02 16:18:42 -07:00
uaccess.h [XTENSA] Fix clobbered register in asm macro 2008-02-13 17:06:41 -08:00
ucontext.h
unaligned.h kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
unistd.h fix xtensa timerfd breakage 2008-02-08 15:33:32 -08:00
user.h
vga.h
xor.h