]> git.baikalelectronics.ru Git - kernel.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)
commite7e6ee03bc9071b955e549de0bca853d2e1965c9
tree2bba940c5e657d5d7bc9e76cc4a15752abe23b9b
parentd916b9ac91c306f300b49b7c9f5dc9a7f2023eef
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