From deea66757be9c01642963c2951fc30192ce1860b Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Tue, 13 Jul 2004 19:37:15 -0700 Subject: [PATCH] [PATCH] sparse: missing cpumask_t bits on sparc (no, it still doesn't fix sparc32-smp - just partial compile fixes ;-/) --- arch/sparc/kernel/smp.c | 30 ++++++++++++++++++++++-------- arch/sparc/kernel/sun4m_smp.c | 31 +++++++++++++++---------------- 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c index cb2399ee4aac9..fd065fb3e00c7 100644 --- a/arch/sparc/kernel/smp.c +++ b/arch/sparc/kernel/smp.c @@ -127,7 +127,9 @@ void smp_flush_tlb_all(void) void smp_flush_cache_mm(struct mm_struct *mm) { if(mm->context != NO_CONTEXT) { - if(mm->cpu_vm_mask != (1 << smp_processor_id())) + cpumask_t cpu_mask = mm->cpu_vm_mask; + cpu_clear(smp_processor_id(), cpu_mask); + if (!cpus_empty(cpu_mask)) xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm); local_flush_cache_mm(mm); } @@ -136,10 +138,12 @@ void smp_flush_cache_mm(struct mm_struct *mm) void smp_flush_tlb_mm(struct mm_struct *mm) { if(mm->context != NO_CONTEXT) { - if(mm->cpu_vm_mask != (1 << smp_processor_id())) { + cpumask_t cpu_mask = mm->cpu_vm_mask; + cpu_clear(smp_processor_id(), cpu_mask); + if (!cpus_empty(cpu_mask)) { xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm); if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm) - mm->cpu_vm_mask = (1 << smp_processor_id()); + mm->cpu_vm_mask = cpumask_of_cpu(smp_processor_id()); } local_flush_tlb_mm(mm); } @@ -151,7 +155,9 @@ void smp_flush_cache_range(struct vm_area_struct *vma, unsigned long start, struct mm_struct *mm = vma->vm_mm; if (mm->context != NO_CONTEXT) { - if(mm->cpu_vm_mask != (1 << smp_processor_id())) + cpumask_t cpu_mask = mm->cpu_vm_mask; + cpu_clear(smp_processor_id(), cpu_mask); + if (!cpus_empty(cpu_mask)) xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end); local_flush_cache_range(vma, start, end); } @@ -163,7 +169,9 @@ void smp_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, struct mm_struct *mm = vma->vm_mm; if (mm->context != NO_CONTEXT) { - if(mm->cpu_vm_mask != (1 << smp_processor_id())) + cpumask_t cpu_mask = mm->cpu_vm_mask; + cpu_clear(smp_processor_id(), cpu_mask); + if (!cpus_empty(cpu_mask)) xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end); local_flush_tlb_range(vma, start, end); } @@ -174,7 +182,9 @@ void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page) struct mm_struct *mm = vma->vm_mm; if(mm->context != NO_CONTEXT) { - if(mm->cpu_vm_mask != (1 << smp_processor_id())) + cpumask_t cpu_mask = mm->cpu_vm_mask; + cpu_clear(smp_processor_id(), cpu_mask); + if (!cpus_empty(cpu_mask)) xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page); local_flush_cache_page(vma, page); } @@ -185,7 +195,9 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) struct mm_struct *mm = vma->vm_mm; if(mm->context != NO_CONTEXT) { - if(mm->cpu_vm_mask != (1 << smp_processor_id())) + cpumask_t cpu_mask = mm->cpu_vm_mask; + cpu_clear(smp_processor_id(), cpu_mask); + if (!cpus_empty(cpu_mask)) xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page); local_flush_tlb_page(vma, page); } @@ -207,7 +219,9 @@ void smp_flush_page_to_ram(unsigned long page) void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) { - if(mm->cpu_vm_mask != (1 << smp_processor_id())) + cpumask_t cpu_mask = mm->cpu_vm_mask; + cpu_clear(smp_processor_id(), cpu_mask); + if (!cpus_empty(cpu_mask)) xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr); local_flush_sig_insns(mm, insn_addr); } diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c index 65bb10ff3353b..01587b1608195 100644 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c @@ -40,7 +40,6 @@ extern ctxd_t *srmmu_ctx_table_phys; extern void calibrate_delay(void); extern volatile int smp_processors_ready; -extern unsigned long cpu_present_map; extern int smp_num_cpus; extern int smp_threads_ready; extern volatile unsigned long cpu_callin_map[NR_CPUS]; @@ -146,10 +145,10 @@ void __init smp4m_boot_cpus(void) printk("Entering SMP Mode...\n"); local_irq_enable(); - cpu_present_map = 0; + cpus_clear(cpu_present_map); for (i = 0; !cpu_find_by_instance(i, NULL, &mid); i++) - cpu_present_map |= (1<