]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: VMX: Don't save guest registers after VM-Fail
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 25 Jan 2019 15:41:07 +0000 (07:41 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Feb 2019 12:12:26 +0000 (13:12 +0100)
commitf78d0971b7bd5bf4373a1fac27f176af5d5594ed
tree2bba940c5e657d5d7bc9e76cc4a15752abe23b9b
parent217aaff53c25f03b1d2fc23eff9dc2bae34f690e
KVM: VMX: Don't save guest registers after VM-Fail

A failed VM-Enter (obviously) didn't succeed, meaning the CPU never
executed an instrunction in guest mode and so can't have changed the
general purpose registers.

In addition to saving some instructions in the VM-Fail case, this also
provides a separate path entirely and thus an opportunity to propagate
the fail condition to vmx->fail via register without introducing undue
pain.  Using a register, as opposed to directly referencing vmx->fail,
eliminates the need to pass the offset of 'fail', which will simplify
moving the code to proper assembly in future patches.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c