aha/include/asm-ia64
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
..
native [IA64] pvops: paravirtualize NR_IRQS 2008-05-27 15:09:30 -07:00
sn [IA64] Fix CONFIG_IA64_SGI_UV build error 2008-06-16 09:02:03 -07:00
uv [IA64] Update ia64 mmr list for SGI uv 2008-07-17 11:27:05 -07:00
a.out.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
acpi-ext.h
acpi.h [IA64] Minimize per_cpu reservations. 2008-04-08 13:51:35 -07:00
agp.h x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
asmmacro.h [IA64] remove per-cpu ia64_phys_stacked_size_p8 2007-02-06 15:04:18 -08:00
atomic.h [IA64] Use atomic64_read to read an atomic64_t. 2007-08-13 10:21:04 -07:00
auxvec.h
bitops.h generic: implement __fls on all 64-bit archs 2008-04-26 19:21:16 +02:00
break.h [IA64] enable trap code on slot 1 2006-12-12 12:00:55 -08:00
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h remove asm/bitops.h includes 2007-10-19 11:53:41 -07:00
checksum.h [PATCH] fix prototype of csum_ipv6_magic() (ia64) 2007-01-23 11:09:49 -08:00
compat.h asm-*/compat.h: fix typo in comment 2008-02-03 16:32:51 +02:00
cpu.h [IA64] fix section mismatch in arch/ia64/kernel/topology.c 2008-04-30 14:08:07 -07:00
cputime.h [IA64] VIRT_CPU_ACCOUNTING (accurate cpu time accounting) 2008-02-20 12:55:37 -08:00
current.h
cyclone.h
delay.h
device.h ACPI: Change ACPI to use dev_archdata instead of firmware_data 2006-12-01 14:52:01 -08:00
div64.h
dma-mapping.h dma/ia64: update ia64 machvecs, swiotlb.c 2008-04-29 08:06:12 -07:00
dma.h [IA64] swiotlb bug fixes 2007-02-05 18:46:40 -08:00
dmi.h dmi: clean-up dmi helper declarations 2008-05-01 08:04:01 -07:00
elf.h [IA64] use CORE_DUMP_USE_REGSET 2008-03-12 16:27:35 -07:00
emergency-restart.h
errno.h
esi.h [IA64] remove bogus prototype ia64_esi_init() 2007-02-05 14:14:29 -08:00
fb.h fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
fcntl.h
fpswa.h
fpu.h
futex.h asm-*/futex.h should include linux/uaccess.h 2008-04-30 08:29:52 -07:00
gcc_intrin.h [IA64] pvops: introduce pv_cpu_ops to paravirtualize privileged instructions. 2008-05-27 14:40:18 -07:00
hardirq.h
hpsim.h [IA64] Cleanup HPSIM code (was: Re: Enable early console for Ski simulator) 2007-09-01 02:52:25 -07:00
hugetlb.h hugetlb: modular state for hugetlb page size 2008-07-24 10:47:17 -07:00
hw_irq.h [IA64] pvops: add hooks, pv_irq_ops, to paravirtualized irq related operations. 2008-05-27 15:11:10 -07:00
ia32.h [IA64] rename partial_page 2007-07-25 12:56:39 -07:00
ia64regs.h
intel_intrin.h [IA64] pvops: introduce pv_cpu_ops to paravirtualize privileged instructions. 2008-05-27 14:40:18 -07:00
intrinsics.h [IA64] pvops: introduce pv_cpu_ops to paravirtualize privileged instructions. 2008-05-27 14:40:18 -07:00
io.h dmi: clean-up dmi helper declarations 2008-05-01 08:04:01 -07:00
ioctl.h
ioctls.h [IA64] arbitary speed tty ioctl support 2007-07-13 16:04:12 -07:00
iosapic.h [IA64] pvops: add hooks, pv_iosapic_ops, to paravirtualize iosapic. 2008-05-27 15:10:41 -07:00
ipcbuf.h
irq.h [IA64] pvops: paravirtualize NR_IRQS 2008-05-27 15:09:30 -07:00
irq_regs.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
Kbuild [IA64] pvops: introduce pv_cpu_ops to paravirtualize privileged instructions. 2008-05-27 14:40:18 -07:00
kdebug.h x86: optimize page faults like all other achitectures and kill notifier cruft 2007-10-16 09:42:50 -07:00
kexec.h kdump/kexec: calculate note size at compile time 2007-05-08 11:15:07 -07:00
kmap_types.h
kprobes.h [IA64] kprobes: kprobe-booster for ia64 2008-04-09 10:36:43 -07:00
kregs.h [IA64] Add API for allocating Dynamic TR resource. 2008-04-03 11:02:58 -07:00
kvm.h KVM: ia64: Set KVM_IOAPIC_NUM_PINS to 48 2008-05-18 14:34:16 +03:00
kvm_host.h KVM: Add coalesced MMIO support (ia64 part) 2008-07-20 12:42:31 +03:00
kvm_para.h KVM: ia64: Add header files for kvm/ia64 2008-04-27 12:01:02 +03:00
libata-portmap.h ATA convert GSI to irq on ia64 2007-02-15 18:04:53 -05:00
linkage.h
local.h local_t: ia64 extension 2007-05-08 11:15:20 -07:00
machvec.h dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
machvec_dig.h
machvec_hpsim.h
machvec_hpzx1.h dma/ia64: update ia64 machvecs, swiotlb.c 2008-04-29 08:06:12 -07:00
machvec_hpzx1_swiotlb.h dma/ia64: update ia64 machvecs, swiotlb.c 2008-04-29 08:06:12 -07:00
machvec_init.h [IA64] SN2 needs platform specific irq_to_vector() function. 2007-08-13 10:31:26 -07:00
machvec_sn2.h dma/ia64: update ia64 machvecs, swiotlb.c 2008-04-29 08:06:12 -07:00
machvec_uv.h [IA64] machvec support for SGI UV platform 2008-05-14 14:22:04 -07:00
mc146818rtc.h
mca.h [IA64] simplify notify hooks in mca.c 2008-04-22 08:56:38 -07:00
mca_asm.h [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
meminit.h [IA64] Fix NUMA configuration issue 2008-04-11 15:21:35 -07:00
mman.h
mmu.h
mmu_context.h [IA64] pvops: preparation: introduce ia64_set_rr0_to_rr4() to make kernel paravirtualization friendly. 2008-05-27 14:38:44 -07:00
mmzone.h
module.h
msgbuf.h
mutex.h
namei.h
nodedata.h
numa.h [IA64] Minimize per_cpu reservations. 2008-04-08 13:51:35 -07:00
page.h PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
pal.h [IA64] Itanium Spec updates 2008-04-09 13:05:54 -07:00
param.h [IA64] Fix build for sim_defconfig 2008-02-11 13:23:46 -08:00
paravirt.h [IA64] pvops: add to hooks, pv_time_ops, for steal time accounting. 2008-05-27 15:11:42 -07:00
paravirt_privop.h [IA64] pvops: paravirtualize entry.S 2008-05-27 15:08:01 -07:00
parport.h
patch.h [IA64] Workaround for RSE issue 2008-05-27 13:24:39 -07:00
pci.h [IA64] Un-break ia64 build 2007-07-12 16:04:39 -07:00
percpu.h ia64: on UP percpu variables are not small memory model 2008-01-30 23:27:58 +01:00
perfmon.h
perfmon_default_smpl.h
pgalloc.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgtable.h mm: introduce pte_special pte bit 2008-04-28 08:58:23 -07:00
poll.h Consolidate asm/poll.h 2007-05-11 08:29:34 -07:00
posix_types.h [PATCH] FD_ZERO build fix 2007-01-11 18:18:22 -08:00
processor.h ACPI : Create "idle=nomwait" bootparam 2008-07-16 23:27:05 +02:00
ptrace.h [IA64] Workaround for RSE issue 2008-05-27 13:24:39 -07:00
ptrace_offsets.h
resource.h [IA64] Remove stack hard limit on ia64 2007-03-06 14:48:19 -08:00
rse.h
rwsem.h [IA64] Prevent people from directly including <asm/rwsem.h>. 2007-07-20 11:27:11 -07:00
sal.h [IA64] Kernel parameter for max number of concurrent global TLB purges 2008-04-04 11:06:38 -07:00
scatterlist.h Add CONFIG_DEBUG_SG sg validation 2007-10-22 21:20:03 +02:00
sections.h [IA64] Workaround for RSE issue 2008-05-27 13:24:39 -07:00
segment.h
sembuf.h
serial.h
setup.h [PATCH] ia64: 2048-byte command line 2007-02-12 09:48:39 -08:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h Pull pvops into release branch 2008-07-17 10:53:37 -07: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
sparsemem.h
spinlock.h remove asm/bitops.h includes 2007-10-19 11:53:41 -07:00
spinlock_types.h
stat.h
statfs.h
string.h
suspend.h
system.h [IA64] pvops: preparation: introduce ia64_get_psr_i() to make kernel paravirtualization friendly. 2008-05-27 14:39:07 -07:00
termbits.h [IA64] arbitary speed tty ioctl support 2007-07-13 16:04:12 -07:00
termios.h [IA64] arbitary speed tty ioctl support 2007-07-13 16:04:12 -07:00
thread_info.h clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
timex.h
tlb.h [IA64] Add API for allocating Dynamic TR resource. 2008-04-03 11:02:58 -07:00
tlbflush.h [IA64] Multiple outstanding ptc.g instruction support 2008-04-04 11:05:59 -07:00
topology.h [IA64] Provide ACPI fixup for /proc/cpuinfo/physical_id 2008-04-29 15:05:29 -07:00
types.h ia64: types: use <asm-generic/int-*.h> for the ia64 architecture 2008-05-02 16:18:21 -07:00
uaccess.h [IA64] don't double >> PAGE_SHIFT pointer for /dev/kmem access 2006-10-26 14:57:06 -07:00
ucontext.h
unaligned.h kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
uncached.h [IA64] allocate multiple contiguous pages via uncached allocator 2008-04-29 13:49:01 -07:00
unistd.h [IA64] Wire up new system calls 2008-07-25 10:10:28 -07:00
unwind.h [IA64] Remove sparse warning from unwind code 2007-03-08 10:28:48 -08:00
user.h Sanitize the type of struct user.u_ar0 2008-02-07 08:42:30 -08:00
ustack.h arch: personality independent stack top 2007-07-19 10:04:45 -07:00
vga.h
xor.h