KVM: Move MMU notifier's mmu_lock acquisition into common helper
authorSean Christopherson <seanjc@google.com>
Fri, 2 Apr 2021 00:56:55 +0000 (17:56 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 17 Apr 2021 12:31:08 +0000 (08:31 -0400)
commitf922bd9bf33bd5a8c6694927f010f32127810fbf
treed6332bb7dfb2d138a1cacad14019a3a891e6770c
parentb4c5936c47f86295cc76672e8dbeeca8b2379ba6
KVM: Move MMU notifier's mmu_lock acquisition into common helper

Acquire and release mmu_lock in the __kvm_handle_hva_range() helper
instead of requiring the caller to do the same.  This paves the way for
future patches to take mmu_lock if and only if an overlapping memslot is
found, without also having to introduce the on_lock() shenanigans used
to manipulate the notifier count and sequence.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210402005658.3024832-8-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c