KVM: Disable irq while unregistering user notifier
authorIgnacio Alvarado <ikalvarado@google.com>
Fri, 4 Nov 2016 19:15:55 +0000 (12:15 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:51:01 +0000 (03:51 +0000)
commitb2decb623a42f21e5fe878fe3f9e612e06b62106
tree37f60cbf7ba5f0733764c26980f696ff8438c2fb
parentec50d221bbe0f21832ebd2073ff2889484e0d9f8
KVM: Disable irq while unregistering user notifier

commit 1650b4ebc99da4c137bfbfc531be4a2405f951dd upstream.

Function user_notifier_unregister should be called only once for each
registered user notifier.

Function kvm_arch_hardware_disable can be executed from an IPI context
which could cause a race condition with a VCPU returning to user mode
and attempting to unregister the notifier.

Signed-off-by: Ignacio Alvarado <ikalvarado@google.com>
Fixes: 18863bdd60f8 ("KVM: x86 shared msr infrastructure")
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/x86/kvm/x86.c