kernel-hacking-2024-linux-s.../include/asm-x86
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
..
mach-bigsmp x86: APIC: remove apic_write_around(); use alternatives 2008-07-18 12:51:21 +02:00
mach-default x86: convert Dprintk to pr_debug 2008-07-21 21:35:38 +02:00
mach-es7000 x86: APIC: remove apic_write_around(); use alternatives 2008-07-18 12:51:21 +02:00
mach-generic x86: extend and use x86_quirks to clean up NUMAQ code 2008-07-20 09:25:52 +02:00
mach-numaq x86: remove unused file after numaq etc depends on genericarch 2008-07-08 10:38:54 +02:00
mach-rdc321x
mach-summit x86: APIC: remove apic_write_around(); use alternatives 2008-07-18 12:51:21 +02:00
mach-voyager Merge branch 'generic-ipi' into generic-ipi-for-linus 2008-07-15 21:55:59 +02:00
uv x86 BIOS interface for RTC on SGI UV 2008-07-18 14:35:14 +02:00
visws x86, VisWS: turn into generic arch, move definitions 2008-07-10 18:55:40 +02:00
xen x86: rename PTE_MASK to PTE_PFN_MASK 2008-07-22 10:43:44 +02:00
a.out-core.h
a.out.h
acpi.h x86: use acpi_numa_init to parse on 32-bit numa 2008-07-08 10:38:47 +02:00
agp.h
alternative-asm.h
alternative.h ftrace: use nops instead of jmp 2008-05-23 20:33:28 +02:00
amd_iommu.h x86, AMD IOMMU: add amd_iommu.h to export functions to the generic x86 dma code 2008-06-27 10:12:21 +02:00
amd_iommu_types.h x86, AMD IOMMU: replace DEVID macro with a function 2008-07-11 18:01:18 +02:00
apic.h x86: convert Dprintk to pr_debug 2008-07-21 21:35:38 +02:00
apicdef.h
arch_hooks.h x86: add ->pre_time_init to x86_quirks 2008-07-20 09:25:52 +02:00
asm.h x86: use macros from asm.h. 2008-07-09 09:14:12 +02:00
atomic.h
atomic_32.h
atomic_64.h Merge branch 'x86/uv' into x86/devel 2008-07-08 12:24:13 +02:00
auxvec.h
bios_ebda.h x86: extract common part of head32.c and head64.c into head.c 2008-06-05 15:10:02 +02:00
bitops.h x86, cleanup: fix description of __fls(): __fls(0) is undefined 2008-07-18 14:32:38 +02:00
boot.h
bootparam.h x86: move reserve_setup_data to setup.c 2008-07-08 13:16:14 +02:00
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h
calgary.h
calling.h x86 ptrace: unify syscall tracing 2008-07-16 12:15:17 -07:00
checksum.h
checksum_32.h
checksum_64.h
cmpxchg.h
cmpxchg_32.h
cmpxchg_64.h x86, 64-bit: add sync_cmpxchg 2008-07-08 13:10:58 +02:00
compat.h
cpu.h
cpufeature.h x86: APIC: remove apic_write_around(); use alternatives 2008-07-18 12:51:21 +02:00
cputime.h
current.h x86: unify current.h 2008-05-25 08:58:35 +02:00
debugreg.h
delay.h x86: delay lib unification build fix 2008-07-09 09:13:59 +02:00
desc.h Merge commit 'v2.6.26' into x86/core 2008-07-14 11:37:46 +02:00
desc_defs.h x86, 64-bit: add gate_offset() and gate_segment() macros 2008-07-08 13:10:28 +02:00
device.h dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07: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
dmi.h x86: use acpi_numa_init to parse on 32-bit numa 2008-07-08 10:38:47 +02:00
ds.h
dwarf2.h x86: Fix compile error with CONFIG_AS_CFI=n 2008-07-15 15:30:29 +02:00
e820.h x86: seperate memtest from init_64.c 2008-07-18 14:10:27 +02:00
edac.h
efi.h x86: reserve EFI memory map with reserve_early 2008-06-05 15:10:02 +02:00
elf.h x86/paravirt, 64-bit: make load_gs_index() a paravirt operation 2008-07-08 13:15:58 +02:00
emergency-restart.h
errno.h
fb.h
fcntl.h
fixmap.h x86/paravirt/xen: add set_fixmap pv_mmu_ops 2008-06-20 15:09:56 +02:00
fixmap_32.h x86: i386: reduce boot fixmap space 2008-07-18 16:17:52 -07:00
fixmap_64.h x86: make 64bit hpet_set_mapping to use ioremap too, v2 2008-07-14 09:24:17 +02:00
floppy.h
frame.h
ftrace.h ftrace: copy + paste typo in asm/ftrace.h 2008-07-18 13:14:08 +02:00
futex.h
gart.h x86: make only GART code include gart.h 2008-07-11 11:00:54 +02:00
genapic.h
genapic_32.h x86: I/O APIC: remove an IRQ2-mask hack 2008-07-13 11:43:48 +02:00
genapic_64.h x86: I/O APIC: remove an IRQ2-mask hack 2008-07-13 11:43:48 +02:00
geode.h x86, geode: add a VSA2 ID for General Software 2008-06-19 14:19:03 +02:00
gpio.h gpiolib: allow user-selection 2008-07-25 10:53:30 -07:00
hardirq.h x86: make /proc/stat account for all interrupts 2008-05-25 07:11:49 +02:00
hardirq_32.h
hardirq_64.h
highmem.h x86: kill bad_ppro 2008-07-08 10:38:19 +02:00
hpet.h x86: merge tsc calibration 2008-07-09 07:43:25 +02:00
hugetlb.h hugetlb: modular state for hugetlb page size 2008-07-24 10:47:17 -07:00
hw_irq.h Merge branch 'generic-ipi' into generic-ipi-for-linus 2008-07-15 21:55:59 +02:00
hypertransport.h
i387.h x86-64: Clean up 'save/restore_i387()' usage 2008-07-24 16:12:40 -07:00
i8253.h
i8259.h x86: automatical unification of i8259.c 2008-05-24 16:44:26 +02:00
ia32.h
ia32_unistd.h
idle.h
intel_arch_perfmon.h
io.h - x86: move early_ioremap prototypes to io.h 2008-07-08 13:16:12 +02:00
io_32.h access_process_vm device memory infrastructure 2008-07-24 10:47:15 -07:00
io_64.h access_process_vm device memory infrastructure 2008-07-24 10:47:15 -07:00
io_apic.h x86: let setup_arch call init_apic_mappings for 32bit 2008-07-08 13:16:04 +02:00
ioctl.h
ioctls.h
iommu.h x86: remove ifdef CONFIG_GART_IOMMU in pci-dma.c 2008-07-11 11:00:54 +02:00
ipcbuf.h
ipi.h Merge branch 'linus' into cpus4096 2008-07-16 00:29:07 +02:00
irq.h x86: unify irq.h 2008-05-12 21:28:05 +02:00
irq_regs.h
irq_regs_32.h
irq_regs_64.h
irq_vectors.h Merge branch 'generic-ipi' into generic-ipi-for-linus 2008-07-15 21:55:59 +02:00
irqflags.h Merge branch 'auto-ftrace-next' into tracing/for-linus 2008-07-14 16:11:52 +02:00
ist.h
k8.h
Kbuild Merge git://git.infradead.org/~dwmw2/random-2.6 2008-07-25 12:01:37 -07:00
kdebug.h x86: mmiotrace full patch, preview 1 2008-05-24 11:22:12 +02:00
kexec.h
kgdb.h
kmap_types.h
kprobes.h
kvm.h KVM: SVM: add tracing support for TDP page faults 2008-07-20 12:40:48 +03:00
kvm_host.h KVM: fix exception entry / build bug, on 64-bit 2008-07-21 11:03:32 +02:00
kvm_para.h x86: KVM guest: Add memory clobber to hypercalls 2008-07-06 11:05:18 +03:00
kvm_x86_emulate.h KVM: x86 emulator: lazily evaluate segment registers 2008-07-20 12:42:35 +03:00
ldt.h
lguest.h
lguest_hcall.h
linkage.h
local.h
math_emu.h
mc146818rtc.h
mca.h
mca_dma.h
mce.h
mman.h
mmconfig.h fix build bug in "x86: add PCI extended config space access for AMD Barcelona" 2008-06-10 12:32:53 +02:00
mmu.h
mmu_context.h x86: unify mmu_context.h 2008-07-08 13:10:31 +02:00
mmu_context_32.h x86: unify mmu_context.h 2008-07-08 13:10:31 +02:00
mmu_context_64.h x86: unify mmu_context.h 2008-07-08 13:10:31 +02:00
mmx.h
mmzone.h
mmzone_32.h x86: make generic arch support NUMAQ 2008-06-10 11:34:42 +02:00
mmzone_64.h
module.h
mpspec.h Merge branch 'x86/uv' into x86/devel 2008-07-08 12:24:13 +02:00
mpspec_def.h x86: increase MAX_APICS for very large x86-64 configs 2008-07-08 12:23:29 +02:00
msgbuf.h
msidef.h
msr-index.h x86: cleanup C1E enabled detection 2008-06-10 15:52:07 +02:00
msr.h x86: add memory barriers to wrmsr 2008-07-08 13:10:24 +02:00
mtrr.h
mutex.h
mutex_32.h
mutex_64.h
namei.h
nmi.h x86: nmi_watchdog - introduce nmi_watchdog_active() helper 2008-07-08 12:51:42 +02:00
nops.h
numa.h
numa_32.h x86: introduce init_memory_mapping for 32bit #3 2008-07-08 13:10:33 +02:00
numa_64.h x86: introduce initmem_init for 64 bit 2008-07-08 12:50:14 +02:00
numaq.h x86: fix numaq_tsc_disable calling 2008-07-13 08:19:45 +02:00
olpc.h
page.h PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
page_32.h x86: merge zones_sizes_init for numa and non numa on 32-bit 2008-07-08 13:16:22 +02:00
page_64.h x86: map UV chipset space - pagetable 2008-07-09 07:43:23 +02:00
param.h
paravirt.h x86: rename PTE_MASK to PTE_PFN_MASK 2008-07-22 10:43:44 +02:00
parport.h
pat.h x86: rename pat_wc_enabled to pat_enabled 2008-06-12 10:14:27 +02:00
pci-direct.h PCI/x86: early dump pci conf space v2 2008-06-10 10:59:52 -07:00
pci.h x86: move pci_routirq declaration to pci.h 2008-07-08 09:13:08 +02:00
pci_32.h x86: add compilation checks to pci_unmap_*() macros 2008-06-30 12:22:01 +02:00
pci_64.h
pda.h x86: remove static boot_cpu_pda array v2 2008-07-08 11:31:25 +02:00
percpu.h x86_64: add workaround for no %gs-based percpu 2008-07-16 10:58:13 +02:00
pgalloc.h x86/paravirt: add a pgd_alloc/free hooks 2008-07-08 13:11:01 +02:00
pgtable-2level-defs.h
pgtable-2level.h
pgtable-3level-defs.h
pgtable-3level.h x86: rename PTE_MASK to PTE_PFN_MASK 2008-07-22 10:43:44 +02:00
pgtable.h x86: add PTE_FLAGS_MASK 2008-07-22 10:43:45 +02:00
pgtable_32.h x86: add PTE_FLAGS_MASK 2008-07-22 10:43:45 +02:00
pgtable_64.h x86: rename PTE_MASK to PTE_PFN_MASK 2008-07-22 10:43:44 +02:00
poll.h
posix_types.h
posix_types_32.h
posix_types_64.h
prctl.h
processor-cyrix.h
processor-flags.h x86: fix header export, asm-x86/processor-flags.h, CONFIG_* leaks 2008-07-24 12:49:53 +02:00
processor.h Merge branch 'cpus4096-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-23 18:37:44 -07:00
proto.h x86: add flags parameter to reserve_bootmem_generic() 2008-07-08 11:49:49 +02:00
ptrace-abi.h x86 ptrace: unify syscall tracing 2008-07-16 12:15:17 -07:00
ptrace.h x86: break mutual header inclusion 2008-06-02 12:48:23 +02:00
pvclock-abi.h x86: Add structs and functions for paravirt clocksource 2008-06-24 21:02:31 +03:00
pvclock.h x86: Add structs and functions for paravirt clocksource 2008-06-24 21:02:31 +03:00
reboot.h x86: constify data in reboot.c 2008-05-25 08:58:30 +02:00
reboot_fixups.h
required-features.h x86, 64-bit: PSE no longer a hard requirement 2008-07-08 13:11:08 +02:00
resource.h
resume-trace.h x86: move tracedata to RODATA 2008-05-25 07:09:47 +02:00
rio.h
rtc.h
rwlock.h
rwsem.h
scatterlist.h
seccomp.h
seccomp_32.h x86: fix incomplete include guard in include/asm-x86/seccomp_32.h 2008-06-02 12:45:28 +02:00
seccomp_64.h x86: more header fixes 2008-06-18 12:27:03 +02:00
sections.h
segment.h x86: unify and correct the GDT_ENTRY() macro 2008-07-17 11:29:24 -07:00
sembuf.h
serial.h
setup.h Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus 2008-07-21 16:37:17 +02:00
shmbuf.h
shmparam.h
sigcontext.h
sigcontext32.h
siginfo.h
signal.h Fix typos from signal_32/64.h merge 2008-07-18 17:59:13 +02:00
smp.h x86_64: unstatic get_local_pda 2008-07-16 10:55:07 +02:00
socket.h
sockios.h
sparsemem.h
spinlock.h paravirt: introduce a "lock-byte" spinlock implementation 2008-07-16 11:15:53 +02:00
spinlock_types.h x86/paravirt: add hooks for spinlock operations 2008-07-16 11:15:52 +02:00
srat.h x86: remove acpi_srat config v2 2008-07-08 15:49:08 +02:00
stacktrace.h
stat.h
statfs.h
string.h
string_32.h x86: string_32.h: workaround for broken gcc 4.0 2008-05-26 13:36:53 -07:00
string_64.h
suspend.h
suspend_32.h x86: more header fixes 2008-06-18 12:27:03 +02:00
suspend_64.h
swiotlb.h dma-mapping: add the device argument to dma_mapping_error() 2008-07-26 12:00:03 -07:00
sync_bitops.h
system.h x86: fix savesegment() bug causing crashes on 64-bit 2008-07-11 19:51:47 +02:00
system_64.h
tce.h
termbits.h
termios.h
therm_throt.h
thread_info.h clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
time.h x86: merge tsc_init and clocksource code 2008-07-09 07:43:27 +02:00
timer.h x86: rename paravirtualized TSC functions 2008-07-09 07:43:28 +02:00
timex.h
tlb.h
tlbflush.h x86: prevent PGE flush from interruption/preemption 2008-05-23 18:16:15 +02:00
topology.h x86: change _node_to_cpumask_ptr to return const ptr 2008-07-13 19:11:58 +02:00
trampoline.h
traps.h x86: introducing asm-x86/traps.h 2008-07-18 18:51:57 +02:00
tsc.h x86: merge tsc_init and clocksource code 2008-07-09 07:43:27 +02:00
types.h
uaccess.h x86: define architectural characteristics in uaccess.h. 2008-07-09 09:14:29 +02:00
uaccess_32.h x86: define architectural characteristics in uaccess.h. 2008-07-09 09:14:29 +02:00
uaccess_64.h x86: introduce copy_user_handle_tail() routine 2008-07-09 15:51:03 +02:00
ucontext.h
unaligned.h
unistd.h
unistd_32.h flag parameters add-on: remove epoll_create size param 2008-07-24 10:47:29 -07:00
unistd_64.h flag parameters add-on: remove epoll_create size param 2008-07-24 10:47:29 -07:00
unwind.h
user.h
user32.h
user_32.h
user_64.h
vdso.h x86_64: further cleanup of 32-bit compat syscall mechanisms 2008-07-16 11:08:27 +02:00
vga.h
vgtod.h
vic.h
vm86.h x86: break mutual header inclusion 2008-06-02 12:48:23 +02:00
vmi.h
vmi_time.h x86: rename paravirtualized TSC functions 2008-07-09 07:43:28 +02:00
voyager.h
vsyscall.h x86: add notrace annotations to vsyscall. 2008-05-23 20:31:39 +02:00
xor.h
xor_32.h x86: more header fixes 2008-06-18 12:27:03 +02:00
xor_64.h x86: more header fixes 2008-06-18 12:27:03 +02:00