KVM: VMX: Save RSI to an unused output in the vCPU-run asm blob
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 25 Jan 2019 15:40:52 +0000 (07:40 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Feb 2019 12:12:15 +0000 (13:12 +0100)
RSI is clobbered by the vCPU-run asm blob, but it's not marked as such,
probably because GCC doesn't let you mark inputs as clobbered.  "Save"
RSI to a dummy output so that GCC recognizes it as being clobbered.

Fixes: 773e8a0425c9 ("x86/kvm: use Enlightened VMCS when running on Hyper-V")
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c

index cb0dd17c31c6bcd833914a9437c33981fce83dfe..3ae51a09f42079394d25c10258bab684c8101d21 100644 (file)
@@ -6481,7 +6481,7 @@ static void __vmx_vcpu_run(struct kvm_vcpu *vcpu, struct vcpu_vmx *vmx)
                "xor %%edi, %%edi \n\t"
                "xor %%ebp, %%ebp \n\t"
                "pop  %%" _ASM_BP "; pop  %%" _ASM_DX " \n\t"
-             : ASM_CALL_CONSTRAINT
+             : ASM_CALL_CONSTRAINT, "=S"((int){0})
              : "c"(vmx), "d"((unsigned long)HOST_RSP), "S"(evmcs_rsp),
                [launched]"i"(offsetof(struct vcpu_vmx, __launched)),
                [fail]"i"(offsetof(struct vcpu_vmx, fail)),