Skip to content

Commit 9d328a9

Browse files
Wei Liukonradwilk
authored andcommitted
xen/vcpu: Fix vcpu restore path.
The runstate of vcpu should be restored for all possible cpus, as well as the vcpu info placement. Acked-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
1 parent cc31fd9 commit 9d328a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

arch/x86/xen/enlighten.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,11 @@ void xen_vcpu_restore(void)
193193
{
194194
int cpu;
195195

196-
for_each_online_cpu(cpu) {
196+
for_each_possible_cpu(cpu) {
197197
bool other_cpu = (cpu != smp_processor_id());
198+
bool is_up = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL);
198199

199-
if (other_cpu &&
200+
if (other_cpu && is_up &&
200201
HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))
201202
BUG();
202203

@@ -205,7 +206,7 @@ void xen_vcpu_restore(void)
205206
if (have_vcpu_info_placement)
206207
xen_vcpu_setup(cpu);
207208

208-
if (other_cpu &&
209+
if (other_cpu && is_up &&
209210
HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
210211
BUG();
211212
}

0 commit comments

Comments
 (0)