Lines Matching refs:cpu
82 unsigned int cpu, i; in show_ipi_list() local
86 for_each_online_cpu(cpu) in show_ipi_list()
87 seq_printf(p, "%10u ", per_cpu(irq_stat, cpu).ipi_irqs[i]); in show_ipi_list()
93 static void csr_mail_send(uint64_t data, int cpu, int mailbox) in csr_mail_send() argument
100 val |= (cpu << IOCSR_MBUF_SEND_CPU_SHIFT); in csr_mail_send()
107 val |= (cpu << IOCSR_MBUF_SEND_CPU_SHIFT); in csr_mail_send()
112 static u32 ipi_read_clear(int cpu) in ipi_read_clear() argument
125 static void ipi_write_action(int cpu, u32 action) in ipi_write_action() argument
133 val |= (cpu << IOCSR_IPI_SEND_CPU_SHIFT); in ipi_write_action()
139 void loongson_send_ipi_single(int cpu, unsigned int action) in loongson_send_ipi_single() argument
141 ipi_write_action(cpu_logical_map(cpu), (u32)action); in loongson_send_ipi_single()
157 void smp_send_reschedule(int cpu) in smp_send_reschedule() argument
159 loongson_send_ipi_single(cpu, SMP_RESCHEDULE); in smp_send_reschedule()
166 unsigned int cpu = smp_processor_id(); in loongson_ipi_interrupt() local
168 action = ipi_read_clear(cpu_logical_map(cpu)); in loongson_ipi_interrupt()
172 per_cpu(irq_stat, cpu).ipi_irqs[IPI_RESCHEDULE]++; in loongson_ipi_interrupt()
177 per_cpu(irq_stat, cpu).ipi_irqs[IPI_CALL_FUNCTION]++; in loongson_ipi_interrupt()
207 void loongson_boot_secondary(int cpu, struct task_struct *idle) in loongson_boot_secondary() argument
211 pr_info("Booting CPU#%d...\n", cpu); in loongson_boot_secondary()
217 csr_mail_send(entry, cpu_logical_map(cpu), 0); in loongson_boot_secondary()
219 loongson_send_ipi_single(cpu, SMP_BOOT_CPU); in loongson_boot_secondary()
227 unsigned int cpu = smp_processor_id(); in loongson_init_secondary() local
236 numa_add_cpu(cpu); in loongson_init_secondary()
238 per_cpu(cpu_state, cpu) = CPU_ONLINE; in loongson_init_secondary()
239 cpu_data[cpu].core = in loongson_init_secondary()
240 cpu_logical_map(cpu) % loongson_sysconf.cores_per_package; in loongson_init_secondary()
241 cpu_data[cpu].package = in loongson_init_secondary()
242 cpu_logical_map(cpu) / loongson_sysconf.cores_per_package; in loongson_init_secondary()
257 unsigned int cpu = smp_processor_id(); in loongson_cpu_disable() local
259 if (io_master(cpu)) in loongson_cpu_disable()
263 numa_remove_cpu(cpu); in loongson_cpu_disable()
265 set_cpu_online(cpu, false); in loongson_cpu_disable()
276 void loongson_cpu_die(unsigned int cpu) in loongson_cpu_die() argument
278 while (per_cpu(cpu_state, cpu) != CPU_DEAD) in loongson_cpu_die()
342 static inline void set_cpu_sibling_map(int cpu) in set_cpu_sibling_map() argument
346 cpumask_set_cpu(cpu, &cpu_sibling_setup_map); in set_cpu_sibling_map()
349 cpumask_set_cpu(cpu, &cpu_sibling_map[cpu]); in set_cpu_sibling_map()
352 if (cpus_are_siblings(cpu, i)) { in set_cpu_sibling_map()
353 cpumask_set_cpu(i, &cpu_sibling_map[cpu]); in set_cpu_sibling_map()
354 cpumask_set_cpu(cpu, &cpu_sibling_map[i]); in set_cpu_sibling_map()
360 static inline void set_cpu_core_map(int cpu) in set_cpu_core_map() argument
364 cpumask_set_cpu(cpu, &cpu_core_setup_map); in set_cpu_core_map()
367 if (cpu_data[cpu].package == cpu_data[i].package) { in set_cpu_core_map()
368 cpumask_set_cpu(i, &cpu_core_map[cpu]); in set_cpu_core_map()
369 cpumask_set_cpu(cpu, &cpu_core_map[i]); in set_cpu_core_map()
402 unsigned int cpu, node, rr_node; in smp_prepare_boot_cpu() local
409 for_each_possible_cpu(cpu) { in smp_prepare_boot_cpu()
410 node = early_cpu_to_node(cpu); in smp_prepare_boot_cpu()
426 set_cpu_numa_node(cpu, node); in smp_prepare_boot_cpu()
428 set_cpu_numa_node(cpu, rr_node); in smp_prepare_boot_cpu()
438 current_thread_info()->cpu = 0; in smp_prepare_cpus()
448 int __cpu_up(unsigned int cpu, struct task_struct *tidle) in __cpu_up() argument
450 loongson_boot_secondary(cpu, tidle); in __cpu_up()
455 pr_crit("CPU%u: failed to start\n", cpu); in __cpu_up()
471 unsigned int cpu; in start_secondary() local
474 cpu = smp_processor_id(); in start_secondary()
475 set_my_cpu_offset(per_cpu_offset(cpu)); in start_secondary()
481 set_cpu_sibling_map(cpu); in start_secondary()
482 set_cpu_core_map(cpu); in start_secondary()
484 notify_cpu_starting(cpu); in start_secondary()
490 set_cpu_online(cpu, true); in start_secondary()
557 unsigned int cpu; in flush_tlb_mm() local
559 for_each_online_cpu(cpu) { in flush_tlb_mm()
560 if (cpu != smp_processor_id() && cpu_context(cpu, mm)) in flush_tlb_mm()
561 cpu_context(cpu, mm) = 0; in flush_tlb_mm()
596 unsigned int cpu; in flush_tlb_range() local
598 for_each_online_cpu(cpu) { in flush_tlb_range()
599 if (cpu != smp_processor_id() && cpu_context(cpu, mm)) in flush_tlb_range()
600 cpu_context(cpu, mm) = 0; in flush_tlb_range()
642 unsigned int cpu; in flush_tlb_page() local
644 for_each_online_cpu(cpu) { in flush_tlb_page()
645 if (cpu != smp_processor_id() && cpu_context(cpu, vma->vm_mm)) in flush_tlb_page()
646 cpu_context(cpu, vma->vm_mm) = 0; in flush_tlb_page()