KVM: MMU: protect kvm_mmu_change_mmu_pages with mmu_lock
authorMarcelo Tosatti <mtosatti@redhat.com>
Thu, 6 Aug 2009 17:40:07 +0000 (14:40 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 9 Sep 2009 03:17:29 +0000 (20:17 -0700)
commit27dd1a6f4fe1625b22bbd9fc63950732519c9976
tree536e6e64b264d7d244be5d1f9058316ab419d69d
parent969034648a9fe07482ffffe3c53588a39e29b9db
KVM: MMU: protect kvm_mmu_change_mmu_pages with mmu_lock

(cherry picked from commit 7c8a83b75a38a807d37f5a4398eca2a42c8cf513)

kvm_handle_hva, called by MMU notifiers, manipulates mmu data only with
the protection of mmu_lock.

Update kvm_mmu_change_mmu_pages callers to take mmu_lock, thus protecting
against kvm_handle_hva.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/mmu.c
arch/x86/kvm/x86.c