File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 25
25
#include <asm/kvm_emulate.h>
26
26
#include <linux/stringify.h>
27
27
#include <asm/debugreg.h>
28
+ #include <asm/nospec-branch.h>
28
29
29
30
#include "x86.h"
30
31
#include "tss.h"
@@ -1021,8 +1022,8 @@ static __always_inline u8 test_cc(unsigned int condition, unsigned long flags)
1021
1022
void (* fop )(void ) = (void * )em_setcc + 4 * (condition & 0xf );
1022
1023
1023
1024
flags = (flags & EFLAGS_MASK ) | X86_EFLAGS_IF ;
1024
- asm("push %[flags]; popf; call *%[fastop]"
1025
- : "=a" (rc ) : [fastop ]"r" (fop ), [flags ]"r" (flags ));
1025
+ asm("push %[flags]; popf; " CALL_NOSPEC
1026
+ : "=a" (rc ) : [thunk_target ]"r" (fop ), [flags ]"r" (flags ));
1026
1027
return rc ;
1027
1028
}
1028
1029
@@ -5305,9 +5306,9 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *))
5305
5306
if (!(ctxt -> d & ByteOp ))
5306
5307
fop += __ffs (ctxt -> dst .bytes ) * FASTOP_SIZE ;
5307
5308
5308
- asm("push %[flags]; popf; call *%[fastop] ; pushf; pop %[flags]\n"
5309
+ asm("push %[flags]; popf; " CALL_NOSPEC " ; pushf; pop %[flags]\n"
5309
5310
: "+a" (ctxt -> dst .val ), "+d" (ctxt -> src .val ), [flags ]"+D" (flags ),
5310
- [fastop ]"+S" (fop ), ASM_CALL_CONSTRAINT
5311
+ [thunk_target ]"+S" (fop ), ASM_CALL_CONSTRAINT
5311
5312
: "c" (ctxt -> src2 .val ));
5312
5313
5313
5314
ctxt -> eflags = (ctxt -> eflags & ~EFLAGS_MASK ) | (flags & EFLAGS_MASK );
You can’t perform that action at this time.
0 commit comments