KVM: x86/mmu: Split out max mapping level calculation to helper
authorSean Christopherson <seanjc@google.com>
Sat, 13 Feb 2021 00:50:04 +0000 (16:50 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Feb 2021 08:08:11 +0000 (03:08 -0500)
commit1b6d9d9ed5717157933db77d96bb12884c17ce52
tree823839c2cad23e0ed51db9ad41fdd3eb4e335f4c
parentc060c72ffeb448fbb5864faa1f672ebfe14dd25f
KVM: x86/mmu: Split out max mapping level calculation to helper

Factor out the logic for determining the maximum mapping level given a
memslot and a gpa.  The helper will be used when zapping collapsible
SPTEs when disabling dirty logging, e.g. to avoid zapping SPTEs that
can't possibly be rebuilt as hugepages.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210213005015.1651772-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/mmu_internal.h