Skip to content
  • Igor Mammedov's avatar
    kvm: lapic: fix broken vcpu hotplug · a8f00b79
    Igor Mammedov authored
    commit af28dfac 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: 4abaffce
    
     ("KVM: LAPIC: Recalculate apic map in batch")
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
    Message-Id: <20200622160830.426022-1-imammedo@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    a8f00b79