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 ([email protected])
22 #include <linux/smp.h>
54 /* A collection of per-processor data. */
78 * per-processor storage.
90 * Ideally sets up per-cpu profiling hooks. Doesn't do much now...
142 /* Call platform-specific callin, if specified */ in smp_callin()
148 current->active_mm = &init_mm; in smp_callin()
168 cpuid, current, current->active_mm)); in smp_callin()
173 /* Wait until hwrpb->txrdy is clear for cpu. Return -1 on timeout. */
179 if (!(hwrpb->txrdy & cpumask)) in wait_for_txrdy()
184 if (!(hwrpb->txrdy & cpumask)) in wait_for_txrdy()
190 return -1; in wait_for_txrdy()
195 * interesting message. ;-)
207 + hwrpb->processor_offset in send_secondary_console_msg()
208 + cpuid * hwrpb->processor_size); in send_secondary_console_msg()
216 *(unsigned int *)&cpu->ipc_buffer[0] = len; in send_secondary_console_msg()
217 cp1 = (char *) &cpu->ipc_buffer[1]; in send_secondary_console_msg()
222 set_bit(cpuid, &hwrpb->rxrdy); in send_secondary_console_msg()
239 unsigned long txrdy = hwrpb->txrdy; in recv_secondary_console_msg()
256 + hwrpb->processor_offset in recv_secondary_console_msg()
257 + i * hwrpb->processor_size); in recv_secondary_console_msg()
261 mycpu, i, cpu->halt_reason, cpu->flags)); in recv_secondary_console_msg()
263 cnt = cpu->ipc_buffer[0] >> 32; in recv_secondary_console_msg()
267 cp1 = (char *) &cpu->ipc_buffer[1]; in recv_secondary_console_msg()
283 hwrpb->txrdy = 0; in recv_secondary_console_msg()
298 + hwrpb->processor_offset in secondary_cpu_start()
299 + cpuid * hwrpb->processor_size); in secondary_cpu_start()
300 hwpcb = (struct pcb_struct *) cpu->hwpcb; in secondary_cpu_start()
301 ipcb = &task_thread_info(idle)->pcb; in secondary_cpu_start()
307 hwpcb->ksp = (unsigned long)ipcb + sizeof(union thread_union) - 16; in secondary_cpu_start()
308 hwpcb->usp = 0; in secondary_cpu_start()
309 hwpcb->ptbr = ipcb->ptbr; in secondary_cpu_start()
310 hwpcb->pcc = 0; in secondary_cpu_start()
311 hwpcb->asn = 0; in secondary_cpu_start()
312 hwpcb->unique = virt_to_phys(ipcb); in secondary_cpu_start()
313 hwpcb->flags = ipcb->flags; in secondary_cpu_start()
314 hwpcb->res1 = hwpcb->res2 = 0; in secondary_cpu_start()
318 hwpcb->ksp, hwpcb->ptbr, hwrpb->vptb, hwpcb->unique)); in secondary_cpu_start()
321 cpuid, idle->state, ipcb->flags)); in secondary_cpu_start()
324 hwrpb->CPU_restart = __smp_callin; in secondary_cpu_start()
325 hwrpb->CPU_restart_data = (unsigned long) __smp_callin; in secondary_cpu_start()
335 cpu->flags |= 0x22; /* turn on Context Valid and Restart Capable */ in secondary_cpu_start()
336 cpu->flags &= ~1; /* turn off Bootstrap In Progress */ in secondary_cpu_start()
344 if (cpu->flags & 1) in secondary_cpu_start()
349 printk(KERN_ERR "SMP: Processor %d failed to start.\n", cpuid); in secondary_cpu_start()
350 return -1; in secondary_cpu_start()
366 smp_secondary_alive = -1; in smp_boot_one_cpu()
370 return -1; in smp_boot_one_cpu()
388 printk(KERN_ERR "SMP: Processor %d is stuck.\n", cpuid); in smp_boot_one_cpu()
389 return -1; in smp_boot_one_cpu()
397 * Called from setup_arch. Detect an SMP system and which processors
407 printk(KERN_WARNING "SMP: Booting off cpu %d instead of 0?\n", in setup_smp()
411 if (hwrpb->nr_processors > 1) { in setup_smp()
415 hwrpb->nr_processors)); in setup_smp()
418 ((char*)hwrpb + hwrpb->processor_offset); in setup_smp()
419 boot_cpu_palrev = cpubase->pal_revision; in setup_smp()
421 for (i = 0; i < hwrpb->nr_processors; i++) { in setup_smp()
423 ((char *)cpubase + i*hwrpb->processor_size); in setup_smp()
424 if ((cpu->flags & 0x1cc) == 0x1cc) { in setup_smp()
428 cpu->pal_revision = boot_cpu_palrev; in setup_smp()
432 i, cpu->flags, cpu->type)); in setup_smp()
434 i, cpu->pal_revision)); in setup_smp()
440 printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", in setup_smp()
453 current_thread_info()->cpu = boot_cpuid; in smp_prepare_cpus()
462 printk(KERN_INFO "SMP mode deactivated.\n"); in smp_prepare_cpus()
466 printk(KERN_INFO "SMP starting up secondaries.\n"); in smp_prepare_cpus()
476 return cpu_online(cpu) ? 0 : -ENOSYS; in __cpu_up()
489 printk(KERN_INFO "SMP: Total of %d processors activated " in smp_cpus_done()
519 this_cpu, *pending_ipis, regs->pc)); in handle_ipi()
528 which = ops & -ops; in handle_ipi()
556 if (hwrpb->txrdy) in handle_ipi()
628 if (mm == current->active_mm && !asn_locked()) in ipi_flush_tlb_mm()
639 if (mm == current->active_mm) { in flush_tlb_mm()
641 if (atomic_read(&mm->mm_users) <= 1) { in flush_tlb_mm()
646 if (mm->context[cpu]) in flush_tlb_mm()
647 mm->context[cpu] = 0; in flush_tlb_mm()
670 struct mm_struct * mm = data->mm; in ipi_flush_tlb_page()
672 if (mm == current->active_mm && !asn_locked()) in ipi_flush_tlb_page()
673 flush_tlb_current_page(mm, data->vma, data->addr); in ipi_flush_tlb_page()
682 struct mm_struct *mm = vma->vm_mm; in flush_tlb_page()
686 if (mm == current->active_mm) { in flush_tlb_page()
688 if (atomic_read(&mm->mm_users) <= 1) { in flush_tlb_page()
693 if (mm->context[cpu]) in flush_tlb_page()
694 mm->context[cpu] = 0; in flush_tlb_page()
715 flush_tlb_mm(vma->vm_mm); in flush_tlb_range()
723 if (mm == current->active_mm && !asn_locked()) in ipi_flush_icache_page()
733 struct mm_struct *mm = vma->vm_mm; in flush_icache_user_page()
735 if ((vma->vm_flags & VM_EXEC) == 0) in flush_icache_user_page()
740 if (mm == current->active_mm) { in flush_icache_user_page()
742 if (atomic_read(&mm->mm_users) <= 1) { in flush_icache_user_page()
747 if (mm->context[cpu]) in flush_icache_user_page()
748 mm->context[cpu] = 0; in flush_icache_user_page()