]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Capture TDP level when updating CPUID
authorSean Christopherson <sean.j.christopherson@intel.com>
Sat, 2 May 2020 04:32:34 +0000 (21:32 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 May 2020 16:15:14 +0000 (12:15 -0400)
commite92a53f4adde8f2a6cc74314935997c5be2a9cb6
treef42988a4d0bb147b65061563ecaceb5f70e38d4c
parent138e26a4c8f0d839f296fde3a8a12f49750f4c0e
KVM: x86/mmu: Capture TDP level when updating CPUID

Snapshot the TDP level now that it's invariant (SVM) or dependent only
on host capabilities and guest CPUID (VMX).  This avoids having to call
kvm_x86_ops.get_tdp_level() when initializing a TDP MMU and/or
calculating the page role, and thus avoids the associated retpoline.

Drop the WARN in vmx_get_tdp_level() as updating CPUID while L2 is
active is legal, if dodgy.

No functional change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200502043234.12481-11-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/nested.c
arch/x86/kvm/vmx/vmx.c