Commit-ID:  c940a3fb1e2e9b7d03228ab28f375fb5a47ff699
Gitweb:     https://git.kernel.org/tip/c940a3fb1e2e9b7d03228ab28f375fb5a47ff699
Author:     Peter Zijlstra <pet...@infradead.org>
AuthorDate: Thu, 25 Jan 2018 10:58:14 +0100
Committer:  Thomas Gleixner <t...@linutronix.de>
CommitDate: Thu, 25 Jan 2018 14:14:42 +0100

KVM: VMX: Make indirect call speculation safe

Replace indirect call with CALL_NOSPEC.

Signed-off-by: Peter Zijlstra (Intel) <pet...@infradead.org>
Signed-off-by: Thomas Gleixner <t...@linutronix.de>
Reviewed-by: David Woodhouse <d...@amazon.co.uk>
Cc: Andrea Arcangeli <aarca...@redhat.com>
Cc: Andi Kleen <a...@linux.intel.com>
Cc: Ashok Raj <ashok....@intel.com>
Cc: Greg KH <gre...@linuxfoundation.org>
Cc: Jun Nakajima <jun.nakaj...@intel.com>
Cc: David Woodhouse <dw...@infradead.org>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: r...@amazon.de
Cc: Dave Hansen <dave.han...@intel.com>
Cc: Asit Mallick <asit.k.mall...@intel.com>
Cc: Andy Lutomirski <l...@kernel.org>
Cc: Josh Poimboeuf <jpoim...@redhat.com>
Cc: Jason Baron <jba...@akamai.com>
Cc: Paolo Bonzini <pbonz...@redhat.com>
Cc: Dan Williams <dan.j.willi...@intel.com>
Cc: Arjan Van De Ven <arjan.van.de....@intel.com>
Cc: Tim Chen <tim.c.c...@linux.intel.com>
Link: https://lkml.kernel.org/r/20180125095843.645776...@infradead.org
---
 arch/x86/kvm/vmx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index d1e25db..924589c 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -9064,14 +9064,14 @@ static void vmx_handle_external_intr(struct kvm_vcpu 
*vcpu)
 #endif
                        "pushf\n\t"
                        __ASM_SIZE(push) " $%c[cs]\n\t"
-                       "call *%[entry]\n\t"
+                       CALL_NOSPEC
                        :
 #ifdef CONFIG_X86_64
                        [sp]"=&r"(tmp),
 #endif
                        ASM_CALL_CONSTRAINT
                        :
-                       [entry]"r"(entry),
+                       THUNK_TARGET(entry),
                        [ss]"i"(__KERNEL_DS),
                        [cs]"i"(__KERNEL_CS)
                        );

Reply via email to