History

objtool: Add straight-line-speculation validation

Teach objtool to validate the straight-line-speculation constraints: - speculation trap after indirect calls - speculation trap after RET Notable: when an instruction is annotated RETPOLINE_SAFE, indicating speculation isn't a problem, also don't care about sls for that instruction.

Peter Zijlstra committed 4 years ago

Commit 1cc1e4c1 parent b17c2ba5 files · +27 −6Browse files

Showing the changes to tools/objtool/include/objtool (2 of 5 files). Show all

Unified · Split

2 files
  1. tools/objtool/include/objtool/arch.h +1 −0
  2. tools/objtool/include/objtool/builtin.h +1 −1
tools/objtool/include/objtool/arch.h+1−0
@@ -26,6 +26,7 @@ enum insn_type { · 25 unmodified lines
26 INSN_CLAC,26 INSN_CLAC,
27 INSN_STD,27 INSN_STD,
28 INSN_CLD,28 INSN_CLD,
29 INSN_TRAP,
29 INSN_OTHER,30 INSN_OTHER,
30};31};
31 32
tools/objtool/include/objtool/builtin.h+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
9 9
10extern const struct option check_options[];10extern const struct option check_options[];
11extern bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats,11extern bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats,
12 validate_dup, vmlinux, mcount, noinstr, backup;12 validate_dup, vmlinux, mcount, noinstr, backup, sls;
13 13
14extern int cmd_parse_options(int argc, const char **argv, const char * const usage[]);14extern int cmd_parse_options(int argc, const char **argv, const char * const usage[]);
15 15