diff options
Diffstat (limited to 'arch/x86/xen/smp.c')
-rw-r--r-- | arch/x86/xen/smp.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index f4d010031465..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 | ||