KVM: Move last_used_slot logic out of search_memslots
authorDavid Matlack <dmatlack@google.com>
Wed, 4 Aug 2021 22:28:39 +0000 (22:28 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 6 Aug 2021 11:52:28 +0000 (07:52 -0400)
commit0f22af940dc8ec4f437189096a5f8677995323b0
tree2aed49d93f3e57ecf5d5e04bfb73f71e474eaf1b
parent87689270b10fa9e6fac7242233b355cb6792b845
KVM: Move last_used_slot logic out of search_memslots

Make search_memslots unconditionally search all memslots and move the
last_used_slot logic up one level to __gfn_to_memslot. This is in
preparation for introducing a per-vCPU last_used_slot.

As part of this change convert existing callers of search_memslots to
__gfn_to_memslot to avoid making any functional changes.

Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20210804222844.1419481-3-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/powerpc/kvm/book3s_64_vio.c
arch/powerpc/kvm/book3s_64_vio_hv.c
include/linux/kvm_host.h