KVM: VMX: Add error handling to VMREAD helper
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 19 Jul 2019 20:41:08 +0000 (13:41 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 25 Sep 2019 13:30:09 +0000 (15:30 +0200)
commit6e2020977e3e692a8bb31258c1f8251521f4fdb7
tree19b899e36297b4aa35daeb68417e7a49a3346cc3
parent52a9fcbc73a30375cad8d9e7b519e1ad97b0880a
KVM: VMX: Add error handling to VMREAD helper

Now that VMREAD flows require a taken branch, courtesy of commit

  3901336ed9887 ("x86/kvm: Don't call kvm_spurious_fault() from .fixup")

bite the bullet and add full error handling to VMREAD, i.e. replace the
JMP added by __ex()/____kvm_handle_fault_on_reboot() with a hinted Jcc.

To minimize the code footprint, add a helper function, vmread_error(),
to handle both faults and failures so that the inline flow has a single
CALL.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/ops.h
arch/x86/kvm/vmx/vmx.c