Lines Matching refs:cpu
59 int cpu; in cpu_bringup() local
72 cpu = smp_processor_id(); in cpu_bringup()
73 smp_store_cpu_info(cpu); in cpu_bringup()
74 set_cpu_sibling_map(cpu); in cpu_bringup()
80 notify_cpu_starting(cpu); in cpu_bringup()
82 set_cpu_online(cpu, true); in cpu_bringup()
96 void xen_smp_intr_free_pv(unsigned int cpu) in xen_smp_intr_free_pv() argument
98 kfree(per_cpu(xen_irq_work, cpu).name); in xen_smp_intr_free_pv()
99 per_cpu(xen_irq_work, cpu).name = NULL; in xen_smp_intr_free_pv()
100 if (per_cpu(xen_irq_work, cpu).irq >= 0) { in xen_smp_intr_free_pv()
101 unbind_from_irqhandler(per_cpu(xen_irq_work, cpu).irq, NULL); in xen_smp_intr_free_pv()
102 per_cpu(xen_irq_work, cpu).irq = -1; in xen_smp_intr_free_pv()
105 kfree(per_cpu(xen_pmu_irq, cpu).name); in xen_smp_intr_free_pv()
106 per_cpu(xen_pmu_irq, cpu).name = NULL; in xen_smp_intr_free_pv()
107 if (per_cpu(xen_pmu_irq, cpu).irq >= 0) { in xen_smp_intr_free_pv()
108 unbind_from_irqhandler(per_cpu(xen_pmu_irq, cpu).irq, NULL); in xen_smp_intr_free_pv()
109 per_cpu(xen_pmu_irq, cpu).irq = -1; in xen_smp_intr_free_pv()
113 int xen_smp_intr_init_pv(unsigned int cpu) in xen_smp_intr_init_pv() argument
118 callfunc_name = kasprintf(GFP_KERNEL, "irqwork%d", cpu); in xen_smp_intr_init_pv()
119 per_cpu(xen_irq_work, cpu).name = callfunc_name; in xen_smp_intr_init_pv()
121 cpu, in xen_smp_intr_init_pv()
128 per_cpu(xen_irq_work, cpu).irq = rc; in xen_smp_intr_init_pv()
131 pmu_name = kasprintf(GFP_KERNEL, "pmu%d", cpu); in xen_smp_intr_init_pv()
132 per_cpu(xen_pmu_irq, cpu).name = pmu_name; in xen_smp_intr_init_pv()
133 rc = bind_virq_to_irqhandler(VIRQ_XENPMU, cpu, in xen_smp_intr_init_pv()
139 per_cpu(xen_pmu_irq, cpu).irq = rc; in xen_smp_intr_init_pv()
145 xen_smp_intr_free_pv(cpu); in xen_smp_intr_init_pv()
186 unsigned cpu; in xen_pv_smp_prepare_cpus() local
215 for (cpu = nr_cpu_ids - 1; !cpu_possible(cpu); cpu--) in xen_pv_smp_prepare_cpus()
217 set_cpu_possible(cpu, false); in xen_pv_smp_prepare_cpus()
220 for_each_possible_cpu(cpu) in xen_pv_smp_prepare_cpus()
221 set_cpu_present(cpu, true); in xen_pv_smp_prepare_cpus()
225 cpu_initialize_context(unsigned int cpu, struct task_struct *idle) in cpu_initialize_context() argument
231 if (cpumask_test_and_set_cpu(cpu, xen_cpu_initialized_map)) in cpu_initialize_context()
236 cpumask_clear_cpu(cpu, xen_cpu_initialized_map); in cpu_initialize_context()
240 gdt = get_cpu_gdt_rw(cpu); in cpu_initialize_context()
275 ctxt->gs_base_kernel = per_cpu_offset(cpu); in cpu_initialize_context()
280 per_cpu(xen_cr3, cpu) = __pa(swapper_pg_dir); in cpu_initialize_context()
283 if (HYPERVISOR_vcpu_op(VCPUOP_initialise, xen_vcpu_nr(cpu), ctxt)) in cpu_initialize_context()
290 static int xen_pv_kick_ap(unsigned int cpu, struct task_struct *idle) in xen_pv_kick_ap() argument
294 rc = common_cpu_up(cpu, idle); in xen_pv_kick_ap()
298 xen_setup_runstate_info(cpu); in xen_pv_kick_ap()
301 per_cpu(xen_vcpu, cpu)->evtchn_upcall_mask = 1; in xen_pv_kick_ap()
303 rc = cpu_initialize_context(cpu, idle); in xen_pv_kick_ap()
307 xen_pmu_init(cpu); in xen_pv_kick_ap()
308 mc_percpu_init(cpu); in xen_pv_kick_ap()
314 BUG_ON(HYPERVISOR_vcpu_op(VCPUOP_up, xen_vcpu_nr(cpu), NULL)); in xen_pv_kick_ap()
327 unsigned int cpu = smp_processor_id(); in xen_pv_cpu_disable() local
328 if (cpu == 0) in xen_pv_cpu_disable()
337 static void xen_pv_cpu_die(unsigned int cpu) in xen_pv_cpu_die() argument
339 while (HYPERVISOR_vcpu_op(VCPUOP_is_up, xen_vcpu_nr(cpu), NULL)) { in xen_pv_cpu_die()
345 static void xen_pv_cleanup_dead_cpu(unsigned int cpu) in xen_pv_cleanup_dead_cpu() argument
347 xen_smp_intr_free(cpu); in xen_pv_cleanup_dead_cpu()
348 xen_uninit_lock_cpu(cpu); in xen_pv_cleanup_dead_cpu()
349 xen_teardown_timer(cpu); in xen_pv_cleanup_dead_cpu()
350 xen_pmu_finish(cpu); in xen_pv_cleanup_dead_cpu()
367 static void xen_pv_cpu_die(unsigned int cpu) in xen_pv_cpu_die() argument
372 static void xen_pv_cleanup_dead_cpu(unsigned int cpu) in xen_pv_cleanup_dead_cpu() argument
385 int cpu = smp_processor_id(); in stop_self() local
391 set_cpu_online(cpu, false); in stop_self()
393 HYPERVISOR_vcpu_op(VCPUOP_down, xen_vcpu_nr(cpu), NULL); in stop_self()