KVM: X86: Introduce kvm_mmu_slot_lpages() helpers
authorPeter Xu <peterx@redhat.com>
Fri, 30 Jul 2021 22:04:51 +0000 (18:04 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 20 Aug 2021 20:04:51 +0000 (16:04 -0400)
commit4139b1972af281e0293c2414a0f1cd59fa5b2980
tree202e3f61cc9d7c556c794ae2efbf7c1d518787ff
parent3165af738ed3224a84ead7d97c6909de2e453b4c
KVM: X86: Introduce kvm_mmu_slot_lpages() helpers

Introduce kvm_mmu_slot_lpages() to calculcate lpage_info and rmap array size.
The other __kvm_mmu_slot_lpages() can take an extra parameter of npages rather
than fetching from the memslot pointer.  Start to use the latter one in
kvm_alloc_memslot_metadata().

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210730220455.26054-4-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.h
arch/x86/kvm/mmu/page_track.c
arch/x86/kvm/x86.c