diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2020-03-03 00:57:06 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-03-16 17:58:42 +0100 |
commit | 91661989d17ccec17bca199e7cb1f463ba4e5b78 (patch) | |
tree | 29796048a49e02fd9bc772662fed62be1d0f23dd /arch/x86/kvm/cpuid.c | |
parent | KVM: Drop largepages_enabled and its accessor/mutator (diff) | |
download | linux-91661989d17ccec17bca199e7cb1f463ba4e5b78.tar.xz linux-91661989d17ccec17bca199e7cb1f463ba4e5b78.zip |
KVM: x86: Move VMX's host_efer to common x86 code
Move host_efer to common x86 code and use it for CPUID's is_efer_nx() to
avoid constantly re-reading the MSR.
No functional change intended.
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/cpuid.c')
-rw-r--r-- | arch/x86/kvm/cpuid.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 1934f5d6b731..5dd67b124a68 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -134,10 +134,7 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu) static int is_efer_nx(void) { - unsigned long long efer = 0; - - rdmsrl_safe(MSR_EFER, &efer); - return efer & EFER_NX; + return host_efer & EFER_NX; } static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu) |