Merge tag 'v4.15' into x86/pti, to be able to merge dependent changes
[linux-2.6-microblaze.git] / arch / x86 / kvm / emulate.c
index b514b2b..290ecf7 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/kvm_emulate.h>
 #include <linux/stringify.h>
 #include <asm/debugreg.h>
+#include <asm/nospec-branch.h>
 
 #include "x86.h"
 #include "tss.h"
@@ -1021,8 +1022,8 @@ static __always_inline u8 test_cc(unsigned int condition, unsigned long flags)
        void (*fop)(void) = (void *)em_setcc + 4 * (condition & 0xf);
 
        flags = (flags & EFLAGS_MASK) | X86_EFLAGS_IF;
-       asm("push %[flags]; popf; call *%[fastop]"
-           : "=a"(rc) : [fastop]"r"(fop), [flags]"r"(flags));
+       asm("push %[flags]; popf; " CALL_NOSPEC
+           : "=a"(rc) : [thunk_target]"r"(fop), [flags]"r"(flags));
        return rc;
 }
 
@@ -5335,9 +5336,9 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *))
        if (!(ctxt->d & ByteOp))
                fop += __ffs(ctxt->dst.bytes) * FASTOP_SIZE;
 
-       asm("push %[flags]; popf; call *%[fastop]; pushf; pop %[flags]\n"
+       asm("push %[flags]; popf; " CALL_NOSPEC " ; pushf; pop %[flags]\n"
            : "+a"(ctxt->dst.val), "+d"(ctxt->src.val), [flags]"+D"(flags),
-             [fastop]"+S"(fop), ASM_CALL_CONSTRAINT
+             [thunk_target]"+S"(fop), ASM_CALL_CONSTRAINT
            : "c"(ctxt->src2.val));
 
        ctxt->eflags = (ctxt->eflags & ~EFLAGS_MASK) | (flags & EFLAGS_MASK);