]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Remove unneeded kvm_vcpu variable, guest_xcr0_loaded
authorAaron Lewis <aaronlewis@google.com>
Mon, 21 Oct 2019 23:30:22 +0000 (16:30 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Oct 2019 13:44:26 +0000 (15:44 +0200)
commitdf8b0ce9277929520eadb19bd27ca48e6905083f
tree58cdf9f89052f914d16d0517d7a4f3d7e9361604
parent25f3c6f0a1184308795f2f5a12cdd5f75dbfca21
KVM: x86: Remove unneeded kvm_vcpu variable, guest_xcr0_loaded

The kvm_vcpu variable, guest_xcr0_loaded, is a waste of an 'int'
and a conditional branch.  VMX and SVM are the only users, and both
unconditionally pair kvm_load_guest_xcr0() with kvm_put_guest_xcr0()
making this check unnecessary. Without this variable, the predicates in
kvm_load_guest_xcr0 and kvm_put_guest_xcr0 should match.

Suggested-by: Sean Christopherson <sean.j.christopherson@intel.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Aaron Lewis <aaronlewis@google.com>
Change-Id: I7b1eb9b62969d7bbb2850f27e42f863421641b23
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c
include/linux/kvm_host.h