Archived
14
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/include/asm-cris
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
..
arch-v10 include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
arch-v32 include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
a.out.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
atomic.h CRIS: Fix bugs in return value of atomic_inc_return and atomic_dec_return. 2008-02-08 11:06:33 +01:00
auxvec.h
axisflashmap.h CRIS: Merge axisflashmap.h with Axis internal changes. 2008-02-08 11:06:24 +01:00
bitops.h cris: remove unused __dummy, CONST_ADDR and ADDR from bitops.h 2008-02-05 09:44:24 -08:00
bug.h CRIS: Include arch dependent bug.h. 2008-02-08 11:06:32 +01:00
bugs.h
byteorder.h Clean up exported headers on CRIS 2006-09-21 09:33:55 +01:00
cache.h
cacheflush.h cris: remove unused global_flush_tlb 2008-07-24 10:47:24 -07:00
checksum.h cris build fixes: fix csum_tcpudp_magic() declaration 2007-11-14 18:45:44 -08:00
cputime.h
current.h
delay.h CRIS: Allow arch dependent delay to override common version. 2008-02-08 11:06:32 +01:00
device.h Driver core: add dev_archdata to struct device 2006-12-01 14:52:01 -08:00
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 Cleanup asm/{elf,page,user}.h: #ifdef __KERNEL__ is no longer needed 2008-02-07 08:42:30 -08:00
emergency-restart.h
errno.h
eshlibld.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
ethernet.h cris build fixes: update eth_v10.c ethernet driver 2007-11-14 18:45:45 -08:00
etraxgpio.h CRIS: Make io_pwm_set_period members unsigned in etraxgpio.h 2008-02-08 11:08:07 +01:00
etraxi2c.h
fasttimer.h CRISv10 improve and bugfix fasttimer 2007-11-14 18:45:47 -08:00
fb.h fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
fcntl.h
futex.h
hardirq.h cris build fixes: hardirq.h: include asm/irq.h 2007-11-14 18:45:45 -08:00
hw_irq.h [PATCH] genirq: add ->retrigger() irq op to consolidate hw_irq_resend() 2006-06-29 10:26:23 -07:00
io.h CRIS: Correct comment in io.h to describe reality of I/O space. 2008-02-08 11:06:32 +01:00
ioctl.h
ioctls.h etrax: enable arbitary speed setting on tty ports 2007-07-16 09:05:38 -07:00
ipcbuf.h
irq.h [PATCH] genirq: cleanup: turn ARCH_HAS_IRQ_PER_CPU into CONFIG_IRQ_PER_CPU 2006-06-29 10:26:23 -07:00
irq_regs.h softlockup: make asm/irq_regs.h available on every platform 2007-10-17 08:42:47 -07:00
Kbuild [CRIS] Correct definition of subdirs for install_headers. 2008-06-30 22:51:16 +02:00
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.h
mmu_context.h [PATCH] x86: PARAVIRT: add hooks to intercept mm creation and destruction 2007-05-02 19:27:14 +02:00
module.h
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 avoid overflows in kernel/time.c 2008-02-08 09:22:39 -08:00
pci.h PCI: remove pci_dac_dma_... APIs 2007-07-11 16:02:11 -07:00
percpu.h
pgalloc.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgtable.h cris: add constfy to pgd_offset() 2008-04-28 08:58:28 -07:00
poll.h Consolidate asm/poll.h 2007-05-11 08:29:34 -07:00
posix_types.h asm-*/posix_types.h: scrub __GLIBC__ 2008-02-08 09:22:34 -08:00
processor.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
ptrace.h include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
resource.h
rs485.h
rtc.h CRIS v10: Cleanup rtc.h 2008-02-08 11:06:29 +01:00
scatterlist.h Add CONFIG_DEBUG_SG sg validation 2007-10-22 21:20:03 +02:00
sections.h
segment.h
sembuf.h
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h [PATCH] irq-flags: CRIS: Use the new IRQF_ constants 2006-07-02 13:58:46 -07:00
smp.h CRIS: Update cpu_possible_map and raw_smp_processor_id in smp.h header. 2008-02-08 11:06:32 +01:00
socket.h [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
sockios.h [NET]: Introduce SIOCGSTAMPNS ioctl to get timestamps with nanosec resolution 2007-04-25 22:24:04 -07:00
spinlock.h
stat.h
statfs.h
string.h
sync_serial.h CRIS v32: Add SECOND_WORD_SYNC, used in sync_serial. 2008-02-08 11:06:23 +01:00
system.h Add cmpxchg_local to cris 2008-02-07 08:42:31 -08:00
termbits.h cris build fixes: add baud rate defines 2007-11-14 18:45:45 -08:00
termios.h etrax: enable arbitary speed setting on tty ports 2007-07-16 09:05:38 -07:00
thread_info.h clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
timex.h
tlb.h CRIS tlb.h should include linux/pagemap.h 2007-11-14 18:45:47 -08:00
tlbflush.h remove unused flush_tlb_pgtables 2007-10-19 11:53:34 -07:00
topology.h
types.h cris: types: use <asm-generic/int-*.h> for the cris architecture 2008-05-02 16:18:20 -07:00
uaccess.h cris: correct usage of __user for copy to and from user space in lib/usercopy and uaccess.h 2008-03-04 16:35:16 -08:00
ucontext.h
unaligned.h kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
unistd.h cris: correct syscall numbers in unistd.h for timerfd_settime and timerfd_gettime 2008-03-04 16:35:16 -08:00
user.h Sanitize the type of struct user.u_ar0 2008-02-07 08:42:30 -08:00