KVM: x86/mmu: Refactor the per-slot level calculation in mapping_level()
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 6 Dec 2019 23:57:19 +0000 (15:57 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Jan 2020 17:16:04 +0000 (18:16 +0100)
commitf0f37e229c0517fa0d8bda73a2aeee28260370a2
tree9c0431f7b6af26983b3ac4956031b03a2ad3497a
parentcb9b88c669396e3e5f957fe909ff901b51321013
KVM: x86/mmu: Refactor the per-slot level calculation in mapping_level()

Invert the loop which adjusts the allowed page level based on what's
compatible with the associated memslot to use a largest-to-smallest
page size walk.  This paves the way for passing around a "max level"
variable instead of having redundant checks and/or multiple booleans.

No functional change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c