]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - arch/x86/kvm/mmu/mmu.c
KVM: x86: Dynamically calculate TDP level from max level and MAXPHYADDR
authorSean Christopherson <sean.j.christopherson@intel.com>
Thu, 16 Jul 2020 03:41:20 +0000 (20:41 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 30 Jul 2020 22:17:16 +0000 (18:17 -0400)
commitd468d94b7bafa7a2dd9bc72e5f7868469be3f7c4
tree5bb406f69834e69eedde8e263eaa67757d76c611
parentf83a4a6932f002701db19f968938ada1289f5e3c
KVM: x86: Dynamically calculate TDP level from max level and MAXPHYADDR

Calculate the desired TDP level on the fly using the max TDP level and
MAXPHYADDR instead of doing the same when CPUID is updated.  This avoids
the hidden dependency on cpuid_maxphyaddr() in vmx_get_tdp_level() and
also standardizes the "use 5-level paging iff MAXPHYADDR > 48" behavior
across x86.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200716034122.5998-8-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c