KVM: x86/mmu: Avoid an extra memslot lookup in try_async_pf() for L2
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 16 Apr 2020 13:48:07 +0000 (09:48 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 21 Apr 2020 13:13:08 +0000 (09:13 -0400)
commitc36b71503a2268206ebeda6697094ffb4e7e94c2
tree21246416886044ae8a3cfd39b9af17b6600bbb15
parentc583eed6d72bfea853ca7aa645d9295dd2720c6a
KVM: x86/mmu: Avoid an extra memslot lookup in try_async_pf() for L2

Create a new function kvm_is_visible_memslot() and use it from
kvm_is_visible_gfn(); use the new function in try_async_pf() too,
to avoid an extra memslot lookup.

Opportunistically squish a multi-line comment into a single-line comment.

Note, the end result, KVM_PFN_NOSLOT, is unchanged.

Cc: Jim Mattson <jmattson@google.com>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Suggested-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c
include/linux/kvm_host.h
virt/kvm/kvm_main.c