]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.0/kvm-vmx-save-rsi-to-an-unused-output-in-the-vcpu-run-asm-blob.patch
Linux 4.19.41
[thirdparty/kernel/stable-queue.git] / queue-5.0 / kvm-vmx-save-rsi-to-an-unused-output-in-the-vcpu-run-asm-blob.patch
1 From f3689e3f17f064fd4cd5f0cb01ae2395c94f39d9 Mon Sep 17 00:00:00 2001
2 From: Sean Christopherson <sean.j.christopherson@intel.com>
3 Date: Fri, 25 Jan 2019 07:40:52 -0800
4 Subject: KVM: VMX: Save RSI to an unused output in the vCPU-run asm blob
5
6 From: Sean Christopherson <sean.j.christopherson@intel.com>
7
8 commit f3689e3f17f064fd4cd5f0cb01ae2395c94f39d9 upstream.
9
10 RSI is clobbered by the vCPU-run asm blob, but it's not marked as such,
11 probably because GCC doesn't let you mark inputs as clobbered. "Save"
12 RSI to a dummy output so that GCC recognizes it as being clobbered.
13
14 Fixes: 773e8a0425c9 ("x86/kvm: use Enlightened VMCS when running on Hyper-V")
15 Reviewed-by: Jim Mattson <jmattson@google.com>
16 Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
17 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 arch/x86/kvm/vmx/vmx.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 --- a/arch/x86/kvm/vmx/vmx.c
25 +++ b/arch/x86/kvm/vmx/vmx.c
26 @@ -6465,7 +6465,7 @@ static void __vmx_vcpu_run(struct kvm_vc
27 "xor %%edi, %%edi \n\t"
28 "xor %%ebp, %%ebp \n\t"
29 "pop %%" _ASM_BP "; pop %%" _ASM_DX " \n\t"
30 - : ASM_CALL_CONSTRAINT
31 + : ASM_CALL_CONSTRAINT, "=S"((int){0})
32 : "c"(vmx), "d"((unsigned long)HOST_RSP), "S"(evmcs_rsp),
33 [launched]"i"(offsetof(struct vcpu_vmx, __launched)),
34 [fail]"i"(offsetof(struct vcpu_vmx, fail)),