Skip to content

Commit af28dfa

Browse files
Igor Mammedovbonzini
authored andcommitted
kvm: lapic: fix broken vcpu hotplug
Guest fails to online hotplugged CPU with error smpboot: do_boot_cpu failed(-1) to wakeup CPU#4 It's caused by the fact that kvm_apic_set_state(), which used to call recalculate_apic_map() unconditionally and pulled hotplugged CPU into apic map, is updating map conditionally on state changes. In this case the APIC map is not considered dirty and the is not updated. Fix the issue by forcing unconditional update from kvm_apic_set_state(), like it used to be. Fixes: 4abaffc ("KVM: LAPIC: Recalculate apic map in batch") Cc: [email protected] Signed-off-by: Igor Mammedov <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 4909776 commit af28dfa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/kvm/lapic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,6 +2567,7 @@ int kvm_apic_set_state(struct kvm_vcpu *vcpu, struct kvm_lapic_state *s)
25672567
}
25682568
memcpy(vcpu->arch.apic->regs, s->regs, sizeof(*s));
25692569

2570+
apic->vcpu->kvm->arch.apic_map_dirty = true;
25702571
kvm_recalculate_apic_map(vcpu->kvm);
25712572
kvm_apic_set_version(vcpu);
25722573

0 commit comments

Comments
 (0)