diff options
author | David S. Miller <davem@davemloft.net> | 2009-03-29 18:44:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-29 18:44:22 -0400 |
commit | ed223129a30de7d244ca9b59819f5532c9caf039 (patch) | |
tree | 9ea5649276c18f13356c4db1663368e071081a25 /arch/sparc/kernel | |
parent | ffaba674090f287afe0c44fd8d978c64c03581a8 (diff) | |
parent | 81f1adf01224f5c0be5f90f43664f799c1f7bb2d (diff) |
Merge branch 'master' of ssh://master.kernel.org/home/ftp/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask-for-sparc
Conflicts:
arch/sparc/kernel/smp_64.c
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/ds.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/irq_64.c | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/mdesc.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/prom_64.c | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/smp_32.c | 36 | ||||
-rw-r--r-- | arch/sparc/kernel/smp_64.c | 14 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4d_smp.c | 11 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4m_smp.c | 10 |
8 files changed, 40 insertions, 43 deletions
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/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/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/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 79457f682b5a..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; |
@@ -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); |
@@ -1075,11 +1075,11 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long | |||
1075 | int cpu = get_cpu(); | 1075 | int cpu = get_cpu(); |
1076 | 1076 | ||
1077 | if (mm == current->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_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(); |