KVM: Disable irq while unregistering user notifier
authorIgnacio Alvarado <ikalvarado@google.com>
Fri, 4 Nov 2016 19:15:55 +0000 (12:15 -0700)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Feb 2017 08:04:07 +0000 (09:04 +0100)
commit01c2288236820005b4f5c7c57609e2e087c98a55
tree5b9e861786d7d92dda33e36650558c5817944a7d
parent014db7f6682a83765c01dc21dadce26a776b1108
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Ä\8dmáÅ\99 <rkrcmar@redhat.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/x86/kvm/x86.c