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)
commit78958563d8023db0c6d03a2fe2a64d79b47b4349
tree58cdf9f89052f914d16d0517d7a4f3d7e9361604
parentc034f2aa8622e1e436563eb34c0f78ba8aa32329
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