This is a note to let you know that I've just added the patch titled kvm: lapic: fix broken vcpu hotplug to the 5.7-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kvm-lapic-fix-broken-vcpu-hotplug.patch and it can be found in the queue-5.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From af28dfacbe00d53df5dec2bf50640df33138b1fe Mon Sep 17 00:00:00 2001 From: Igor Mammedov <imammedo@xxxxxxxxxx> Date: Mon, 22 Jun 2020 12:08:30 -0400 Subject: kvm: lapic: fix broken vcpu hotplug From: Igor Mammedov <imammedo@xxxxxxxxxx> commit af28dfacbe00d53df5dec2bf50640df33138b1fe upstream. 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: 4abaffce4d25a ("KVM: LAPIC: Recalculate apic map in batch") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Igor Mammedov <imammedo@xxxxxxxxxx> Message-Id: <20200622160830.426022-1-imammedo@xxxxxxxxxx> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/x86/kvm/lapic.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -2512,6 +2512,7 @@ int kvm_apic_set_state(struct kvm_vcpu * } memcpy(vcpu->arch.apic->regs, s->regs, sizeof(*s)); + apic->vcpu->kvm->arch.apic_map_dirty = true; kvm_recalculate_apic_map(vcpu->kvm); kvm_apic_set_version(vcpu); Patches currently in stable-queue which might be from imammedo@xxxxxxxxxx are queue-5.7/kvm-lapic-fix-broken-vcpu-hotplug.patch