diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-05 19:41:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-05 19:41:22 -0400 |
commit | 9efe21cb82b5dbe3b0b2ae4de4eccc64ecb94e95 (patch) | |
tree | 7ff8833745d2f268f897f6fa4a27263b4a572245 /arch/sparc | |
parent | de18836e447c2dc30120c0919b8db8ddc0401cc4 (diff) | |
parent | 0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff) |
Merge branch 'linus' into irq/threaded
Conflicts:
include/linux/irq.h
kernel/irq/handle.c
Diffstat (limited to 'arch/sparc')
35 files changed, 103 insertions, 109 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index c3ea215334f6..cc12cd48bbc5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -124,6 +124,9 @@ config ARCH_NO_VIRT_TO_BUS | |||
124 | config OF | 124 | config OF |
125 | def_bool y | 125 | def_bool y |
126 | 126 | ||
127 | config ARCH_SUPPORTS_DEBUG_PAGEALLOC | ||
128 | def_bool y if SPARC64 | ||
129 | |||
127 | source "init/Kconfig" | 130 | source "init/Kconfig" |
128 | 131 | ||
129 | source "kernel/Kconfig.freezer" | 132 | source "kernel/Kconfig.freezer" |
diff --git a/arch/sparc/Kconfig.debug b/arch/sparc/Kconfig.debug index b8a15e271bfa..90d5fe223a74 100644 --- a/arch/sparc/Kconfig.debug +++ b/arch/sparc/Kconfig.debug | |||
@@ -22,14 +22,6 @@ config DEBUG_DCFLUSH | |||
22 | config STACK_DEBUG | 22 | config STACK_DEBUG |
23 | bool "Stack Overflow Detection Support" | 23 | bool "Stack Overflow Detection Support" |
24 | 24 | ||
25 | config DEBUG_PAGEALLOC | ||
26 | bool "Debug page memory allocations" | ||
27 | depends on SPARC64 && DEBUG_KERNEL && !HIBERNATION | ||
28 | help | ||
29 | Unmap pages from the kernel linear mapping after free_pages(). | ||
30 | This results in a large slowdown, but helps to find certain types | ||
31 | of memory corruptions. | ||
32 | |||
33 | config MCOUNT | 25 | config MCOUNT |
34 | bool | 26 | bool |
35 | depends on SPARC64 | 27 | depends on SPARC64 |
diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h index 5693ab482606..666a73fef28d 100644 --- a/arch/sparc/include/asm/mmu_context_64.h +++ b/arch/sparc/include/asm/mmu_context_64.h | |||
@@ -121,8 +121,8 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str | |||
121 | * local TLB. | 121 | * local TLB. |
122 | */ | 122 | */ |
123 | cpu = smp_processor_id(); | 123 | cpu = smp_processor_id(); |
124 | if (!ctx_valid || !cpu_isset(cpu, mm->cpu_vm_mask)) { | 124 | if (!ctx_valid || !cpumask_test_cpu(cpu, mm_cpumask(mm))) { |
125 | cpu_set(cpu, mm->cpu_vm_mask); | 125 | cpumask_set_cpu(cpu, mm_cpumask(mm)); |
126 | __flush_tlb_mm(CTX_HWBITS(mm->context), | 126 | __flush_tlb_mm(CTX_HWBITS(mm->context), |
127 | SECONDARY_CONTEXT); | 127 | SECONDARY_CONTEXT); |
128 | } | 128 | } |
@@ -141,8 +141,8 @@ static inline void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm | |||
141 | if (!CTX_VALID(mm->context)) | 141 | if (!CTX_VALID(mm->context)) |
142 | get_new_mmu_context(mm); | 142 | get_new_mmu_context(mm); |
143 | cpu = smp_processor_id(); | 143 | cpu = smp_processor_id(); |
144 | if (!cpu_isset(cpu, mm->cpu_vm_mask)) | 144 | if (!cpumask_test_cpu(cpu, mm_cpumask(mm))) |
145 | cpu_set(cpu, mm->cpu_vm_mask); | 145 | cpumask_set_cpu(cpu, mm_cpumask(mm)); |
146 | 146 | ||
147 | load_secondary_context(mm); | 147 | load_secondary_context(mm); |
148 | __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT); | 148 | __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT); |
diff --git a/arch/sparc/include/asm/pil.h b/arch/sparc/include/asm/pil.h index 32a7efe76d00..266937030546 100644 --- a/arch/sparc/include/asm/pil.h +++ b/arch/sparc/include/asm/pil.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #define PIL_DEVICE_IRQ 5 | 24 | #define PIL_DEVICE_IRQ 5 |
25 | #define PIL_SMP_CALL_FUNC_SNGL 6 | 25 | #define PIL_SMP_CALL_FUNC_SNGL 6 |
26 | #define PIL_DEFERRED_PCR_WORK 7 | 26 | #define PIL_DEFERRED_PCR_WORK 7 |
27 | #define PIL_KGDB_CAPTURE 8 | ||
27 | #define PIL_NORMAL_MAX 14 | 28 | #define PIL_NORMAL_MAX 14 |
28 | #define PIL_NMI 15 | 29 | #define PIL_NMI 15 |
29 | 30 | ||
diff --git a/arch/sparc/include/asm/smp_64.h b/arch/sparc/include/asm/smp_64.h index 57224dd37b3a..becb6bf353a9 100644 --- a/arch/sparc/include/asm/smp_64.h +++ b/arch/sparc/include/asm/smp_64.h | |||
@@ -35,7 +35,8 @@ extern cpumask_t cpu_core_map[NR_CPUS]; | |||
35 | extern int sparc64_multi_core; | 35 | extern int sparc64_multi_core; |
36 | 36 | ||
37 | extern void arch_send_call_function_single_ipi(int cpu); | 37 | extern void arch_send_call_function_single_ipi(int cpu); |
38 | extern void arch_send_call_function_ipi(cpumask_t mask); | 38 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
39 | #define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask | ||
39 | 40 | ||
40 | /* | 41 | /* |
41 | * General functions that each host system must provide. | 42 | * General functions that each host system must provide. |
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h index bf50d0c2d583..982a12f959f4 100644 --- a/arch/sparc/include/asm/socket.h +++ b/arch/sparc/include/asm/socket.h | |||
@@ -50,6 +50,9 @@ | |||
50 | 50 | ||
51 | #define SO_MARK 0x0022 | 51 | #define SO_MARK 0x0022 |
52 | 52 | ||
53 | #define SO_TIMESTAMPING 0x0023 | ||
54 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
55 | |||
53 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 56 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
54 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 57 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
55 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 | 58 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 |
diff --git a/arch/sparc/include/asm/spinlock_32.h b/arch/sparc/include/asm/spinlock_32.h index bf2d532593e3..46f91ab66a50 100644 --- a/arch/sparc/include/asm/spinlock_32.h +++ b/arch/sparc/include/asm/spinlock_32.h | |||
@@ -177,6 +177,8 @@ static inline int __read_trylock(raw_rwlock_t *rw) | |||
177 | #define __raw_write_unlock(rw) do { (rw)->lock = 0; } while(0) | 177 | #define __raw_write_unlock(rw) do { (rw)->lock = 0; } while(0) |
178 | 178 | ||
179 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 179 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
180 | #define __raw_read_lock_flags(rw, flags) __raw_read_lock(rw) | ||
181 | #define __raw_write_lock_flags(rw, flags) __raw_write_lock(rw) | ||
180 | 182 | ||
181 | #define _raw_spin_relax(lock) cpu_relax() | 183 | #define _raw_spin_relax(lock) cpu_relax() |
182 | #define _raw_read_relax(lock) cpu_relax() | 184 | #define _raw_read_relax(lock) cpu_relax() |
diff --git a/arch/sparc/include/asm/spinlock_64.h b/arch/sparc/include/asm/spinlock_64.h index c4d274d330e9..f6b2b92ad8d2 100644 --- a/arch/sparc/include/asm/spinlock_64.h +++ b/arch/sparc/include/asm/spinlock_64.h | |||
@@ -211,9 +211,11 @@ static int inline __write_trylock(raw_rwlock_t *lock) | |||
211 | } | 211 | } |
212 | 212 | ||
213 | #define __raw_read_lock(p) __read_lock(p) | 213 | #define __raw_read_lock(p) __read_lock(p) |
214 | #define __raw_read_lock_flags(p, f) __read_lock(p) | ||
214 | #define __raw_read_trylock(p) __read_trylock(p) | 215 | #define __raw_read_trylock(p) __read_trylock(p) |
215 | #define __raw_read_unlock(p) __read_unlock(p) | 216 | #define __raw_read_unlock(p) __read_unlock(p) |
216 | #define __raw_write_lock(p) __write_lock(p) | 217 | #define __raw_write_lock(p) __write_lock(p) |
218 | #define __raw_write_lock_flags(p, f) __write_lock(p) | ||
217 | #define __raw_write_unlock(p) __write_unlock(p) | 219 | #define __raw_write_unlock(p) __write_unlock(p) |
218 | #define __raw_write_trylock(p) __write_trylock(p) | 220 | #define __raw_write_trylock(p) __write_trylock(p) |
219 | 221 | ||
diff --git a/arch/sparc/include/asm/system_32.h b/arch/sparc/include/asm/system_32.h index 79c1ae2b42a3..751c8c17f5a0 100644 --- a/arch/sparc/include/asm/system_32.h +++ b/arch/sparc/include/asm/system_32.h | |||
@@ -126,7 +126,7 @@ extern void flushw_all(void); | |||
126 | #define switch_to(prev, next, last) do { \ | 126 | #define switch_to(prev, next, last) do { \ |
127 | SWITCH_ENTER(prev); \ | 127 | SWITCH_ENTER(prev); \ |
128 | SWITCH_DO_LAZY_FPU(next); \ | 128 | SWITCH_DO_LAZY_FPU(next); \ |
129 | cpu_set(smp_processor_id(), next->active_mm->cpu_vm_mask); \ | 129 | cpumask_set_cpu(smp_processor_id(), mm_cpumask(next->active_mm)); \ |
130 | __asm__ __volatile__( \ | 130 | __asm__ __volatile__( \ |
131 | "sethi %%hi(here - 0x8), %%o7\n\t" \ | 131 | "sethi %%hi(here - 0x8), %%o7\n\t" \ |
132 | "mov %%g6, %%g3\n\t" \ | 132 | "mov %%g6, %%g3\n\t" \ |
diff --git a/arch/sparc/include/asm/tlb_64.h b/arch/sparc/include/asm/tlb_64.h index ec81cdedef2c..ee38e731bfa6 100644 --- a/arch/sparc/include/asm/tlb_64.h +++ b/arch/sparc/include/asm/tlb_64.h | |||
@@ -57,6 +57,8 @@ static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned i | |||
57 | 57 | ||
58 | static inline void tlb_flush_mmu(struct mmu_gather *mp) | 58 | static inline void tlb_flush_mmu(struct mmu_gather *mp) |
59 | { | 59 | { |
60 | if (!mp->fullmm) | ||
61 | flush_tlb_pending(); | ||
60 | if (mp->need_flush) { | 62 | if (mp->need_flush) { |
61 | free_pages_and_swap_cache(mp->pages, mp->pages_nr); | 63 | free_pages_and_swap_cache(mp->pages, mp->pages_nr); |
62 | mp->pages_nr = 0; | 64 | mp->pages_nr = 0; |
@@ -78,8 +80,6 @@ static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, un | |||
78 | 80 | ||
79 | if (mp->fullmm) | 81 | if (mp->fullmm) |
80 | mp->fullmm = 0; | 82 | mp->fullmm = 0; |
81 | else | ||
82 | flush_tlb_pending(); | ||
83 | 83 | ||
84 | /* keep the page table cache within bounds */ | 84 | /* keep the page table cache within bounds */ |
85 | check_pgt_cache(); | 85 | check_pgt_cache(); |
diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h index 5bc0b8fd6374..e5ea8d332421 100644 --- a/arch/sparc/include/asm/topology_64.h +++ b/arch/sparc/include/asm/topology_64.h | |||
@@ -28,11 +28,6 @@ static inline cpumask_t node_to_cpumask(int node) | |||
28 | #define node_to_cpumask_ptr_next(v, node) \ | 28 | #define node_to_cpumask_ptr_next(v, node) \ |
29 | v = &(numa_cpumask_lookup_table[node]) | 29 | v = &(numa_cpumask_lookup_table[node]) |
30 | 30 | ||
31 | static inline int node_to_first_cpu(int node) | ||
32 | { | ||
33 | return cpumask_first(cpumask_of_node(node)); | ||
34 | } | ||
35 | |||
36 | struct pci_bus; | 31 | struct pci_bus; |
37 | #ifdef CONFIG_PCI | 32 | #ifdef CONFIG_PCI |
38 | extern int pcibus_to_node(struct pci_bus *pbus); | 33 | extern int pcibus_to_node(struct pci_bus *pbus); |
@@ -43,13 +38,9 @@ static inline int pcibus_to_node(struct pci_bus *pbus) | |||
43 | } | 38 | } |
44 | #endif | 39 | #endif |
45 | 40 | ||
46 | #define pcibus_to_cpumask(bus) \ | ||
47 | (pcibus_to_node(bus) == -1 ? \ | ||
48 | CPU_MASK_ALL : \ | ||
49 | node_to_cpumask(pcibus_to_node(bus))) | ||
50 | #define cpumask_of_pcibus(bus) \ | 41 | #define cpumask_of_pcibus(bus) \ |
51 | (pcibus_to_node(bus) == -1 ? \ | 42 | (pcibus_to_node(bus) == -1 ? \ |
52 | CPU_MASK_ALL_PTR : \ | 43 | cpu_all_mask : \ |
53 | cpumask_of_node(pcibus_to_node(bus))) | 44 | cpumask_of_node(pcibus_to_node(bus))) |
54 | 45 | ||
55 | #define SD_NODE_INIT (struct sched_domain) { \ | 46 | #define SD_NODE_INIT (struct sched_domain) { \ |
@@ -89,7 +80,6 @@ static inline int pcibus_to_node(struct pci_bus *pbus) | |||
89 | #define smt_capable() (sparc64_multi_core) | 80 | #define smt_capable() (sparc64_multi_core) |
90 | #endif /* CONFIG_SMP */ | 81 | #endif /* CONFIG_SMP */ |
91 | 82 | ||
92 | #define cpu_coregroup_map(cpu) (cpu_core_map[cpu]) | ||
93 | #define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu]) | 83 | #define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu]) |
94 | 84 | ||
95 | #endif /* _ASM_SPARC64_TOPOLOGY_H */ | 85 | #endif /* _ASM_SPARC64_TOPOLOGY_H */ |
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 57c39843fb2a..90350f838f05 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c | |||
@@ -653,7 +653,7 @@ static void __cpuinit dr_cpu_data(struct ds_info *dp, | |||
653 | if (cpu_list[i] == CPU_SENTINEL) | 653 | if (cpu_list[i] == CPU_SENTINEL) |
654 | continue; | 654 | continue; |
655 | 655 | ||
656 | if (cpu_list[i] < NR_CPUS) | 656 | if (cpu_list[i] < nr_cpu_ids) |
657 | cpu_set(cpu_list[i], mask); | 657 | cpu_set(cpu_list[i], mask); |
658 | } | 658 | } |
659 | 659 | ||
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S index a46c3a21e26d..3a1b7bf03cff 100644 --- a/arch/sparc/kernel/head_64.S +++ b/arch/sparc/kernel/head_64.S | |||
@@ -686,7 +686,7 @@ tlb_fixup_done: | |||
686 | * point. | 686 | * point. |
687 | * | 687 | * |
688 | * There used to be enormous complexity wrt. transferring | 688 | * There used to be enormous complexity wrt. transferring |
689 | * over from the firwmare's trap table to the Linux kernel's. | 689 | * over from the firmware's trap table to the Linux kernel's. |
690 | * For example, there was a chicken & egg problem wrt. building | 690 | * For example, there was a chicken & egg problem wrt. building |
691 | * the OBP page tables, yet needing to be on the Linux kernel | 691 | * the OBP page tables, yet needing to be on the Linux kernel |
692 | * trap table (to translate PAGE_OFFSET addresses) in order to | 692 | * trap table (to translate PAGE_OFFSET addresses) in order to |
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c index 44dd5ee64339..ad800b80c718 100644 --- a/arch/sparc/kernel/irq_32.c +++ b/arch/sparc/kernel/irq_32.c | |||
@@ -439,7 +439,6 @@ static int request_fast_irq(unsigned int irq, | |||
439 | flush_cache_all(); | 439 | flush_cache_all(); |
440 | 440 | ||
441 | action->flags = irqflags; | 441 | action->flags = irqflags; |
442 | cpus_clear(action->mask); | ||
443 | action->name = devname; | 442 | action->name = devname; |
444 | action->dev_id = NULL; | 443 | action->dev_id = NULL; |
445 | action->next = NULL; | 444 | action->next = NULL; |
@@ -574,7 +573,6 @@ int request_irq(unsigned int irq, | |||
574 | 573 | ||
575 | action->handler = handler; | 574 | action->handler = handler; |
576 | action->flags = irqflags; | 575 | action->flags = irqflags; |
577 | cpus_clear(action->mask); | ||
578 | action->name = devname; | 576 | action->name = devname; |
579 | action->next = NULL; | 577 | action->next = NULL; |
580 | action->dev_id = dev_id; | 578 | action->dev_id = dev_id; |
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index d0d6a515499a..5deabe921a47 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c | |||
@@ -266,12 +266,12 @@ static int irq_choose_cpu(unsigned int virt_irq) | |||
266 | spin_lock_irqsave(&irq_rover_lock, flags); | 266 | spin_lock_irqsave(&irq_rover_lock, flags); |
267 | 267 | ||
268 | while (!cpu_online(irq_rover)) { | 268 | while (!cpu_online(irq_rover)) { |
269 | if (++irq_rover >= NR_CPUS) | 269 | if (++irq_rover >= nr_cpu_ids) |
270 | irq_rover = 0; | 270 | irq_rover = 0; |
271 | } | 271 | } |
272 | cpuid = irq_rover; | 272 | cpuid = irq_rover; |
273 | do { | 273 | do { |
274 | if (++irq_rover >= NR_CPUS) | 274 | if (++irq_rover >= nr_cpu_ids) |
275 | irq_rover = 0; | 275 | irq_rover = 0; |
276 | } while (!cpu_online(irq_rover)); | 276 | } while (!cpu_online(irq_rover)); |
277 | 277 | ||
diff --git a/arch/sparc/kernel/kgdb_64.c b/arch/sparc/kernel/kgdb_64.c index fefbe6dc51be..f5a0fd490b59 100644 --- a/arch/sparc/kernel/kgdb_64.c +++ b/arch/sparc/kernel/kgdb_64.c | |||
@@ -108,7 +108,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) | |||
108 | } | 108 | } |
109 | 109 | ||
110 | #ifdef CONFIG_SMP | 110 | #ifdef CONFIG_SMP |
111 | void smp_kgdb_capture_client(struct pt_regs *regs) | 111 | void smp_kgdb_capture_client(int irq, struct pt_regs *regs) |
112 | { | 112 | { |
113 | unsigned long flags; | 113 | unsigned long flags; |
114 | 114 | ||
diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c index adaaed4ea2fb..00d034ea2164 100644 --- a/arch/sparc/kernel/led.c +++ b/arch/sparc/kernel/led.c | |||
@@ -126,7 +126,6 @@ static int __init led_init(void) | |||
126 | led = proc_create("led", 0, NULL, &led_proc_fops); | 126 | led = proc_create("led", 0, NULL, &led_proc_fops); |
127 | if (!led) | 127 | if (!led) |
128 | return -ENOMEM; | 128 | return -ENOMEM; |
129 | led->owner = THIS_MODULE; | ||
130 | 129 | ||
131 | printk(KERN_INFO | 130 | printk(KERN_INFO |
132 | "led: version %s, Lars Kotthoff <metalhead@metalhead.ws>\n", | 131 | "led: version %s, Lars Kotthoff <metalhead@metalhead.ws>\n", |
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c index 3f79f0c23a08..f0e6ed23a468 100644 --- a/arch/sparc/kernel/mdesc.c +++ b/arch/sparc/kernel/mdesc.c | |||
@@ -567,7 +567,7 @@ static void __init report_platform_properties(void) | |||
567 | max_cpu = NR_CPUS; | 567 | max_cpu = NR_CPUS; |
568 | } | 568 | } |
569 | for (i = 0; i < max_cpu; i++) | 569 | for (i = 0; i < max_cpu; i++) |
570 | cpu_set(i, cpu_possible_map); | 570 | set_cpu_possible(i, true); |
571 | } | 571 | } |
572 | #endif | 572 | #endif |
573 | 573 | ||
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c index f3577223c863..2c0cc72d295b 100644 --- a/arch/sparc/kernel/nmi.c +++ b/arch/sparc/kernel/nmi.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/kprobes.h> | 14 | #include <linux/kprobes.h> |
15 | #include <linux/kernel_stat.h> | 15 | #include <linux/kernel_stat.h> |
16 | #include <linux/reboot.h> | ||
16 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
17 | #include <linux/kdebug.h> | 18 | #include <linux/kdebug.h> |
18 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
@@ -206,13 +207,33 @@ void nmi_adjust_hz(unsigned int new_hz) | |||
206 | } | 207 | } |
207 | EXPORT_SYMBOL_GPL(nmi_adjust_hz); | 208 | EXPORT_SYMBOL_GPL(nmi_adjust_hz); |
208 | 209 | ||
210 | static int nmi_shutdown(struct notifier_block *nb, unsigned long cmd, void *p) | ||
211 | { | ||
212 | on_each_cpu(stop_watchdog, NULL, 1); | ||
213 | return 0; | ||
214 | } | ||
215 | |||
216 | static struct notifier_block nmi_reboot_notifier = { | ||
217 | .notifier_call = nmi_shutdown, | ||
218 | }; | ||
219 | |||
209 | int __init nmi_init(void) | 220 | int __init nmi_init(void) |
210 | { | 221 | { |
222 | int err; | ||
223 | |||
211 | nmi_usable = 1; | 224 | nmi_usable = 1; |
212 | 225 | ||
213 | on_each_cpu(start_watchdog, NULL, 1); | 226 | on_each_cpu(start_watchdog, NULL, 1); |
214 | 227 | ||
215 | return check_nmi_watchdog(); | 228 | err = check_nmi_watchdog(); |
229 | if (!err) { | ||
230 | err = register_reboot_notifier(&nmi_reboot_notifier); | ||
231 | if (err) { | ||
232 | nmi_usable = 0; | ||
233 | on_each_cpu(stop_watchdog, NULL, 1); | ||
234 | } | ||
235 | } | ||
236 | return err; | ||
216 | } | 237 | } |
217 | 238 | ||
218 | static int __init setup_nmi_watchdog(char *str) | 239 | static int __init setup_nmi_watchdog(char *str) |
diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c index 64e6edf17b9d..b775658a927d 100644 --- a/arch/sparc/kernel/pci_common.c +++ b/arch/sparc/kernel/pci_common.c | |||
@@ -368,7 +368,7 @@ static void pci_register_iommu_region(struct pci_pbm_info *pbm) | |||
368 | const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); | 368 | const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); |
369 | 369 | ||
370 | if (vdma) { | 370 | if (vdma) { |
371 | struct resource *rp = kmalloc(sizeof(*rp), GFP_KERNEL); | 371 | struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); |
372 | 372 | ||
373 | if (!rp) { | 373 | if (!rp) { |
374 | prom_printf("Cannot allocate IOMMU resource.\n"); | 374 | prom_printf("Cannot allocate IOMMU resource.\n"); |
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index f4bee35a1b46..2830b415e214 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
@@ -455,7 +455,7 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags, | |||
455 | */ | 455 | */ |
456 | extern void ret_from_fork(void); | 456 | extern void ret_from_fork(void); |
457 | 457 | ||
458 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | 458 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
459 | unsigned long unused, | 459 | unsigned long unused, |
460 | struct task_struct *p, struct pt_regs *regs) | 460 | struct task_struct *p, struct pt_regs *regs) |
461 | { | 461 | { |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index a73954b87f0a..4041f94e7724 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -561,7 +561,7 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags, | |||
561 | * Parent --> %o0 == childs pid, %o1 == 0 | 561 | * Parent --> %o0 == childs pid, %o1 == 0 |
562 | * Child --> %o0 == parents pid, %o1 == 1 | 562 | * Child --> %o0 == parents pid, %o1 == 1 |
563 | */ | 563 | */ |
564 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | 564 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
565 | unsigned long unused, | 565 | unsigned long unused, |
566 | struct task_struct *p, struct pt_regs *regs) | 566 | struct task_struct *p, struct pt_regs *regs) |
567 | { | 567 | { |
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c index edecca7b8116..ca55c7012f77 100644 --- a/arch/sparc/kernel/prom_64.c +++ b/arch/sparc/kernel/prom_64.c | |||
@@ -518,8 +518,8 @@ void __init of_fill_in_cpu_data(void) | |||
518 | } | 518 | } |
519 | 519 | ||
520 | #ifdef CONFIG_SMP | 520 | #ifdef CONFIG_SMP |
521 | cpu_set(cpuid, cpu_present_map); | 521 | set_cpu_present(cpuid, true); |
522 | cpu_set(cpuid, cpu_possible_map); | 522 | set_cpu_possible(cpuid, true); |
523 | #endif | 523 | #endif |
524 | } | 524 | } |
525 | 525 | ||
diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c index 1e5ac4e282e1..132d81fb2616 100644 --- a/arch/sparc/kernel/smp_32.c +++ b/arch/sparc/kernel/smp_32.c | |||
@@ -70,13 +70,12 @@ void __init smp_cpus_done(unsigned int max_cpus) | |||
70 | extern void smp4m_smp_done(void); | 70 | extern void smp4m_smp_done(void); |
71 | extern void smp4d_smp_done(void); | 71 | extern void smp4d_smp_done(void); |
72 | unsigned long bogosum = 0; | 72 | unsigned long bogosum = 0; |
73 | int cpu, num; | 73 | int cpu, num = 0; |
74 | 74 | ||
75 | for (cpu = 0, num = 0; cpu < NR_CPUS; cpu++) | 75 | for_each_online_cpu(cpu) { |
76 | if (cpu_online(cpu)) { | 76 | num++; |
77 | num++; | 77 | bogosum += cpu_data(cpu).udelay_val; |
78 | bogosum += cpu_data(cpu).udelay_val; | 78 | } |
79 | } | ||
80 | 79 | ||
81 | printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n", | 80 | printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n", |
82 | num, bogosum/(500000/HZ), | 81 | num, bogosum/(500000/HZ), |
@@ -144,7 +143,7 @@ void smp_flush_tlb_all(void) | |||
144 | void smp_flush_cache_mm(struct mm_struct *mm) | 143 | void smp_flush_cache_mm(struct mm_struct *mm) |
145 | { | 144 | { |
146 | if(mm->context != NO_CONTEXT) { | 145 | if(mm->context != NO_CONTEXT) { |
147 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 146 | cpumask_t cpu_mask = *mm_cpumask(mm); |
148 | cpu_clear(smp_processor_id(), cpu_mask); | 147 | cpu_clear(smp_processor_id(), cpu_mask); |
149 | if (!cpus_empty(cpu_mask)) | 148 | if (!cpus_empty(cpu_mask)) |
150 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm); | 149 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm); |
@@ -155,12 +154,13 @@ void smp_flush_cache_mm(struct mm_struct *mm) | |||
155 | void smp_flush_tlb_mm(struct mm_struct *mm) | 154 | void smp_flush_tlb_mm(struct mm_struct *mm) |
156 | { | 155 | { |
157 | if(mm->context != NO_CONTEXT) { | 156 | if(mm->context != NO_CONTEXT) { |
158 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 157 | cpumask_t cpu_mask = *mm_cpumask(mm); |
159 | cpu_clear(smp_processor_id(), cpu_mask); | 158 | cpu_clear(smp_processor_id(), cpu_mask); |
160 | if (!cpus_empty(cpu_mask)) { | 159 | if (!cpus_empty(cpu_mask)) { |
161 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm); | 160 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm); |
162 | if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm) | 161 | if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm) |
163 | mm->cpu_vm_mask = cpumask_of_cpu(smp_processor_id()); | 162 | cpumask_copy(mm_cpumask(mm), |
163 | cpumask_of(smp_processor_id())); | ||
164 | } | 164 | } |
165 | local_flush_tlb_mm(mm); | 165 | local_flush_tlb_mm(mm); |
166 | } | 166 | } |
@@ -172,7 +172,7 @@ void smp_flush_cache_range(struct vm_area_struct *vma, unsigned long start, | |||
172 | struct mm_struct *mm = vma->vm_mm; | 172 | struct mm_struct *mm = vma->vm_mm; |
173 | 173 | ||
174 | if (mm->context != NO_CONTEXT) { | 174 | if (mm->context != NO_CONTEXT) { |
175 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 175 | cpumask_t cpu_mask = *mm_cpumask(mm); |
176 | cpu_clear(smp_processor_id(), cpu_mask); | 176 | cpu_clear(smp_processor_id(), cpu_mask); |
177 | if (!cpus_empty(cpu_mask)) | 177 | if (!cpus_empty(cpu_mask)) |
178 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end); | 178 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end); |
@@ -186,7 +186,7 @@ void smp_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | |||
186 | struct mm_struct *mm = vma->vm_mm; | 186 | struct mm_struct *mm = vma->vm_mm; |
187 | 187 | ||
188 | if (mm->context != NO_CONTEXT) { | 188 | if (mm->context != NO_CONTEXT) { |
189 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 189 | cpumask_t cpu_mask = *mm_cpumask(mm); |
190 | cpu_clear(smp_processor_id(), cpu_mask); | 190 | cpu_clear(smp_processor_id(), cpu_mask); |
191 | if (!cpus_empty(cpu_mask)) | 191 | if (!cpus_empty(cpu_mask)) |
192 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end); | 192 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end); |
@@ -199,7 +199,7 @@ void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page) | |||
199 | struct mm_struct *mm = vma->vm_mm; | 199 | struct mm_struct *mm = vma->vm_mm; |
200 | 200 | ||
201 | if(mm->context != NO_CONTEXT) { | 201 | if(mm->context != NO_CONTEXT) { |
202 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 202 | cpumask_t cpu_mask = *mm_cpumask(mm); |
203 | cpu_clear(smp_processor_id(), cpu_mask); | 203 | cpu_clear(smp_processor_id(), cpu_mask); |
204 | if (!cpus_empty(cpu_mask)) | 204 | if (!cpus_empty(cpu_mask)) |
205 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page); | 205 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page); |
@@ -212,7 +212,7 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) | |||
212 | struct mm_struct *mm = vma->vm_mm; | 212 | struct mm_struct *mm = vma->vm_mm; |
213 | 213 | ||
214 | if(mm->context != NO_CONTEXT) { | 214 | if(mm->context != NO_CONTEXT) { |
215 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 215 | cpumask_t cpu_mask = *mm_cpumask(mm); |
216 | cpu_clear(smp_processor_id(), cpu_mask); | 216 | cpu_clear(smp_processor_id(), cpu_mask); |
217 | if (!cpus_empty(cpu_mask)) | 217 | if (!cpus_empty(cpu_mask)) |
218 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page); | 218 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page); |
@@ -241,7 +241,7 @@ void smp_flush_page_to_ram(unsigned long page) | |||
241 | 241 | ||
242 | void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) | 242 | void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) |
243 | { | 243 | { |
244 | cpumask_t cpu_mask = mm->cpu_vm_mask; | 244 | cpumask_t cpu_mask = *mm_cpumask(mm); |
245 | cpu_clear(smp_processor_id(), cpu_mask); | 245 | cpu_clear(smp_processor_id(), cpu_mask); |
246 | if (!cpus_empty(cpu_mask)) | 246 | if (!cpus_empty(cpu_mask)) |
247 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr); | 247 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr); |
@@ -332,8 +332,8 @@ void __init smp_setup_cpu_possible_map(void) | |||
332 | instance = 0; | 332 | instance = 0; |
333 | while (!cpu_find_by_instance(instance, NULL, &mid)) { | 333 | while (!cpu_find_by_instance(instance, NULL, &mid)) { |
334 | if (mid < NR_CPUS) { | 334 | if (mid < NR_CPUS) { |
335 | cpu_set(mid, cpu_possible_map); | 335 | set_cpu_possible(mid, true); |
336 | cpu_set(mid, cpu_present_map); | 336 | set_cpu_present(mid, true); |
337 | } | 337 | } |
338 | instance++; | 338 | instance++; |
339 | } | 339 | } |
@@ -351,8 +351,8 @@ void __init smp_prepare_boot_cpu(void) | |||
351 | printk("boot cpu id != 0, this could work but is untested\n"); | 351 | printk("boot cpu id != 0, this could work but is untested\n"); |
352 | 352 | ||
353 | current_thread_info()->cpu = cpuid; | 353 | current_thread_info()->cpu = cpuid; |
354 | cpu_set(cpuid, cpu_online_map); | 354 | set_cpu_online(cpuid, true); |
355 | cpu_set(cpuid, cpu_possible_map); | 355 | set_cpu_possible(cpuid, true); |
356 | } | 356 | } |
357 | 357 | ||
358 | int __cpuinit __cpu_up(unsigned int cpu) | 358 | int __cpuinit __cpu_up(unsigned int cpu) |
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index 6cd1a5b65067..708e12a26b05 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c | |||
@@ -808,9 +808,9 @@ static void smp_start_sync_tick_client(int cpu) | |||
808 | 808 | ||
809 | extern unsigned long xcall_call_function; | 809 | extern unsigned long xcall_call_function; |
810 | 810 | ||
811 | void arch_send_call_function_ipi(cpumask_t mask) | 811 | void arch_send_call_function_ipi_mask(const struct cpumask *mask) |
812 | { | 812 | { |
813 | xcall_deliver((u64) &xcall_call_function, 0, 0, &mask); | 813 | xcall_deliver((u64) &xcall_call_function, 0, 0, mask); |
814 | } | 814 | } |
815 | 815 | ||
816 | extern unsigned long xcall_call_function_single; | 816 | extern unsigned long xcall_call_function_single; |
@@ -850,7 +850,7 @@ static void tsb_sync(void *info) | |||
850 | 850 | ||
851 | void smp_tsb_sync(struct mm_struct *mm) | 851 | void smp_tsb_sync(struct mm_struct *mm) |
852 | { | 852 | { |
853 | smp_call_function_mask(mm->cpu_vm_mask, tsb_sync, mm, 1); | 853 | smp_call_function_many(mm_cpumask(mm), tsb_sync, mm, 1); |
854 | } | 854 | } |
855 | 855 | ||
856 | extern unsigned long xcall_flush_tlb_mm; | 856 | extern unsigned long xcall_flush_tlb_mm; |
@@ -1031,7 +1031,7 @@ void smp_fetch_global_regs(void) | |||
1031 | * If the address space is non-shared (ie. mm->count == 1) we avoid | 1031 | * If the address space is non-shared (ie. mm->count == 1) we avoid |
1032 | * cross calls when we want to flush the currently running process's | 1032 | * cross calls when we want to flush the currently running process's |
1033 | * tlb state. This is done by clearing all cpu bits except the current | 1033 | * tlb state. This is done by clearing all cpu bits except the current |
1034 | * processor's in current->active_mm->cpu_vm_mask and performing the | 1034 | * processor's in current->mm->cpu_vm_mask and performing the |
1035 | * flush locally only. This will force any subsequent cpus which run | 1035 | * flush locally only. This will force any subsequent cpus which run |
1036 | * this task to flush the context from the local tlb if the process | 1036 | * this task to flush the context from the local tlb if the process |
1037 | * migrates to another cpu (again). | 1037 | * migrates to another cpu (again). |
@@ -1055,13 +1055,13 @@ void smp_flush_tlb_mm(struct mm_struct *mm) | |||
1055 | int cpu = get_cpu(); | 1055 | int cpu = get_cpu(); |
1056 | 1056 | ||
1057 | if (atomic_read(&mm->mm_users) == 1) { | 1057 | if (atomic_read(&mm->mm_users) == 1) { |
1058 | mm->cpu_vm_mask = cpumask_of_cpu(cpu); | 1058 | cpumask_copy(mm_cpumask(mm), cpumask_of(cpu)); |
1059 | goto local_flush_and_out; | 1059 | goto local_flush_and_out; |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | smp_cross_call_masked(&xcall_flush_tlb_mm, | 1062 | smp_cross_call_masked(&xcall_flush_tlb_mm, |
1063 | ctx, 0, 0, | 1063 | ctx, 0, 0, |
1064 | &mm->cpu_vm_mask); | 1064 | mm_cpumask(mm)); |
1065 | 1065 | ||
1066 | local_flush_and_out: | 1066 | local_flush_and_out: |
1067 | __flush_tlb_mm(ctx, SECONDARY_CONTEXT); | 1067 | __flush_tlb_mm(ctx, SECONDARY_CONTEXT); |
@@ -1074,12 +1074,12 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long | |||
1074 | u32 ctx = CTX_HWBITS(mm->context); | 1074 | u32 ctx = CTX_HWBITS(mm->context); |
1075 | int cpu = get_cpu(); | 1075 | int cpu = get_cpu(); |
1076 | 1076 | ||
1077 | if (mm == current->active_mm && atomic_read(&mm->mm_users) == 1) | 1077 | if (mm == current->mm && atomic_read(&mm->mm_users) == 1) |
1078 | mm->cpu_vm_mask = cpumask_of_cpu(cpu); | 1078 | cpumask_copy(mm_cpumask(mm), cpumask_of(cpu)); |
1079 | else | 1079 | else |
1080 | smp_cross_call_masked(&xcall_flush_tlb_pending, | 1080 | smp_cross_call_masked(&xcall_flush_tlb_pending, |
1081 | ctx, nr, (unsigned long) vaddrs, | 1081 | ctx, nr, (unsigned long) vaddrs, |
1082 | &mm->cpu_vm_mask); | 1082 | mm_cpumask(mm)); |
1083 | 1083 | ||
1084 | __flush_tlb_pending(ctx, nr, vaddrs); | 1084 | __flush_tlb_pending(ctx, nr, vaddrs); |
1085 | 1085 | ||
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index 3369fef5b4b3..ab036a72de5a 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c | |||
@@ -326,7 +326,6 @@ int sun4d_request_irq(unsigned int irq, | |||
326 | 326 | ||
327 | action->handler = handler; | 327 | action->handler = handler; |
328 | action->flags = irqflags; | 328 | action->flags = irqflags; |
329 | cpus_clear(action->mask); | ||
330 | action->name = devname; | 329 | action->name = devname; |
331 | action->next = NULL; | 330 | action->next = NULL; |
332 | action->dev_id = dev_id; | 331 | action->dev_id = dev_id; |
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index 50afaed99c8a..54fb02468f0d 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c | |||
@@ -150,7 +150,7 @@ void __cpuinit smp4d_callin(void) | |||
150 | spin_lock_irqsave(&sun4d_imsk_lock, flags); | 150 | spin_lock_irqsave(&sun4d_imsk_lock, flags); |
151 | cc_set_imsk(cc_get_imsk() & ~0x4000); /* Allow PIL 14 as well */ | 151 | cc_set_imsk(cc_get_imsk() & ~0x4000); /* Allow PIL 14 as well */ |
152 | spin_unlock_irqrestore(&sun4d_imsk_lock, flags); | 152 | spin_unlock_irqrestore(&sun4d_imsk_lock, flags); |
153 | cpu_set(cpuid, cpu_online_map); | 153 | set_cpu_online(cpuid, true); |
154 | 154 | ||
155 | } | 155 | } |
156 | 156 | ||
@@ -228,11 +228,10 @@ void __init smp4d_smp_done(void) | |||
228 | /* setup cpu list for irq rotation */ | 228 | /* setup cpu list for irq rotation */ |
229 | first = 0; | 229 | first = 0; |
230 | prev = &first; | 230 | prev = &first; |
231 | for (i = 0; i < NR_CPUS; i++) | 231 | for_each_online_cpu(i) { |
232 | if (cpu_online(i)) { | 232 | *prev = i; |
233 | *prev = i; | 233 | prev = &cpu_data(i).next; |
234 | prev = &cpu_data(i).next; | 234 | } |
235 | } | ||
236 | *prev = first; | 235 | *prev = first; |
237 | local_flush_cache_all(); | 236 | local_flush_cache_all(); |
238 | 237 | ||
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c index 8040376c4890..960b113d0006 100644 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c | |||
@@ -113,7 +113,7 @@ void __cpuinit smp4m_callin(void) | |||
113 | 113 | ||
114 | local_irq_enable(); | 114 | local_irq_enable(); |
115 | 115 | ||
116 | cpu_set(cpuid, cpu_online_map); | 116 | set_cpu_online(cpuid, true); |
117 | } | 117 | } |
118 | 118 | ||
119 | /* | 119 | /* |
@@ -186,11 +186,9 @@ void __init smp4m_smp_done(void) | |||
186 | /* setup cpu list for irq rotation */ | 186 | /* setup cpu list for irq rotation */ |
187 | first = 0; | 187 | first = 0; |
188 | prev = &first; | 188 | prev = &first; |
189 | for (i = 0; i < NR_CPUS; i++) { | 189 | for_each_online_cpu(i) { |
190 | if (cpu_online(i)) { | 190 | *prev = i; |
191 | *prev = i; | 191 | prev = &cpu_data(i).next; |
192 | prev = &cpu_data(i).next; | ||
193 | } | ||
194 | } | 192 | } |
195 | *prev = first; | 193 | *prev = first; |
196 | local_flush_cache_all(); | 194 | local_flush_cache_all(); |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index f93c42a2b522..a8000b1cda74 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -51,7 +51,7 @@ sys_call_table32: | |||
51 | /*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 | 51 | /*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 |
52 | .word compat_sys_fcntl64, sys_inotify_rm_watch, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount | 52 | .word compat_sys_fcntl64, sys_inotify_rm_watch, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount |
53 | /*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall | 53 | /*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall |
54 | .word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr | 54 | .word sys_quotactl, sys_set_tid_address, compat_sys_mount, compat_sys_ustat, sys32_setxattr |
55 | /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents | 55 | /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents |
56 | .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr | 56 | .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr |
57 | /*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall | 57 | /*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall |
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c index f95066b6f805..db310aa00183 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c | |||
@@ -36,10 +36,10 @@ | |||
36 | #include <linux/clocksource.h> | 36 | #include <linux/clocksource.h> |
37 | #include <linux/of_device.h> | 37 | #include <linux/of_device.h> |
38 | #include <linux/platform_device.h> | 38 | #include <linux/platform_device.h> |
39 | #include <linux/irq.h> | ||
40 | 39 | ||
41 | #include <asm/oplib.h> | 40 | #include <asm/oplib.h> |
42 | #include <asm/timer.h> | 41 | #include <asm/timer.h> |
42 | #include <asm/irq.h> | ||
43 | #include <asm/io.h> | 43 | #include <asm/io.h> |
44 | #include <asm/prom.h> | 44 | #include <asm/prom.h> |
45 | #include <asm/starfire.h> | 45 | #include <asm/starfire.h> |
diff --git a/arch/sparc/kernel/ttable.S b/arch/sparc/kernel/ttable.S index d9bdfb9d5c18..76d837fc47d3 100644 --- a/arch/sparc/kernel/ttable.S +++ b/arch/sparc/kernel/ttable.S | |||
@@ -64,7 +64,12 @@ tl0_irq6: TRAP_IRQ(smp_call_function_single_client, 6) | |||
64 | tl0_irq6: BTRAP(0x46) | 64 | tl0_irq6: BTRAP(0x46) |
65 | #endif | 65 | #endif |
66 | tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7) | 66 | tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7) |
67 | tl0_irq8: BTRAP(0x48) BTRAP(0x49) | 67 | #ifdef CONFIG_KGDB |
68 | tl0_irq8: TRAP_IRQ(smp_kgdb_capture_client, 8) | ||
69 | #else | ||
70 | tl0_irq8: BTRAP(0x48) | ||
71 | #endif | ||
72 | tl0_irq9: BTRAP(0x49) | ||
68 | tl0_irq10: BTRAP(0x4a) BTRAP(0x4b) BTRAP(0x4c) BTRAP(0x4d) | 73 | tl0_irq10: BTRAP(0x4a) BTRAP(0x4b) BTRAP(0x4c) BTRAP(0x4d) |
69 | tl0_irq14: TRAP_IRQ(timer_interrupt, 14) | 74 | tl0_irq14: TRAP_IRQ(timer_interrupt, 14) |
70 | tl0_irq15: TRAP_NMI_IRQ(perfctr_irq, 15) | 75 | tl0_irq15: TRAP_NMI_IRQ(perfctr_irq, 15) |
diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c index 752d0c9fb544..7916feba6e4a 100644 --- a/arch/sparc/mm/highmem.c +++ b/arch/sparc/mm/highmem.c | |||
@@ -39,6 +39,7 @@ void *kmap_atomic(struct page *page, enum km_type type) | |||
39 | if (!PageHighMem(page)) | 39 | if (!PageHighMem(page)) |
40 | return page_address(page); | 40 | return page_address(page); |
41 | 41 | ||
42 | debug_kmap_atomic(type); | ||
42 | idx = type + KM_TYPE_NR*smp_processor_id(); | 43 | idx = type + KM_TYPE_NR*smp_processor_id(); |
43 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 44 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
44 | 45 | ||
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 00373ce2d8fb..2c8dfeb7ab04 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -1092,7 +1092,7 @@ static void __init numa_parse_mdesc_group_cpus(struct mdesc_handle *md, | |||
1092 | if (strcmp(name, "cpu")) | 1092 | if (strcmp(name, "cpu")) |
1093 | continue; | 1093 | continue; |
1094 | id = mdesc_get_property(md, target, "id", NULL); | 1094 | id = mdesc_get_property(md, target, "id", NULL); |
1095 | if (*id < NR_CPUS) | 1095 | if (*id < nr_cpu_ids) |
1096 | cpu_set(*id, *mask); | 1096 | cpu_set(*id, *mask); |
1097 | } | 1097 | } |
1098 | } | 1098 | } |
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index fe7ed08390bb..06c9a7d98206 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -1425,7 +1425,7 @@ static void __init init_vac_layout(void) | |||
1425 | min_line_size = vac_line_size; | 1425 | min_line_size = vac_line_size; |
1426 | //FIXME: cpus not contiguous!! | 1426 | //FIXME: cpus not contiguous!! |
1427 | cpu++; | 1427 | cpu++; |
1428 | if (cpu >= NR_CPUS || !cpu_online(cpu)) | 1428 | if (cpu >= nr_cpu_ids || !cpu_online(cpu)) |
1429 | break; | 1429 | break; |
1430 | #else | 1430 | #else |
1431 | break; | 1431 | break; |
diff --git a/arch/sparc/mm/ultra.S b/arch/sparc/mm/ultra.S index 80c788ec7c32..b57a5942ba64 100644 --- a/arch/sparc/mm/ultra.S +++ b/arch/sparc/mm/ultra.S | |||
@@ -679,28 +679,8 @@ xcall_new_mmu_context_version: | |||
679 | #ifdef CONFIG_KGDB | 679 | #ifdef CONFIG_KGDB |
680 | .globl xcall_kgdb_capture | 680 | .globl xcall_kgdb_capture |
681 | xcall_kgdb_capture: | 681 | xcall_kgdb_capture: |
682 | 661: rdpr %pstate, %g2 | 682 | wr %g0, (1 << PIL_KGDB_CAPTURE), %set_softint |
683 | wrpr %g2, PSTATE_IG | PSTATE_AG, %pstate | 683 | retry |
684 | .section .sun4v_2insn_patch, "ax" | ||
685 | .word 661b | ||
686 | nop | ||
687 | nop | ||
688 | .previous | ||
689 | |||
690 | rdpr %pil, %g2 | ||
691 | wrpr %g0, PIL_NORMAL_MAX, %pil | ||
692 | sethi %hi(109f), %g7 | ||
693 | ba,pt %xcc, etrap_irq | ||
694 | 109: or %g7, %lo(109b), %g7 | ||
695 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
696 | call trace_hardirqs_off | ||
697 | nop | ||
698 | #endif | ||
699 | call smp_kgdb_capture_client | ||
700 | add %sp, PTREGS_OFF, %o0 | ||
701 | /* Has to be a non-v9 branch due to the large distance. */ | ||
702 | ba rtrap_xcall | ||
703 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 | ||
704 | #endif | 684 | #endif |
705 | 685 | ||
706 | #endif /* CONFIG_SMP */ | 686 | #endif /* CONFIG_SMP */ |