Lines Matching +full:smp +full:- +full:capable
1 // SPDX-License-Identifier: GPL-2.0
3 * linux/arch/alpha/kernel/smp.c
5 * 2001-07-09 Phil Ezolt (Phillip.Ezolt@compaq.com)
22 #include <linux/smp.h>
53 /* A collection of per-processor data. */
77 * per-processor storage.
89 * Ideally sets up per-cpu profiling hooks. Doesn't do much now...
141 /* Call platform-specific callin, if specified */ in smp_callin()
147 current->active_mm = &init_mm; in smp_callin()
167 cpuid, current, current->active_mm)); in smp_callin()
172 /* Wait until hwrpb->txrdy is clear for cpu. Return -1 on timeout. */
178 if (!(hwrpb->txrdy & cpumask)) in wait_for_txrdy()
183 if (!(hwrpb->txrdy & cpumask)) in wait_for_txrdy()
189 return -1; in wait_for_txrdy()
194 * interesting message. ;-)
206 + hwrpb->processor_offset in send_secondary_console_msg()
207 + cpuid * hwrpb->processor_size); in send_secondary_console_msg()
215 *(unsigned int *)&cpu->ipc_buffer[0] = len; in send_secondary_console_msg()
216 cp1 = (char *) &cpu->ipc_buffer[1]; in send_secondary_console_msg()
221 set_bit(cpuid, &hwrpb->rxrdy); in send_secondary_console_msg()
238 unsigned long txrdy = hwrpb->txrdy; in recv_secondary_console_msg()
255 + hwrpb->processor_offset in recv_secondary_console_msg()
256 + i * hwrpb->processor_size); in recv_secondary_console_msg()
260 mycpu, i, cpu->halt_reason, cpu->flags)); in recv_secondary_console_msg()
262 cnt = cpu->ipc_buffer[0] >> 32; in recv_secondary_console_msg()
266 cp1 = (char *) &cpu->ipc_buffer[1]; in recv_secondary_console_msg()
282 hwrpb->txrdy = 0; in recv_secondary_console_msg()
297 + hwrpb->processor_offset in secondary_cpu_start()
298 + cpuid * hwrpb->processor_size); in secondary_cpu_start()
299 hwpcb = (struct pcb_struct *) cpu->hwpcb; in secondary_cpu_start()
300 ipcb = &task_thread_info(idle)->pcb; in secondary_cpu_start()
306 hwpcb->ksp = (unsigned long)ipcb + sizeof(union thread_union) - 16; in secondary_cpu_start()
307 hwpcb->usp = 0; in secondary_cpu_start()
308 hwpcb->ptbr = ipcb->ptbr; in secondary_cpu_start()
309 hwpcb->pcc = 0; in secondary_cpu_start()
310 hwpcb->asn = 0; in secondary_cpu_start()
311 hwpcb->unique = virt_to_phys(ipcb); in secondary_cpu_start()
312 hwpcb->flags = ipcb->flags; in secondary_cpu_start()
313 hwpcb->res1 = hwpcb->res2 = 0; in secondary_cpu_start()
317 hwpcb->ksp, hwpcb->ptbr, hwrpb->vptb, hwpcb->unique)); in secondary_cpu_start()
320 cpuid, idle->state, ipcb->flags)); in secondary_cpu_start()
323 hwrpb->CPU_restart = __smp_callin; in secondary_cpu_start()
324 hwrpb->CPU_restart_data = (unsigned long) __smp_callin; in secondary_cpu_start()
334 cpu->flags |= 0x22; /* turn on Context Valid and Restart Capable */ in secondary_cpu_start()
335 cpu->flags &= ~1; /* turn off Bootstrap In Progress */ in secondary_cpu_start()
343 if (cpu->flags & 1) in secondary_cpu_start()
348 printk(KERN_ERR "SMP: Processor %d failed to start.\n", cpuid); in secondary_cpu_start()
349 return -1; in secondary_cpu_start()
365 smp_secondary_alive = -1; in smp_boot_one_cpu()
369 return -1; in smp_boot_one_cpu()
387 printk(KERN_ERR "SMP: Processor %d is stuck.\n", cpuid); in smp_boot_one_cpu()
388 return -1; in smp_boot_one_cpu()
396 * Called from setup_arch. Detect an SMP system and which processors
406 printk(KERN_WARNING "SMP: Booting off cpu %d instead of 0?\n", in setup_smp()
410 if (hwrpb->nr_processors > 1) { in setup_smp()
414 hwrpb->nr_processors)); in setup_smp()
417 ((char*)hwrpb + hwrpb->processor_offset); in setup_smp()
418 boot_cpu_palrev = cpubase->pal_revision; in setup_smp()
420 for (i = 0; i < hwrpb->nr_processors; i++) { in setup_smp()
422 ((char *)cpubase + i*hwrpb->processor_size); in setup_smp()
423 if ((cpu->flags & 0x1cc) == 0x1cc) { in setup_smp()
427 cpu->pal_revision = boot_cpu_palrev; in setup_smp()
431 i, cpu->flags, cpu->type)); in setup_smp()
433 i, cpu->pal_revision)); in setup_smp()
439 printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", in setup_smp()
452 current_thread_info()->cpu = boot_cpuid; in smp_prepare_cpus()
461 printk(KERN_INFO "SMP mode deactivated.\n"); in smp_prepare_cpus()
465 printk(KERN_INFO "SMP starting up secondaries.\n"); in smp_prepare_cpus()
480 return cpu_online(cpu) ? 0 : -ENOSYS; in __cpu_up()
493 printk(KERN_INFO "SMP: Total of %d processors activated " in smp_cpus_done()
523 this_cpu, *pending_ipis, regs->pc)); in handle_ipi()
532 which = ops & -ops; in handle_ipi()
560 if (hwrpb->txrdy) in handle_ipi()
632 if (mm == current->active_mm && !asn_locked()) in ipi_flush_tlb_mm()
643 if (mm == current->active_mm) { in flush_tlb_mm()
645 if (atomic_read(&mm->mm_users) <= 1) { in flush_tlb_mm()
650 if (mm->context[cpu]) in flush_tlb_mm()
651 mm->context[cpu] = 0; in flush_tlb_mm()
674 struct mm_struct * mm = data->mm; in ipi_flush_tlb_page()
676 if (mm == current->active_mm && !asn_locked()) in ipi_flush_tlb_page()
677 flush_tlb_current_page(mm, data->vma, data->addr); in ipi_flush_tlb_page()
686 struct mm_struct *mm = vma->vm_mm; in flush_tlb_page()
690 if (mm == current->active_mm) { in flush_tlb_page()
692 if (atomic_read(&mm->mm_users) <= 1) { in flush_tlb_page()
697 if (mm->context[cpu]) in flush_tlb_page()
698 mm->context[cpu] = 0; in flush_tlb_page()
719 flush_tlb_mm(vma->vm_mm); in flush_tlb_range()
727 if (mm == current->active_mm && !asn_locked()) in ipi_flush_icache_page()
737 struct mm_struct *mm = vma->vm_mm; in flush_icache_user_page()
739 if ((vma->vm_flags & VM_EXEC) == 0) in flush_icache_user_page()
744 if (mm == current->active_mm) { in flush_icache_user_page()
746 if (atomic_read(&mm->mm_users) <= 1) { in flush_icache_user_page()
751 if (mm->context[cpu]) in flush_icache_user_page()
752 mm->context[cpu] = 0; in flush_icache_user_page()