Commit bbc0b823 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: nVMX: Capture VM-Fail via CC_{SET,OUT} in nested early checks

...to take advantage of __GCC_ASM_FLAG_OUTPUTS__ when possible.
Reviewed-by: default avatarJim Mattson <jmattson@google.com>
Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent f1727b49
...@@ -2768,12 +2768,12 @@ static int nested_vmx_check_vmentry_hw(struct kvm_vcpu *vcpu) ...@@ -2768,12 +2768,12 @@ static int nested_vmx_check_vmentry_hw(struct kvm_vcpu *vcpu)
* VMLAUNCH and VMRESUME clear RFLAGS.{CF,ZF} on VM-Exit, set * VMLAUNCH and VMRESUME clear RFLAGS.{CF,ZF} on VM-Exit, set
* RFLAGS.CF on VM-Fail Invalid and set RFLAGS.ZF on VM-Fail * RFLAGS.CF on VM-Fail Invalid and set RFLAGS.ZF on VM-Fail
* Valid. vmx_vmenter() directly "returns" RFLAGS, and so the * Valid. vmx_vmenter() directly "returns" RFLAGS, and so the
* results of VM-Enter is captured via SETBE to vm_fail. * results of VM-Enter is captured via CC_{SET,OUT} to vm_fail.
*/ */
"call vmx_vmenter\n\t" "call vmx_vmenter\n\t"
"setbe %[fail]\n\t" CC_SET(be)
: ASM_CALL_CONSTRAINT, [fail]"=qm"(vm_fail) : ASM_CALL_CONSTRAINT, CC_OUT(be) (vm_fail)
: "c"(vmx), "d"((unsigned long)HOST_RSP), : "c"(vmx), "d"((unsigned long)HOST_RSP),
[launched]"i"(offsetof(struct vcpu_vmx, __launched)), [launched]"i"(offsetof(struct vcpu_vmx, __launched)),
[host_rsp]"i"(offsetof(struct vcpu_vmx, host_rsp)), [host_rsp]"i"(offsetof(struct vcpu_vmx, host_rsp)),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment