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
2626 INSN_CLAC,
2727 INSN_STD,
2828 INSN_CLD,
29+ INSN_TRAP,
2930 INSN_OTHER,
3031 };
3132
tools/objtool/include/objtool/builtin.h+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99
1010 extern const struct option check_options[];
1111 extern 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;
1313
1414 extern int cmd_parse_options(int argc, const char **argv, const char * const usage[]);
1515