diff mbox series

[v2,11/29] KVM: nVMX: Capture VM-Fail via CC_{SET,OUT} in nested early checks

Message ID 20190124175845.15926-12-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series KVM: VMX: Move vCPU-run to proper asm sub-routine | expand

Commit Message

Sean Christopherson Jan. 24, 2019, 5:58 p.m. UTC
Take advantage of __GCC_ASM_FLAG_OUTPUTS__ when possible and also let
the compiler choose the register in all cases.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kvm/vmx/nested.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jim Mattson Jan. 24, 2019, 11:57 p.m. UTC | #1
On Thu, Jan 24, 2019 at 9:59 AM Sean Christopherson
<sean.j.christopherson@intel.com> wrote:
>
> Take advantage of __GCC_ASM_FLAG_OUTPUTS__ when possible and also let
> the compiler choose the register in all cases.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
diff mbox series

Patch

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 495edb36b525..15a8ae7bb247 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -2767,12 +2767,12 @@  static int nested_vmx_check_vmentry_hw(struct kvm_vcpu *vcpu)
 		 * VMLAUNCH and VMRESUME clear RFLAGS.{CF,ZF} on VM-Exit, set
 		 * RFLAGS.CF on VM-Fail Invalid and set RFLAGS.ZF on VM-Fail
 		 * 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"
 
-		"setbe %%dl\n\t"
-	      : ASM_CALL_CONSTRAINT, "=dl"(vm_fail)
+		CC_SET(be)
+	      : ASM_CALL_CONSTRAINT, CC_OUT(be) (vm_fail)
 	      : "c"(vmx), "d"((unsigned long)HOST_RSP),
 		[launched]"i"(offsetof(struct vcpu_vmx, __launched)),
 		[host_rsp]"i"(offsetof(struct vcpu_vmx, host_rsp)),