|
@@ -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;
|
|
|
}
|
|
|
|
|
@@ -5305,9 +5306,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);
|