Lines Matching refs:cpu
12 static void enable_hotplug_cpu(int cpu) in enable_hotplug_cpu() argument
14 if (!cpu_present(cpu)) in enable_hotplug_cpu()
15 xen_arch_register_cpu(cpu); in enable_hotplug_cpu()
17 set_cpu_present(cpu, true); in enable_hotplug_cpu()
20 static void disable_hotplug_cpu(int cpu) in disable_hotplug_cpu() argument
22 if (!cpu_is_hotpluggable(cpu)) in disable_hotplug_cpu()
25 if (cpu_online(cpu)) in disable_hotplug_cpu()
26 device_offline(get_cpu_device(cpu)); in disable_hotplug_cpu()
27 if (!cpu_online(cpu) && cpu_present(cpu)) { in disable_hotplug_cpu()
28 xen_arch_unregister_cpu(cpu); in disable_hotplug_cpu()
29 set_cpu_present(cpu, false); in disable_hotplug_cpu()
34 static int vcpu_online(unsigned int cpu) in vcpu_online() argument
39 sprintf(dir, "cpu/%u", cpu); in vcpu_online()
52 pr_err("unknown state(%s) on CPU%d\n", state, cpu); in vcpu_online()
55 static void vcpu_hotplug(unsigned int cpu) in vcpu_hotplug() argument
57 if (cpu >= nr_cpu_ids || !cpu_possible(cpu)) in vcpu_hotplug()
60 switch (vcpu_online(cpu)) { in vcpu_hotplug()
62 enable_hotplug_cpu(cpu); in vcpu_hotplug()
65 disable_hotplug_cpu(cpu); in vcpu_hotplug()
75 unsigned int cpu; in handle_vcpu_hotplug_event() local
80 sscanf(cpustr, "cpu/%u", &cpu); in handle_vcpu_hotplug_event()
81 vcpu_hotplug(cpu); in handle_vcpu_hotplug_event()
88 int cpu; in setup_cpu_watcher() local
95 for_each_possible_cpu(cpu) { in setup_cpu_watcher()
96 if (vcpu_online(cpu) == 0) in setup_cpu_watcher()
97 disable_hotplug_cpu(cpu); in setup_cpu_watcher()