aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 23:58:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 23:58:09 -0500
commit2a7d2b96d5cba7568139d9ab157a0e97ab32440f (patch)
treead029d8cc7b7068b7250e914360ec6315fdfa114 /arch
parente3c4877de8b9d93bd47b6ee88eb594b1c1e10da5 (diff)
parentb67bfe0d42cac56c512dd5da4b1b347a23f4b70a (diff)
Merge branch 'akpm' (final batch from Andrew)
Merge third patch-bumb from Andrew Morton: "This wraps me up for -rc1. - Lots of misc stuff and things which were deferred/missed from patchbombings 1 & 2. - ocfs2 things - lib/scatterlist - hfsplus - fatfs - documentation - signals - procfs - lockdep - coredump - seqfile core - kexec - Tejun's large IDR tree reworkings - ipmi - partitions - nbd - random() things - kfifo - tools/testing/selftests updates - Sasha's large and pointless hlist cleanup" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (163 commits) hlist: drop the node parameter from iterators kcmp: make it depend on CHECKPOINT_RESTORE selftests: add a simple doc tools/testing/selftests/Makefile: rearrange targets selftests/efivarfs: add create-read test selftests/efivarfs: add empty file creation test selftests: add tests for efivarfs kfifo: fix kfifo_alloc() and kfifo_init() kfifo: move kfifo.c from kernel/ to lib/ arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS w1: add support for DS2413 Dual Channel Addressable Switch memstick: move the dereference below the NULL test drivers/pps/clients/pps-gpio.c: use devm_kzalloc Documentation/DMA-API-HOWTO.txt: fix typo include/linux/eventfd.h: fix incorrect filename is a comment mtd: mtd_stresstest: use prandom_bytes() mtd: mtd_subpagetest: convert to use prandom library mtd: mtd_speedtest: use prandom_bytes mtd: mtd_pagetest: convert to use prandom library mtd: mtd_oobtest: convert to use prandom library ...
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig7
-rw-r--r--arch/alpha/Kconfig1
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/kernel/kprobes.c6
-rw-r--r--arch/avr32/Kconfig1
-rw-r--r--arch/blackfin/Kconfig1
-rw-r--r--arch/cris/Kconfig1
-rw-r--r--arch/frv/Kconfig1
-rw-r--r--arch/frv/mm/elf-fdpic.c49
-rw-r--r--arch/h8300/Kconfig1
-rw-r--r--arch/ia64/Kconfig1
-rw-r--r--arch/ia64/kernel/kprobes.c8
-rw-r--r--arch/m32r/Kconfig1
-rw-r--r--arch/m68k/Kconfig1
-rw-r--r--arch/microblaze/Kconfig1
-rw-r--r--arch/mips/Kconfig1
-rw-r--r--arch/mips/kernel/kprobes.c6
-rw-r--r--arch/mn10300/Kconfig1
-rw-r--r--arch/openrisc/Kconfig1
-rw-r--r--arch/parisc/Kconfig1
-rw-r--r--arch/parisc/kernel/sys_parisc.c48
-rw-r--r--arch/powerpc/Kconfig4
-rw-r--r--arch/powerpc/kernel/kprobes.c6
-rw-r--r--arch/powerpc/kvm/book3s_mmu_hpte.c18
-rw-r--r--arch/s390/Kconfig1
-rw-r--r--arch/s390/kernel/kprobes.c8
-rw-r--r--arch/s390/pci/pci_msi.c3
-rw-r--r--arch/score/Kconfig1
-rw-r--r--arch/sh/Kconfig3
-rw-r--r--arch/sh/kernel/kprobes.c6
-rw-r--r--arch/sparc/Kconfig3
-rw-r--r--arch/sparc/kernel/kprobes.c6
-rw-r--r--arch/sparc/kernel/ldc.c3
-rw-r--r--arch/tile/Kconfig1
-rw-r--r--arch/unicore32/Kconfig1
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/kernel/kprobes/core.c8
-rw-r--r--arch/x86/kvm/mmu.c26
-rw-r--r--arch/xtensa/Kconfig1
39 files changed, 108 insertions, 131 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 40e2b12c7916..dcd91a85536a 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -303,6 +303,13 @@ config ARCH_WANT_OLD_COMPAT_IPC
303 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION 303 select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
304 bool 304 bool
305 305
306config HAVE_VIRT_TO_BUS
307 bool
308 help
309 An architecture should select this if it implements the
310 deprecated interface virt_to_bus(). All new architectures
311 should probably not select this.
312
306config HAVE_ARCH_SECCOMP_FILTER 313config HAVE_ARCH_SECCOMP_FILTER
307 bool 314 bool
308 help 315 help
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 1ecbf7a1b677..5833aa441481 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -9,6 +9,7 @@ config ALPHA
9 select HAVE_PERF_EVENTS 9 select HAVE_PERF_EVENTS
10 select HAVE_DMA_ATTRS 10 select HAVE_DMA_ATTRS
11 select HAVE_GENERIC_HARDIRQS 11 select HAVE_GENERIC_HARDIRQS
12 select HAVE_VIRT_TO_BUS
12 select GENERIC_IRQ_PROBE 13 select GENERIC_IRQ_PROBE
13 select AUTO_IRQ_AFFINITY if SMP 14 select AUTO_IRQ_AFFINITY if SMP
14 select GENERIC_IRQ_SHOW 15 select GENERIC_IRQ_SHOW
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6ec8eb3149ea..0e16cca1d011 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -49,6 +49,7 @@ config ARM
49 select HAVE_REGS_AND_STACK_ACCESS_API 49 select HAVE_REGS_AND_STACK_ACCESS_API
50 select HAVE_SYSCALL_TRACEPOINTS 50 select HAVE_SYSCALL_TRACEPOINTS
51 select HAVE_UID16 51 select HAVE_UID16
52 select HAVE_VIRT_TO_BUS
52 select KTIME_SCALAR 53 select KTIME_SCALAR
53 select PERF_USE_VMALLOC 54 select PERF_USE_VMALLOC
54 select RTC_LIB 55 select RTC_LIB
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
index 4dd41fc9e235..170e9f34003f 100644
--- a/arch/arm/kernel/kprobes.c
+++ b/arch/arm/kernel/kprobes.c
@@ -395,7 +395,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
395{ 395{
396 struct kretprobe_instance *ri = NULL; 396 struct kretprobe_instance *ri = NULL;
397 struct hlist_head *head, empty_rp; 397 struct hlist_head *head, empty_rp;
398 struct hlist_node *node, *tmp; 398 struct hlist_node *tmp;
399 unsigned long flags, orig_ret_address = 0; 399 unsigned long flags, orig_ret_address = 0;
400 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; 400 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
401 401
@@ -415,7 +415,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
415 * real return address, and all the rest will point to 415 * real return address, and all the rest will point to
416 * kretprobe_trampoline 416 * kretprobe_trampoline
417 */ 417 */
418 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 418 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
419 if (ri->task != current) 419 if (ri->task != current)
420 /* another task is sharing our hash bucket */ 420 /* another task is sharing our hash bucket */
421 continue; 421 continue;
@@ -442,7 +442,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
442 kretprobe_assert(ri, orig_ret_address, trampoline_address); 442 kretprobe_assert(ri, orig_ret_address, trampoline_address);
443 kretprobe_hash_unlock(current, &flags); 443 kretprobe_hash_unlock(current, &flags);
444 444
445 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 445 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
446 hlist_del(&ri->hlist); 446 hlist_del(&ri->hlist);
447 kfree(ri); 447 kfree(ri);
448 } 448 }
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 2ae6591b3a55..9b89257b2cfd 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -7,6 +7,7 @@ config AVR32
7 select HAVE_OPROFILE 7 select HAVE_OPROFILE
8 select HAVE_KPROBES 8 select HAVE_KPROBES
9 select HAVE_GENERIC_HARDIRQS 9 select HAVE_GENERIC_HARDIRQS
10 select HAVE_VIRT_TO_BUS
10 select GENERIC_IRQ_PROBE 11 select GENERIC_IRQ_PROBE
11 select GENERIC_ATOMIC64 12 select GENERIC_ATOMIC64
12 select HARDIRQS_SW_RESEND 13 select HARDIRQS_SW_RESEND
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index e98f3248c8aa..600494c70e96 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -33,6 +33,7 @@ config BLACKFIN
33 select ARCH_HAVE_CUSTOM_GPIO_H 33 select ARCH_HAVE_CUSTOM_GPIO_H
34 select ARCH_WANT_OPTIONAL_GPIOLIB 34 select ARCH_WANT_OPTIONAL_GPIOLIB
35 select HAVE_UID16 35 select HAVE_UID16
36 select HAVE_VIRT_TO_BUS
36 select ARCH_WANT_IPC_PARSE_VERSION 37 select ARCH_WANT_IPC_PARSE_VERSION
37 select HAVE_GENERIC_HARDIRQS 38 select HAVE_GENERIC_HARDIRQS
38 select GENERIC_ATOMIC64 39 select GENERIC_ATOMIC64
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 0e5c187ac7d2..bb0ac66cf533 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -43,6 +43,7 @@ config CRIS
43 select GENERIC_ATOMIC64 43 select GENERIC_ATOMIC64
44 select HAVE_GENERIC_HARDIRQS 44 select HAVE_GENERIC_HARDIRQS
45 select HAVE_UID16 45 select HAVE_UID16
46 select HAVE_VIRT_TO_BUS
46 select ARCH_WANT_IPC_PARSE_VERSION 47 select ARCH_WANT_IPC_PARSE_VERSION
47 select GENERIC_IRQ_SHOW 48 select GENERIC_IRQ_SHOW
48 select GENERIC_IOMAP 49 select GENERIC_IOMAP
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 2d0509d4cfee..12369b194c7b 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -6,6 +6,7 @@ config FRV
6 select HAVE_PERF_EVENTS 6 select HAVE_PERF_EVENTS
7 select HAVE_UID16 7 select HAVE_UID16
8 select HAVE_GENERIC_HARDIRQS 8 select HAVE_GENERIC_HARDIRQS
9 select HAVE_VIRT_TO_BUS
9 select GENERIC_IRQ_SHOW 10 select GENERIC_IRQ_SHOW
10 select HAVE_DEBUG_BUGVERBOSE 11 select HAVE_DEBUG_BUGVERBOSE
11 select ARCH_HAVE_NMI_SAFE_CMPXCHG 12 select ARCH_HAVE_NMI_SAFE_CMPXCHG
diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c
index 385fd30b142f..836f14707a62 100644
--- a/arch/frv/mm/elf-fdpic.c
+++ b/arch/frv/mm/elf-fdpic.c
@@ -60,7 +60,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
60 unsigned long pgoff, unsigned long flags) 60 unsigned long pgoff, unsigned long flags)
61{ 61{
62 struct vm_area_struct *vma; 62 struct vm_area_struct *vma;
63 unsigned long limit; 63 struct vm_unmapped_area_info info;
64 64
65 if (len > TASK_SIZE) 65 if (len > TASK_SIZE)
66 return -ENOMEM; 66 return -ENOMEM;
@@ -79,39 +79,24 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
79 } 79 }
80 80
81 /* search between the bottom of user VM and the stack grow area */ 81 /* search between the bottom of user VM and the stack grow area */
82 addr = PAGE_SIZE; 82 info.flags = 0;
83 limit = (current->mm->start_stack - 0x00200000); 83 info.length = len;
84 if (addr + len <= limit) { 84 info.low_limit = PAGE_SIZE;
85 limit -= len; 85 info.high_limit = (current->mm->start_stack - 0x00200000);
86 86 info.align_mask = 0;
87 if (addr <= limit) { 87 info.align_offset = 0;
88 vma = find_vma(current->mm, PAGE_SIZE); 88 addr = vm_unmapped_area(&info);
89 for (; vma; vma = vma->vm_next) { 89 if (!(addr & ~PAGE_MASK))
90 if (addr > limit) 90 goto success;
91 break; 91 VM_BUG_ON(addr != -ENOMEM);
92 if (addr + len <= vma->vm_start)
93 goto success;
94 addr = vma->vm_end;
95 }
96 }
97 }
98 92
99 /* search from just above the WorkRAM area to the top of memory */ 93 /* search from just above the WorkRAM area to the top of memory */
100 addr = PAGE_ALIGN(0x80000000); 94 info.low_limit = PAGE_ALIGN(0x80000000);
101 limit = TASK_SIZE - len; 95 info.high_limit = TASK_SIZE;
102 if (addr <= limit) { 96 addr = vm_unmapped_area(&info);
103 vma = find_vma(current->mm, addr); 97 if (!(addr & ~PAGE_MASK))
104 for (; vma; vma = vma->vm_next) { 98 goto success;
105 if (addr > limit) 99 VM_BUG_ON(addr != -ENOMEM);
106 break;
107 if (addr + len <= vma->vm_start)
108 goto success;
109 addr = vma->vm_end;
110 }
111
112 if (!vma && addr <= limit)
113 goto success;
114 }
115 100
116#if 0 101#if 0
117 printk("[area] l=%lx (ENOMEM) f='%s'\n", 102 printk("[area] l=%lx (ENOMEM) f='%s'\n",
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 05b613af223a..ae8551eb3736 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -5,6 +5,7 @@ config H8300
5 select HAVE_GENERIC_HARDIRQS 5 select HAVE_GENERIC_HARDIRQS
6 select GENERIC_ATOMIC64 6 select GENERIC_ATOMIC64
7 select HAVE_UID16 7 select HAVE_UID16
8 select HAVE_VIRT_TO_BUS
8 select ARCH_WANT_IPC_PARSE_VERSION 9 select ARCH_WANT_IPC_PARSE_VERSION
9 select GENERIC_IRQ_SHOW 10 select GENERIC_IRQ_SHOW
10 select GENERIC_CPU_DEVICES 11 select GENERIC_CPU_DEVICES
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index c90366ef7183..33f3fdc0b214 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -26,6 +26,7 @@ config IA64
26 select HAVE_MEMBLOCK 26 select HAVE_MEMBLOCK
27 select HAVE_MEMBLOCK_NODE_MAP 27 select HAVE_MEMBLOCK_NODE_MAP
28 select HAVE_VIRT_CPU_ACCOUNTING 28 select HAVE_VIRT_CPU_ACCOUNTING
29 select HAVE_VIRT_TO_BUS
29 select ARCH_DISCARD_MEMBLOCK 30 select ARCH_DISCARD_MEMBLOCK
30 select GENERIC_IRQ_PROBE 31 select GENERIC_IRQ_PROBE
31 select GENERIC_PENDING_IRQ if SMP 32 select GENERIC_PENDING_IRQ if SMP
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 7026b29e277a..f8280a766a78 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -423,7 +423,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
423{ 423{
424 struct kretprobe_instance *ri = NULL; 424 struct kretprobe_instance *ri = NULL;
425 struct hlist_head *head, empty_rp; 425 struct hlist_head *head, empty_rp;
426 struct hlist_node *node, *tmp; 426 struct hlist_node *tmp;
427 unsigned long flags, orig_ret_address = 0; 427 unsigned long flags, orig_ret_address = 0;
428 unsigned long trampoline_address = 428 unsigned long trampoline_address =
429 ((struct fnptr *)kretprobe_trampoline)->ip; 429 ((struct fnptr *)kretprobe_trampoline)->ip;
@@ -444,7 +444,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
444 * real return address, and all the rest will point to 444 * real return address, and all the rest will point to
445 * kretprobe_trampoline 445 * kretprobe_trampoline
446 */ 446 */
447 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 447 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
448 if (ri->task != current) 448 if (ri->task != current)
449 /* another task is sharing our hash bucket */ 449 /* another task is sharing our hash bucket */
450 continue; 450 continue;
@@ -461,7 +461,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
461 461
462 regs->cr_iip = orig_ret_address; 462 regs->cr_iip = orig_ret_address;
463 463
464 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 464 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
465 if (ri->task != current) 465 if (ri->task != current)
466 /* another task is sharing our hash bucket */ 466 /* another task is sharing our hash bucket */
467 continue; 467 continue;
@@ -487,7 +487,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
487 kretprobe_hash_unlock(current, &flags); 487 kretprobe_hash_unlock(current, &flags);
488 preempt_enable_no_resched(); 488 preempt_enable_no_resched();
489 489
490 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 490 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
491 hlist_del(&ri->hlist); 491 hlist_del(&ri->hlist);
492 kfree(ri); 492 kfree(ri);
493 } 493 }
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index f807721e19a5..92623818a1fe 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -10,6 +10,7 @@ config M32R
10 select ARCH_WANT_IPC_PARSE_VERSION 10 select ARCH_WANT_IPC_PARSE_VERSION
11 select HAVE_DEBUG_BUGVERBOSE 11 select HAVE_DEBUG_BUGVERBOSE
12 select HAVE_GENERIC_HARDIRQS 12 select HAVE_GENERIC_HARDIRQS
13 select HAVE_VIRT_TO_BUS
13 select GENERIC_IRQ_PROBE 14 select GENERIC_IRQ_PROBE
14 select GENERIC_IRQ_SHOW 15 select GENERIC_IRQ_SHOW
15 select GENERIC_ATOMIC64 16 select GENERIC_ATOMIC64
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index efb1ce1f14a3..0e708c78e01c 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -8,6 +8,7 @@ config M68K
8 select GENERIC_IRQ_SHOW 8 select GENERIC_IRQ_SHOW
9 select GENERIC_ATOMIC64 9 select GENERIC_ATOMIC64
10 select HAVE_UID16 10 select HAVE_UID16
11 select HAVE_VIRT_TO_BUS
11 select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS 12 select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
12 select GENERIC_CPU_DEVICES 13 select GENERIC_CPU_DEVICES
13 select GENERIC_STRNCPY_FROM_USER if MMU 14 select GENERIC_STRNCPY_FROM_USER if MMU
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index ba3b7c8c04b8..7843d11156e6 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -19,6 +19,7 @@ config MICROBLAZE
19 select HAVE_DEBUG_KMEMLEAK 19 select HAVE_DEBUG_KMEMLEAK
20 select IRQ_DOMAIN 20 select IRQ_DOMAIN
21 select HAVE_GENERIC_HARDIRQS 21 select HAVE_GENERIC_HARDIRQS
22 select HAVE_VIRT_TO_BUS
22 select GENERIC_IRQ_PROBE 23 select GENERIC_IRQ_PROBE
23 select GENERIC_IRQ_SHOW 24 select GENERIC_IRQ_SHOW
24 select GENERIC_PCI_IOMAP 25 select GENERIC_PCI_IOMAP
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 198641589bb5..1eabe5753215 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -38,6 +38,7 @@ config MIPS
38 select GENERIC_CLOCKEVENTS 38 select GENERIC_CLOCKEVENTS
39 select GENERIC_CMOS_UPDATE 39 select GENERIC_CMOS_UPDATE
40 select HAVE_MOD_ARCH_SPECIFIC 40 select HAVE_MOD_ARCH_SPECIFIC
41 select HAVE_VIRT_TO_BUS
41 select MODULES_USE_ELF_REL if MODULES 42 select MODULES_USE_ELF_REL if MODULES
42 select MODULES_USE_ELF_RELA if MODULES && 64BIT 43 select MODULES_USE_ELF_RELA if MODULES && 64BIT
43 select CLONE_BACKWARDS 44 select CLONE_BACKWARDS
diff --git a/arch/mips/kernel/kprobes.c b/arch/mips/kernel/kprobes.c
index 158467da9bc1..ce3f0807ad1e 100644
--- a/arch/mips/kernel/kprobes.c
+++ b/arch/mips/kernel/kprobes.c
@@ -598,7 +598,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
598{ 598{
599 struct kretprobe_instance *ri = NULL; 599 struct kretprobe_instance *ri = NULL;
600 struct hlist_head *head, empty_rp; 600 struct hlist_head *head, empty_rp;
601 struct hlist_node *node, *tmp; 601 struct hlist_node *tmp;
602 unsigned long flags, orig_ret_address = 0; 602 unsigned long flags, orig_ret_address = 0;
603 unsigned long trampoline_address = (unsigned long)kretprobe_trampoline; 603 unsigned long trampoline_address = (unsigned long)kretprobe_trampoline;
604 604
@@ -618,7 +618,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
618 * real return address, and all the rest will point to 618 * real return address, and all the rest will point to
619 * kretprobe_trampoline 619 * kretprobe_trampoline
620 */ 620 */
621 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 621 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
622 if (ri->task != current) 622 if (ri->task != current)
623 /* another task is sharing our hash bucket */ 623 /* another task is sharing our hash bucket */
624 continue; 624 continue;
@@ -645,7 +645,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
645 kretprobe_hash_unlock(current, &flags); 645 kretprobe_hash_unlock(current, &flags);
646 preempt_enable_no_resched(); 646 preempt_enable_no_resched();
647 647
648 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 648 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
649 hlist_del(&ri->hlist); 649 hlist_del(&ri->hlist);
650 kfree(ri); 650 kfree(ri);
651 } 651 }
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index ad0caea0bfea..b06c7360b1c6 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -8,6 +8,7 @@ config MN10300
8 select HAVE_ARCH_KGDB 8 select HAVE_ARCH_KGDB
9 select GENERIC_ATOMIC64 9 select GENERIC_ATOMIC64
10 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER 10 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
11 select HAVE_VIRT_TO_BUS
11 select GENERIC_CLOCKEVENTS 12 select GENERIC_CLOCKEVENTS
12 select MODULES_USE_ELF_RELA 13 select MODULES_USE_ELF_RELA
13 select OLD_SIGSUSPEND3 14 select OLD_SIGSUSPEND3
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index 35a4e5f6e71c..014a6482ed4c 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -12,6 +12,7 @@ config OPENRISC
12 select ARCH_WANT_OPTIONAL_GPIOLIB 12 select ARCH_WANT_OPTIONAL_GPIOLIB
13 select HAVE_ARCH_TRACEHOOK 13 select HAVE_ARCH_TRACEHOOK
14 select HAVE_GENERIC_HARDIRQS 14 select HAVE_GENERIC_HARDIRQS
15 select HAVE_VIRT_TO_BUS
15 select GENERIC_IRQ_CHIP 16 select GENERIC_IRQ_CHIP
16 select GENERIC_IRQ_PROBE 17 select GENERIC_IRQ_PROBE
17 select GENERIC_IRQ_SHOW 18 select GENERIC_IRQ_SHOW
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 7f9b3c53f74a..4d5ea7648574 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -19,6 +19,7 @@ config PARISC
19 select GENERIC_SMP_IDLE_THREAD 19 select GENERIC_SMP_IDLE_THREAD
20 select GENERIC_STRNCPY_FROM_USER 20 select GENERIC_STRNCPY_FROM_USER
21 select HAVE_MOD_ARCH_SPECIFIC 21 select HAVE_MOD_ARCH_SPECIFIC
22 select HAVE_VIRT_TO_BUS
22 select MODULES_USE_ELF_RELA 23 select MODULES_USE_ELF_RELA
23 select CLONE_BACKWARDS 24 select CLONE_BACKWARDS
24 select TTY # Needed for pdc_cons.c 25 select TTY # Needed for pdc_cons.c
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index 54d619d4cac6..5dfd248e3f1a 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -35,22 +35,17 @@
35 35
36static unsigned long get_unshared_area(unsigned long addr, unsigned long len) 36static unsigned long get_unshared_area(unsigned long addr, unsigned long len)
37{ 37{
38 struct vm_area_struct *vma; 38 struct vm_unmapped_area_info info;
39 39
40 addr = PAGE_ALIGN(addr); 40 info.flags = 0;
41 41 info.length = len;
42 for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) { 42 info.low_limit = PAGE_ALIGN(addr);
43 /* At this point: (!vma || addr < vma->vm_end). */ 43 info.high_limit = TASK_SIZE;
44 if (TASK_SIZE - len < addr) 44 info.align_mask = 0;
45 return -ENOMEM; 45 info.align_offset = 0;
46 if (!vma || addr + len <= vma->vm_start) 46 return vm_unmapped_area(&info);
47 return addr;
48 addr = vma->vm_end;
49 }
50} 47}
51 48
52#define DCACHE_ALIGN(addr) (((addr) + (SHMLBA - 1)) &~ (SHMLBA - 1))
53
54/* 49/*
55 * We need to know the offset to use. Old scheme was to look for 50 * We need to know the offset to use. Old scheme was to look for
56 * existing mapping and use the same offset. New scheme is to use the 51 * existing mapping and use the same offset. New scheme is to use the
@@ -63,30 +58,21 @@ static unsigned long get_unshared_area(unsigned long addr, unsigned long len)
63 */ 58 */
64static int get_offset(struct address_space *mapping) 59static int get_offset(struct address_space *mapping)
65{ 60{
66 int offset = (unsigned long) mapping << (PAGE_SHIFT - 8); 61 return (unsigned long) mapping >> 8;
67 return offset & 0x3FF000;
68} 62}
69 63
70static unsigned long get_shared_area(struct address_space *mapping, 64static unsigned long get_shared_area(struct address_space *mapping,
71 unsigned long addr, unsigned long len, unsigned long pgoff) 65 unsigned long addr, unsigned long len, unsigned long pgoff)
72{ 66{
73 struct vm_area_struct *vma; 67 struct vm_unmapped_area_info info;
74 int offset = mapping ? get_offset(mapping) : 0;
75 68
76 offset = (offset + (pgoff << PAGE_SHIFT)) & 0x3FF000; 69 info.flags = 0;
77 70 info.length = len;
78 addr = DCACHE_ALIGN(addr - offset) + offset; 71 info.low_limit = PAGE_ALIGN(addr);
79 72 info.high_limit = TASK_SIZE;
80 for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) { 73 info.align_mask = PAGE_MASK & (SHMLBA - 1);
81 /* At this point: (!vma || addr < vma->vm_end). */ 74 info.align_offset = (get_offset(mapping) + pgoff) << PAGE_SHIFT;
82 if (TASK_SIZE - len < addr) 75 return vm_unmapped_area(&info);
83 return -ENOMEM;
84 if (!vma || addr + len <= vma->vm_start)
85 return addr;
86 addr = DCACHE_ALIGN(vma->vm_end - offset) + offset;
87 if (addr < vma->vm_end) /* handle wraparound */
88 return -ENOMEM;
89 }
90} 76}
91 77
92unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, 78unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 5c7470689a10..b89d7eb730a2 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -87,9 +87,6 @@ config GENERIC_GPIO
87 help 87 help
88 Generic GPIO API support 88 Generic GPIO API support
89 89
90config ARCH_NO_VIRT_TO_BUS
91 def_bool PPC64
92
93config PPC 90config PPC
94 bool 91 bool
95 default y 92 default y
@@ -101,6 +98,7 @@ config PPC
101 select HAVE_FUNCTION_GRAPH_TRACER 98 select HAVE_FUNCTION_GRAPH_TRACER
102 select SYSCTL_EXCEPTION_TRACE 99 select SYSCTL_EXCEPTION_TRACE
103 select ARCH_WANT_OPTIONAL_GPIOLIB 100 select ARCH_WANT_OPTIONAL_GPIOLIB
101 select HAVE_VIRT_TO_BUS if !PPC64
104 select HAVE_IDE 102 select HAVE_IDE
105 select HAVE_IOREMAP_PROT 103 select HAVE_IOREMAP_PROT
106 select HAVE_EFFICIENT_UNALIGNED_ACCESS 104 select HAVE_EFFICIENT_UNALIGNED_ACCESS
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index e88c64331819..11f5b03a0b06 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -310,7 +310,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
310{ 310{
311 struct kretprobe_instance *ri = NULL; 311 struct kretprobe_instance *ri = NULL;
312 struct hlist_head *head, empty_rp; 312 struct hlist_head *head, empty_rp;
313 struct hlist_node *node, *tmp; 313 struct hlist_node *tmp;
314 unsigned long flags, orig_ret_address = 0; 314 unsigned long flags, orig_ret_address = 0;
315 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline; 315 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
316 316
@@ -330,7 +330,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
330 * real return address, and all the rest will point to 330 * real return address, and all the rest will point to
331 * kretprobe_trampoline 331 * kretprobe_trampoline
332 */ 332 */
333 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 333 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
334 if (ri->task != current) 334 if (ri->task != current)
335 /* another task is sharing our hash bucket */ 335 /* another task is sharing our hash bucket */
336 continue; 336 continue;
@@ -357,7 +357,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
357 kretprobe_hash_unlock(current, &flags); 357 kretprobe_hash_unlock(current, &flags);
358 preempt_enable_no_resched(); 358 preempt_enable_no_resched();
359 359
360 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 360 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
361 hlist_del(&ri->hlist); 361 hlist_del(&ri->hlist);
362 kfree(ri); 362 kfree(ri);
363 } 363 }
diff --git a/arch/powerpc/kvm/book3s_mmu_hpte.c b/arch/powerpc/kvm/book3s_mmu_hpte.c
index 2c86b0d63714..da8b13c4b776 100644
--- a/arch/powerpc/kvm/book3s_mmu_hpte.c
+++ b/arch/powerpc/kvm/book3s_mmu_hpte.c
@@ -124,7 +124,6 @@ static void kvmppc_mmu_pte_flush_all(struct kvm_vcpu *vcpu)
124{ 124{
125 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu); 125 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
126 struct hpte_cache *pte; 126 struct hpte_cache *pte;
127 struct hlist_node *node;
128 int i; 127 int i;
129 128
130 rcu_read_lock(); 129 rcu_read_lock();
@@ -132,7 +131,7 @@ static void kvmppc_mmu_pte_flush_all(struct kvm_vcpu *vcpu)
132 for (i = 0; i < HPTEG_HASH_NUM_VPTE_LONG; i++) { 131 for (i = 0; i < HPTEG_HASH_NUM_VPTE_LONG; i++) {
133 struct hlist_head *list = &vcpu3s->hpte_hash_vpte_long[i]; 132 struct hlist_head *list = &vcpu3s->hpte_hash_vpte_long[i];
134 133
135 hlist_for_each_entry_rcu(pte, node, list, list_vpte_long) 134 hlist_for_each_entry_rcu(pte, list, list_vpte_long)
136 invalidate_pte(vcpu, pte); 135 invalidate_pte(vcpu, pte);
137 } 136 }
138 137
@@ -143,7 +142,6 @@ static void kvmppc_mmu_pte_flush_page(struct kvm_vcpu *vcpu, ulong guest_ea)
143{ 142{
144 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu); 143 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
145 struct hlist_head *list; 144 struct hlist_head *list;
146 struct hlist_node *node;
147 struct hpte_cache *pte; 145 struct hpte_cache *pte;
148 146
149 /* Find the list of entries in the map */ 147 /* Find the list of entries in the map */
@@ -152,7 +150,7 @@ static void kvmppc_mmu_pte_flush_page(struct kvm_vcpu *vcpu, ulong guest_ea)
152 rcu_read_lock(); 150 rcu_read_lock();
153 151
154 /* Check the list for matching entries and invalidate */ 152 /* Check the list for matching entries and invalidate */
155 hlist_for_each_entry_rcu(pte, node, list, list_pte) 153 hlist_for_each_entry_rcu(pte, list, list_pte)
156 if ((pte->pte.eaddr & ~0xfffUL) == guest_ea) 154 if ((pte->pte.eaddr & ~0xfffUL) == guest_ea)
157 invalidate_pte(vcpu, pte); 155 invalidate_pte(vcpu, pte);
158 156
@@ -163,7 +161,6 @@ static void kvmppc_mmu_pte_flush_long(struct kvm_vcpu *vcpu, ulong guest_ea)
163{ 161{
164 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu); 162 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
165 struct hlist_head *list; 163 struct hlist_head *list;
166 struct hlist_node *node;
167 struct hpte_cache *pte; 164 struct hpte_cache *pte;
168 165
169 /* Find the list of entries in the map */ 166 /* Find the list of entries in the map */
@@ -173,7 +170,7 @@ static void kvmppc_mmu_pte_flush_long(struct kvm_vcpu *vcpu, ulong guest_ea)
173 rcu_read_lock(); 170 rcu_read_lock();
174 171
175 /* Check the list for matching entries and invalidate */ 172 /* Check the list for matching entries and invalidate */
176 hlist_for_each_entry_rcu(pte, node, list, list_pte_long) 173 hlist_for_each_entry_rcu(pte, list, list_pte_long)
177 if ((pte->pte.eaddr & 0x0ffff000UL) == guest_ea) 174 if ((pte->pte.eaddr & 0x0ffff000UL) == guest_ea)
178 invalidate_pte(vcpu, pte); 175 invalidate_pte(vcpu, pte);
179 176
@@ -207,7 +204,6 @@ static void kvmppc_mmu_pte_vflush_short(struct kvm_vcpu *vcpu, u64 guest_vp)
207{ 204{
208 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu); 205 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
209 struct hlist_head *list; 206 struct hlist_head *list;
210 struct hlist_node *node;
211 struct hpte_cache *pte; 207 struct hpte_cache *pte;
212 u64 vp_mask = 0xfffffffffULL; 208 u64 vp_mask = 0xfffffffffULL;
213 209
@@ -216,7 +212,7 @@ static void kvmppc_mmu_pte_vflush_short(struct kvm_vcpu *vcpu, u64 guest_vp)
216 rcu_read_lock(); 212 rcu_read_lock();
217 213
218 /* Check the list for matching entries and invalidate */ 214 /* Check the list for matching entries and invalidate */
219 hlist_for_each_entry_rcu(pte, node, list, list_vpte) 215 hlist_for_each_entry_rcu(pte, list, list_vpte)
220 if ((pte->pte.vpage & vp_mask) == guest_vp) 216 if ((pte->pte.vpage & vp_mask) == guest_vp)
221 invalidate_pte(vcpu, pte); 217 invalidate_pte(vcpu, pte);
222 218
@@ -228,7 +224,6 @@ static void kvmppc_mmu_pte_vflush_long(struct kvm_vcpu *vcpu, u64 guest_vp)
228{ 224{
229 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu); 225 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
230 struct hlist_head *list; 226 struct hlist_head *list;
231 struct hlist_node *node;
232 struct hpte_cache *pte; 227 struct hpte_cache *pte;
233 u64 vp_mask = 0xffffff000ULL; 228 u64 vp_mask = 0xffffff000ULL;
234 229
@@ -238,7 +233,7 @@ static void kvmppc_mmu_pte_vflush_long(struct kvm_vcpu *vcpu, u64 guest_vp)
238 rcu_read_lock(); 233 rcu_read_lock();
239 234
240 /* Check the list for matching entries and invalidate */ 235 /* Check the list for matching entries and invalidate */
241 hlist_for_each_entry_rcu(pte, node, list, list_vpte_long) 236 hlist_for_each_entry_rcu(pte, list, list_vpte_long)
242 if ((pte->pte.vpage & vp_mask) == guest_vp) 237 if ((pte->pte.vpage & vp_mask) == guest_vp)
243 invalidate_pte(vcpu, pte); 238 invalidate_pte(vcpu, pte);
244 239
@@ -266,7 +261,6 @@ void kvmppc_mmu_pte_vflush(struct kvm_vcpu *vcpu, u64 guest_vp, u64 vp_mask)
266void kvmppc_mmu_pte_pflush(struct kvm_vcpu *vcpu, ulong pa_start, ulong pa_end) 261void kvmppc_mmu_pte_pflush(struct kvm_vcpu *vcpu, ulong pa_start, ulong pa_end)
267{ 262{
268 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu); 263 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
269 struct hlist_node *node;
270 struct hpte_cache *pte; 264 struct hpte_cache *pte;
271 int i; 265 int i;
272 266
@@ -277,7 +271,7 @@ void kvmppc_mmu_pte_pflush(struct kvm_vcpu *vcpu, ulong pa_start, ulong pa_end)
277 for (i = 0; i < HPTEG_HASH_NUM_VPTE_LONG; i++) { 271 for (i = 0; i < HPTEG_HASH_NUM_VPTE_LONG; i++) {
278 struct hlist_head *list = &vcpu3s->hpte_hash_vpte_long[i]; 272 struct hlist_head *list = &vcpu3s->hpte_hash_vpte_long[i];
279 273
280 hlist_for_each_entry_rcu(pte, node, list, list_vpte_long) 274 hlist_for_each_entry_rcu(pte, list, list_vpte_long)
281 if ((pte->pte.raddr >= pa_start) && 275 if ((pte->pte.raddr >= pa_start) &&
282 (pte->pte.raddr < pa_end)) 276 (pte->pte.raddr < pa_end))
283 invalidate_pte(vcpu, pte); 277 invalidate_pte(vcpu, pte);
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index f09ae7b0b4c5..4b505370a1d5 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -134,6 +134,7 @@ config S390
134 select HAVE_SYSCALL_WRAPPERS 134 select HAVE_SYSCALL_WRAPPERS
135 select HAVE_UID16 if 32BIT 135 select HAVE_UID16 if 32BIT
136 select HAVE_VIRT_CPU_ACCOUNTING 136 select HAVE_VIRT_CPU_ACCOUNTING
137 select HAVE_VIRT_TO_BUS
137 select INIT_ALL_POSSIBLE 138 select INIT_ALL_POSSIBLE
138 select KTIME_SCALAR if 32BIT 139 select KTIME_SCALAR if 32BIT
139 select MODULES_USE_ELF_RELA 140 select MODULES_USE_ELF_RELA
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index d1c7214e157c..3388b2b2a07d 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -354,7 +354,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
354{ 354{
355 struct kretprobe_instance *ri; 355 struct kretprobe_instance *ri;
356 struct hlist_head *head, empty_rp; 356 struct hlist_head *head, empty_rp;
357 struct hlist_node *node, *tmp; 357 struct hlist_node *tmp;
358 unsigned long flags, orig_ret_address; 358 unsigned long flags, orig_ret_address;
359 unsigned long trampoline_address; 359 unsigned long trampoline_address;
360 kprobe_opcode_t *correct_ret_addr; 360 kprobe_opcode_t *correct_ret_addr;
@@ -379,7 +379,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
379 orig_ret_address = 0; 379 orig_ret_address = 0;
380 correct_ret_addr = NULL; 380 correct_ret_addr = NULL;
381 trampoline_address = (unsigned long) &kretprobe_trampoline; 381 trampoline_address = (unsigned long) &kretprobe_trampoline;
382 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 382 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
383 if (ri->task != current) 383 if (ri->task != current)
384 /* another task is sharing our hash bucket */ 384 /* another task is sharing our hash bucket */
385 continue; 385 continue;
@@ -398,7 +398,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
398 kretprobe_assert(ri, orig_ret_address, trampoline_address); 398 kretprobe_assert(ri, orig_ret_address, trampoline_address);
399 399
400 correct_ret_addr = ri->ret_addr; 400 correct_ret_addr = ri->ret_addr;
401 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 401 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
402 if (ri->task != current) 402 if (ri->task != current)
403 /* another task is sharing our hash bucket */ 403 /* another task is sharing our hash bucket */
404 continue; 404 continue;
@@ -427,7 +427,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
427 kretprobe_hash_unlock(current, &flags); 427 kretprobe_hash_unlock(current, &flags);
428 preempt_enable_no_resched(); 428 preempt_enable_no_resched();
429 429
430 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 430 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
431 hlist_del(&ri->hlist); 431 hlist_del(&ri->hlist);
432 kfree(ri); 432 kfree(ri);
433 } 433 }
diff --git a/arch/s390/pci/pci_msi.c b/arch/s390/pci/pci_msi.c
index 90fd3482b9e2..0297931335e1 100644
--- a/arch/s390/pci/pci_msi.c
+++ b/arch/s390/pci/pci_msi.c
@@ -25,10 +25,9 @@ static DEFINE_SPINLOCK(msi_map_lock);
25 25
26struct msi_desc *__irq_get_msi_desc(unsigned int irq) 26struct msi_desc *__irq_get_msi_desc(unsigned int irq)
27{ 27{
28 struct hlist_node *entry;
29 struct msi_map *map; 28 struct msi_map *map;
30 29
31 hlist_for_each_entry_rcu(map, entry, 30 hlist_for_each_entry_rcu(map,
32 &msi_hash[msi_hashfn(irq)], msi_chain) 31 &msi_hash[msi_hashfn(irq)], msi_chain)
33 if (map->irq == irq) 32 if (map->irq == irq)
34 return map->msi; 33 return map->msi;
diff --git a/arch/score/Kconfig b/arch/score/Kconfig
index 3b1482e7afac..e569aa1fd2ba 100644
--- a/arch/score/Kconfig
+++ b/arch/score/Kconfig
@@ -12,6 +12,7 @@ config SCORE
12 select GENERIC_CPU_DEVICES 12 select GENERIC_CPU_DEVICES
13 select GENERIC_CLOCKEVENTS 13 select GENERIC_CLOCKEVENTS
14 select HAVE_MOD_ARCH_SPECIFIC 14 select HAVE_MOD_ARCH_SPECIFIC
15 select HAVE_VIRT_TO_BUS
15 select MODULES_USE_ELF_REL 16 select MODULES_USE_ELF_REL
16 select CLONE_BACKWARDS 17 select CLONE_BACKWARDS
17 18
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index ef6717a64bc7..5e859633ce69 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -148,9 +148,6 @@ config ARCH_HAS_ILOG2_U32
148config ARCH_HAS_ILOG2_U64 148config ARCH_HAS_ILOG2_U64
149 def_bool n 149 def_bool n
150 150
151config ARCH_NO_VIRT_TO_BUS
152 def_bool y
153
154config ARCH_HAS_DEFAULT_IDLE 151config ARCH_HAS_DEFAULT_IDLE
155 def_bool y 152 def_bool y
156 153
diff --git a/arch/sh/kernel/kprobes.c b/arch/sh/kernel/kprobes.c
index 1208b09e95c3..42b46e61a2d5 100644
--- a/arch/sh/kernel/kprobes.c
+++ b/arch/sh/kernel/kprobes.c
@@ -310,7 +310,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
310{ 310{
311 struct kretprobe_instance *ri = NULL; 311 struct kretprobe_instance *ri = NULL;
312 struct hlist_head *head, empty_rp; 312 struct hlist_head *head, empty_rp;
313 struct hlist_node *node, *tmp; 313 struct hlist_node *tmp;
314 unsigned long flags, orig_ret_address = 0; 314 unsigned long flags, orig_ret_address = 0;
315 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; 315 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
316 316
@@ -330,7 +330,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
330 * real return address, and all the rest will point to 330 * real return address, and all the rest will point to
331 * kretprobe_trampoline 331 * kretprobe_trampoline
332 */ 332 */
333 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 333 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
334 if (ri->task != current) 334 if (ri->task != current)
335 /* another task is sharing our hash bucket */ 335 /* another task is sharing our hash bucket */
336 continue; 336 continue;
@@ -360,7 +360,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
360 360
361 preempt_enable_no_resched(); 361 preempt_enable_no_resched();
362 362
363 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 363 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
364 hlist_del(&ri->hlist); 364 hlist_del(&ri->hlist);
365 kfree(ri); 365 kfree(ri);
366 } 366 }
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 58fb1e3f631d..289127d5241c 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -146,9 +146,6 @@ config GENERIC_GPIO
146 help 146 help
147 Generic GPIO API support 147 Generic GPIO API support
148 148
149config ARCH_NO_VIRT_TO_BUS
150 def_bool y
151
152config ARCH_SUPPORTS_DEBUG_PAGEALLOC 149config ARCH_SUPPORTS_DEBUG_PAGEALLOC
153 def_bool y if SPARC64 150 def_bool y if SPARC64
154 151
diff --git a/arch/sparc/kernel/kprobes.c b/arch/sparc/kernel/kprobes.c
index a39d1ba5a119..e72212148d2a 100644
--- a/arch/sparc/kernel/kprobes.c
+++ b/arch/sparc/kernel/kprobes.c
@@ -511,7 +511,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
511{ 511{
512 struct kretprobe_instance *ri = NULL; 512 struct kretprobe_instance *ri = NULL;
513 struct hlist_head *head, empty_rp; 513 struct hlist_head *head, empty_rp;
514 struct hlist_node *node, *tmp; 514 struct hlist_node *tmp;
515 unsigned long flags, orig_ret_address = 0; 515 unsigned long flags, orig_ret_address = 0;
516 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline; 516 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
517 517
@@ -531,7 +531,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
531 * real return address, and all the rest will point to 531 * real return address, and all the rest will point to
532 * kretprobe_trampoline 532 * kretprobe_trampoline
533 */ 533 */
534 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 534 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
535 if (ri->task != current) 535 if (ri->task != current)
536 /* another task is sharing our hash bucket */ 536 /* another task is sharing our hash bucket */
537 continue; 537 continue;
@@ -559,7 +559,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
559 kretprobe_hash_unlock(current, &flags); 559 kretprobe_hash_unlock(current, &flags);
560 preempt_enable_no_resched(); 560 preempt_enable_no_resched();
561 561
562 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 562 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
563 hlist_del(&ri->hlist); 563 hlist_del(&ri->hlist);
564 kfree(ri); 564 kfree(ri);
565 } 565 }
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c
index 9fcc6b4e93b3..54df554b82d9 100644
--- a/arch/sparc/kernel/ldc.c
+++ b/arch/sparc/kernel/ldc.c
@@ -953,9 +953,8 @@ static HLIST_HEAD(ldc_channel_list);
953static int __ldc_channel_exists(unsigned long id) 953static int __ldc_channel_exists(unsigned long id)
954{ 954{
955 struct ldc_channel *lp; 955 struct ldc_channel *lp;
956 struct hlist_node *n;
957 956
958 hlist_for_each_entry(lp, n, &ldc_channel_list, list) { 957 hlist_for_each_entry(lp, &ldc_channel_list, list) {
959 if (lp->id == id) 958 if (lp->id == id)
960 return 1; 959 return 1;
961 } 960 }
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index 4ce6e4c390e0..ff496ab1e794 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -17,6 +17,7 @@ config TILE
17 select GENERIC_IRQ_SHOW 17 select GENERIC_IRQ_SHOW
18 select HAVE_DEBUG_BUGVERBOSE 18 select HAVE_DEBUG_BUGVERBOSE
19 select HAVE_SYSCALL_WRAPPERS if TILEGX 19 select HAVE_SYSCALL_WRAPPERS if TILEGX
20 select HAVE_VIRT_TO_BUS
20 select SYS_HYPERVISOR 21 select SYS_HYPERVISOR
21 select ARCH_HAVE_NMI_SAFE_CMPXCHG 22 select ARCH_HAVE_NMI_SAFE_CMPXCHG
22 select GENERIC_CLOCKEVENTS 23 select GENERIC_CLOCKEVENTS
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 60651df5f952..dc50b157fc83 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -9,6 +9,7 @@ config UNICORE32
9 select GENERIC_ATOMIC64 9 select GENERIC_ATOMIC64
10 select HAVE_KERNEL_LZO 10 select HAVE_KERNEL_LZO
11 select HAVE_KERNEL_LZMA 11 select HAVE_KERNEL_LZMA
12 select HAVE_VIRT_TO_BUS
12 select ARCH_HAVE_CUSTOM_GPIO_H 13 select ARCH_HAVE_CUSTOM_GPIO_H
13 select GENERIC_FIND_FIRST_BIT 14 select GENERIC_FIND_FIRST_BIT
14 select GENERIC_IRQ_PROBE 15 select GENERIC_IRQ_PROBE
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6a9383370311..a4f24f5b1218 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -112,6 +112,7 @@ config X86
112 select GENERIC_STRNLEN_USER 112 select GENERIC_STRNLEN_USER
113 select HAVE_CONTEXT_TRACKING if X86_64 113 select HAVE_CONTEXT_TRACKING if X86_64
114 select HAVE_IRQ_TIME_ACCOUNTING 114 select HAVE_IRQ_TIME_ACCOUNTING
115 select HAVE_VIRT_TO_BUS
115 select MODULES_USE_ELF_REL if X86_32 116 select MODULES_USE_ELF_REL if X86_32
116 select MODULES_USE_ELF_RELA if X86_64 117 select MODULES_USE_ELF_RELA if X86_64
117 select CLONE_BACKWARDS if X86_32 118 select CLONE_BACKWARDS if X86_32
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index e124554598ee..3f06e6149981 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -652,7 +652,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
652{ 652{
653 struct kretprobe_instance *ri = NULL; 653 struct kretprobe_instance *ri = NULL;
654 struct hlist_head *head, empty_rp; 654 struct hlist_head *head, empty_rp;
655 struct hlist_node *node, *tmp; 655 struct hlist_node *tmp;
656 unsigned long flags, orig_ret_address = 0; 656 unsigned long flags, orig_ret_address = 0;
657 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; 657 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
658 kprobe_opcode_t *correct_ret_addr = NULL; 658 kprobe_opcode_t *correct_ret_addr = NULL;
@@ -682,7 +682,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
682 * will be the real return address, and all the rest will 682 * will be the real return address, and all the rest will
683 * point to kretprobe_trampoline. 683 * point to kretprobe_trampoline.
684 */ 684 */
685 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 685 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
686 if (ri->task != current) 686 if (ri->task != current)
687 /* another task is sharing our hash bucket */ 687 /* another task is sharing our hash bucket */
688 continue; 688 continue;
@@ -701,7 +701,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
701 kretprobe_assert(ri, orig_ret_address, trampoline_address); 701 kretprobe_assert(ri, orig_ret_address, trampoline_address);
702 702
703 correct_ret_addr = ri->ret_addr; 703 correct_ret_addr = ri->ret_addr;
704 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { 704 hlist_for_each_entry_safe(ri, tmp, head, hlist) {
705 if (ri->task != current) 705 if (ri->task != current)
706 /* another task is sharing our hash bucket */ 706 /* another task is sharing our hash bucket */
707 continue; 707 continue;
@@ -728,7 +728,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
728 728
729 kretprobe_hash_unlock(current, &flags); 729 kretprobe_hash_unlock(current, &flags);
730 730
731 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { 731 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
732 hlist_del(&ri->hlist); 732 hlist_del(&ri->hlist);
733 kfree(ri); 733 kfree(ri);
734 } 734 }
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 4ed3edbe06bd..956ca358108a 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1644,13 +1644,13 @@ static int kvm_mmu_prepare_zap_page(struct kvm *kvm, struct kvm_mmu_page *sp,
1644static void kvm_mmu_commit_zap_page(struct kvm *kvm, 1644static void kvm_mmu_commit_zap_page(struct kvm *kvm,
1645 struct list_head *invalid_list); 1645 struct list_head *invalid_list);
1646 1646
1647#define for_each_gfn_sp(kvm, sp, gfn, pos) \ 1647#define for_each_gfn_sp(kvm, sp, gfn) \
1648 hlist_for_each_entry(sp, pos, \ 1648 hlist_for_each_entry(sp, \
1649 &(kvm)->arch.mmu_page_hash[kvm_page_table_hashfn(gfn)], hash_link) \ 1649 &(kvm)->arch.mmu_page_hash[kvm_page_table_hashfn(gfn)], hash_link) \
1650 if ((sp)->gfn != (gfn)) {} else 1650 if ((sp)->gfn != (gfn)) {} else
1651 1651
1652#define for_each_gfn_indirect_valid_sp(kvm, sp, gfn, pos) \ 1652#define for_each_gfn_indirect_valid_sp(kvm, sp, gfn) \
1653 hlist_for_each_entry(sp, pos, \ 1653 hlist_for_each_entry(sp, \
1654 &(kvm)->arch.mmu_page_hash[kvm_page_table_hashfn(gfn)], hash_link) \ 1654 &(kvm)->arch.mmu_page_hash[kvm_page_table_hashfn(gfn)], hash_link) \
1655 if ((sp)->gfn != (gfn) || (sp)->role.direct || \ 1655 if ((sp)->gfn != (gfn) || (sp)->role.direct || \
1656 (sp)->role.invalid) {} else 1656 (sp)->role.invalid) {} else
@@ -1706,11 +1706,10 @@ static int kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
1706static void kvm_sync_pages(struct kvm_vcpu *vcpu, gfn_t gfn) 1706static void kvm_sync_pages(struct kvm_vcpu *vcpu, gfn_t gfn)
1707{ 1707{
1708 struct kvm_mmu_page *s; 1708 struct kvm_mmu_page *s;
1709 struct hlist_node *node;
1710 LIST_HEAD(invalid_list); 1709 LIST_HEAD(invalid_list);
1711 bool flush = false; 1710 bool flush = false;
1712 1711
1713 for_each_gfn_indirect_valid_sp(vcpu->kvm, s, gfn, node) { 1712 for_each_gfn_indirect_valid_sp(vcpu->kvm, s, gfn) {
1714 if (!s->unsync) 1713 if (!s->unsync)
1715 continue; 1714 continue;
1716 1715
@@ -1848,7 +1847,6 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
1848 union kvm_mmu_page_role role; 1847 union kvm_mmu_page_role role;
1849 unsigned quadrant; 1848 unsigned quadrant;
1850 struct kvm_mmu_page *sp; 1849 struct kvm_mmu_page *sp;
1851 struct hlist_node *node;
1852 bool need_sync = false; 1850 bool need_sync = false;
1853 1851
1854 role = vcpu->arch.mmu.base_role; 1852 role = vcpu->arch.mmu.base_role;
@@ -1863,7 +1861,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
1863 quadrant &= (1 << ((PT32_PT_BITS - PT64_PT_BITS) * level)) - 1; 1861 quadrant &= (1 << ((PT32_PT_BITS - PT64_PT_BITS) * level)) - 1;
1864 role.quadrant = quadrant; 1862 role.quadrant = quadrant;
1865 } 1863 }
1866 for_each_gfn_sp(vcpu->kvm, sp, gfn, node) { 1864 for_each_gfn_sp(vcpu->kvm, sp, gfn) {
1867 if (!need_sync && sp->unsync) 1865 if (!need_sync && sp->unsync)
1868 need_sync = true; 1866 need_sync = true;
1869 1867
@@ -2151,14 +2149,13 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int goal_nr_mmu_pages)
2151int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn) 2149int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn)
2152{ 2150{
2153 struct kvm_mmu_page *sp; 2151 struct kvm_mmu_page *sp;
2154 struct hlist_node *node;
2155 LIST_HEAD(invalid_list); 2152 LIST_HEAD(invalid_list);
2156 int r; 2153 int r;
2157 2154
2158 pgprintk("%s: looking for gfn %llx\n", __func__, gfn); 2155 pgprintk("%s: looking for gfn %llx\n", __func__, gfn);
2159 r = 0; 2156 r = 0;
2160 spin_lock(&kvm->mmu_lock); 2157 spin_lock(&kvm->mmu_lock);
2161 for_each_gfn_indirect_valid_sp(kvm, sp, gfn, node) { 2158 for_each_gfn_indirect_valid_sp(kvm, sp, gfn) {
2162 pgprintk("%s: gfn %llx role %x\n", __func__, gfn, 2159 pgprintk("%s: gfn %llx role %x\n", __func__, gfn,
2163 sp->role.word); 2160 sp->role.word);
2164 r = 1; 2161 r = 1;
@@ -2288,9 +2285,8 @@ static void __kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
2288static void kvm_unsync_pages(struct kvm_vcpu *vcpu, gfn_t gfn) 2285static void kvm_unsync_pages(struct kvm_vcpu *vcpu, gfn_t gfn)
2289{ 2286{
2290 struct kvm_mmu_page *s; 2287 struct kvm_mmu_page *s;
2291 struct hlist_node *node;
2292 2288
2293 for_each_gfn_indirect_valid_sp(vcpu->kvm, s, gfn, node) { 2289 for_each_gfn_indirect_valid_sp(vcpu->kvm, s, gfn) {
2294 if (s->unsync) 2290 if (s->unsync)
2295 continue; 2291 continue;
2296 WARN_ON(s->role.level != PT_PAGE_TABLE_LEVEL); 2292 WARN_ON(s->role.level != PT_PAGE_TABLE_LEVEL);
@@ -2302,10 +2298,9 @@ static int mmu_need_write_protect(struct kvm_vcpu *vcpu, gfn_t gfn,
2302 bool can_unsync) 2298 bool can_unsync)
2303{ 2299{
2304 struct kvm_mmu_page *s; 2300 struct kvm_mmu_page *s;
2305 struct hlist_node *node;
2306 bool need_unsync = false; 2301 bool need_unsync = false;
2307 2302
2308 for_each_gfn_indirect_valid_sp(vcpu->kvm, s, gfn, node) { 2303 for_each_gfn_indirect_valid_sp(vcpu->kvm, s, gfn) {
2309 if (!can_unsync) 2304 if (!can_unsync)
2310 return 1; 2305 return 1;
2311 2306
@@ -3933,7 +3928,6 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
3933 gfn_t gfn = gpa >> PAGE_SHIFT; 3928 gfn_t gfn = gpa >> PAGE_SHIFT;
3934 union kvm_mmu_page_role mask = { .word = 0 }; 3929 union kvm_mmu_page_role mask = { .word = 0 };
3935 struct kvm_mmu_page *sp; 3930 struct kvm_mmu_page *sp;
3936 struct hlist_node *node;
3937 LIST_HEAD(invalid_list); 3931 LIST_HEAD(invalid_list);
3938 u64 entry, gentry, *spte; 3932 u64 entry, gentry, *spte;
3939 int npte; 3933 int npte;
@@ -3964,7 +3958,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
3964 kvm_mmu_audit(vcpu, AUDIT_PRE_PTE_WRITE); 3958 kvm_mmu_audit(vcpu, AUDIT_PRE_PTE_WRITE);
3965 3959
3966 mask.cr0_wp = mask.cr4_pae = mask.nxe = 1; 3960 mask.cr0_wp = mask.cr4_pae = mask.nxe = 1;
3967 for_each_gfn_indirect_valid_sp(vcpu->kvm, sp, gfn, node) { 3961 for_each_gfn_indirect_valid_sp(vcpu->kvm, sp, gfn) {
3968 if (detect_write_misaligned(sp, gpa, bytes) || 3962 if (detect_write_misaligned(sp, gpa, bytes) ||
3969 detect_write_flooding(sp)) { 3963 detect_write_flooding(sp)) {
3970 zap_page |= !!kvm_mmu_prepare_zap_page(vcpu->kvm, sp, 3964 zap_page |= !!kvm_mmu_prepare_zap_page(vcpu->kvm, sp,
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index a5c0663c2cdc..35876ffac11d 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -9,6 +9,7 @@ config XTENSA
9 select HAVE_IDE 9 select HAVE_IDE
10 select GENERIC_ATOMIC64 10 select GENERIC_ATOMIC64
11 select HAVE_GENERIC_HARDIRQS 11 select HAVE_GENERIC_HARDIRQS
12 select HAVE_VIRT_TO_BUS
12 select GENERIC_IRQ_SHOW 13 select GENERIC_IRQ_SHOW
13 select GENERIC_CPU_DEVICES 14 select GENERIC_CPU_DEVICES
14 select MODULES_USE_ELF_RELA 15 select MODULES_USE_ELF_RELA