summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu/mmu.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-06-22 16:37:42 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-06-22 13:37:30 -0400
commit44d527170731c75587e95052f3eea72b8c651daf (patch)
treeb982f99840d0e5b36f01e730d8d7ad5c8227c067 /arch/x86/kvm/mmu/mmu.c
parentaf28dfacbe00d53df5dec2bf50640df33138b1fe (diff)
downloadlinux-44d527170731c75587e95052f3eea72b8c651daf.tar.bz2
KVM: LAPIC: ensure APIC map is up to date on concurrent update requests
The following race can cause lost map update events: cpu1 cpu2 apic_map_dirty = true ------------------------------------------------------------ kvm_recalculate_apic_map: pass check mutex_lock(&kvm->arch.apic_map_lock); if (!kvm->arch.apic_map_dirty) and in process of updating map ------------------------------------------------------------- other calls to apic_map_dirty = true might be too late for affected cpu ------------------------------------------------------------- apic_map_dirty = false ------------------------------------------------------------- kvm_recalculate_apic_map: bail out on if (!kvm->arch.apic_map_dirty) To fix it, record the beginning of an update of the APIC map in apic_map_dirty. If another APIC map change switches apic_map_dirty back to DIRTY during the update, kvm_recalculate_apic_map should not make it CLEAN, and the other caller will go through the slow path. Reported-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu/mmu.c')
0 files changed, 0 insertions, 0 deletions