diff options
Diffstat (limited to 'arch/x86/xen/smp.c')
-rw-r--r-- | arch/x86/xen/smp.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 25f232b18a82..72a4c7959045 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/xen/interface.h> | 28 | #include <asm/xen/interface.h> |
29 | #include <asm/xen/hypercall.h> | 29 | #include <asm/xen/hypercall.h> |
30 | 30 | ||
31 | #include <xen/xen.h> | ||
31 | #include <xen/page.h> | 32 | #include <xen/page.h> |
32 | #include <xen/events.h> | 33 | #include <xen/events.h> |
33 | 34 | ||
@@ -156,11 +157,35 @@ static void __init xen_fill_possible_map(void) | |||
156 | { | 157 | { |
157 | int i, rc; | 158 | int i, rc; |
158 | 159 | ||
160 | if (xen_initial_domain()) | ||
161 | return; | ||
162 | |||
163 | for (i = 0; i < nr_cpu_ids; i++) { | ||
164 | rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL); | ||
165 | if (rc >= 0) { | ||
166 | num_processors++; | ||
167 | set_cpu_possible(i, true); | ||
168 | } | ||
169 | } | ||
170 | } | ||
171 | |||
172 | static void __init xen_filter_cpu_maps(void) | ||
173 | { | ||
174 | int i, rc; | ||
175 | |||
176 | if (!xen_initial_domain()) | ||
177 | return; | ||
178 | |||
179 | num_processors = 0; | ||
180 | disabled_cpus = 0; | ||
159 | for (i = 0; i < nr_cpu_ids; i++) { | 181 | for (i = 0; i < nr_cpu_ids; i++) { |
160 | rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL); | 182 | rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL); |
161 | if (rc >= 0) { | 183 | if (rc >= 0) { |
162 | num_processors++; | 184 | num_processors++; |
163 | set_cpu_possible(i, true); | 185 | set_cpu_possible(i, true); |
186 | } else { | ||
187 | set_cpu_possible(i, false); | ||
188 | set_cpu_present(i, false); | ||
164 | } | 189 | } |
165 | } | 190 | } |
166 | } | 191 | } |
@@ -174,6 +199,7 @@ static void __init xen_smp_prepare_boot_cpu(void) | |||
174 | old memory can be recycled */ | 199 | old memory can be recycled */ |
175 | make_lowmem_page_readwrite(xen_initial_gdt); | 200 | make_lowmem_page_readwrite(xen_initial_gdt); |
176 | 201 | ||
202 | xen_filter_cpu_maps(); | ||
177 | xen_setup_vcpu_info_placement(); | 203 | xen_setup_vcpu_info_placement(); |
178 | } | 204 | } |
179 | 205 | ||
@@ -400,9 +426,9 @@ static void stop_self(void *v) | |||
400 | BUG(); | 426 | BUG(); |
401 | } | 427 | } |
402 | 428 | ||
403 | static void xen_smp_send_stop(void) | 429 | static void xen_stop_other_cpus(int wait) |
404 | { | 430 | { |
405 | smp_call_function(stop_self, NULL, 0); | 431 | smp_call_function(stop_self, NULL, wait); |
406 | } | 432 | } |
407 | 433 | ||
408 | static void xen_smp_send_reschedule(int cpu) | 434 | static void xen_smp_send_reschedule(int cpu) |
@@ -470,7 +496,7 @@ static const struct smp_ops xen_smp_ops __initdata = { | |||
470 | .cpu_disable = xen_cpu_disable, | 496 | .cpu_disable = xen_cpu_disable, |
471 | .play_dead = xen_play_dead, | 497 | .play_dead = xen_play_dead, |
472 | 498 | ||
473 | .smp_send_stop = xen_smp_send_stop, | 499 | .stop_other_cpus = xen_stop_other_cpus, |
474 | .smp_send_reschedule = xen_smp_send_reschedule, | 500 | .smp_send_reschedule = xen_smp_send_reschedule, |
475 | 501 | ||
476 | .send_call_func_ipi = xen_smp_send_call_function_ipi, | 502 | .send_call_func_ipi = xen_smp_send_call_function_ipi, |