Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

objtool: Add --hacks=skylake

Make the call/func sections selectable via the --hacks option.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220915111146.120821440@infradead.org

+14 -5
+1
scripts/Makefile.lib
··· 254 254 255 255 objtool-args-$(CONFIG_HAVE_JUMP_LABEL_HACK) += --hacks=jump_label 256 256 objtool-args-$(CONFIG_HAVE_NOINSTR_HACK) += --hacks=noinstr 257 + objtool-args-$(CONFIG_CALL_DEPTH_TRACKING) += --hacks=skylake 257 258 objtool-args-$(CONFIG_X86_KERNEL_IBT) += --ibt 258 259 objtool-args-$(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL) += --mcount 259 260 objtool-args-$(CONFIG_UNWINDER_ORC) += --orc
+6 -1
tools/objtool/builtin-check.c
··· 57 57 found = true; 58 58 } 59 59 60 + if (!str || strstr(str, "skylake")) { 61 + opts.hack_skylake = true; 62 + found = true; 63 + } 64 + 60 65 return found ? 0 : -1; 61 66 } 62 67 63 68 const struct option check_options[] = { 64 69 OPT_GROUP("Actions:"), 65 - OPT_CALLBACK_OPTARG('h', "hacks", NULL, NULL, "jump_label,noinstr", "patch toolchain bugs/limitations", parse_hacks), 70 + OPT_CALLBACK_OPTARG('h', "hacks", NULL, NULL, "jump_label,noinstr,skylake", "patch toolchain bugs/limitations", parse_hacks), 66 71 OPT_BOOLEAN('i', "ibt", &opts.ibt, "validate and annotate IBT"), 67 72 OPT_BOOLEAN('m', "mcount", &opts.mcount, "annotate mcount/fentry calls for ftrace"), 68 73 OPT_BOOLEAN('n', "noinstr", &opts.noinstr, "validate noinstr rules"),
+6 -4
tools/objtool/check.c
··· 4352 4352 goto out; 4353 4353 warnings += ret; 4354 4354 4355 - ret = create_direct_call_sections(file); 4356 - if (ret < 0) 4357 - goto out; 4358 - warnings += ret; 4355 + if (opts.hack_skylake) { 4356 + ret = create_direct_call_sections(file); 4357 + if (ret < 0) 4358 + goto out; 4359 + warnings += ret; 4360 + } 4359 4361 } 4360 4362 4361 4363 if (opts.mcount) {
+1
tools/objtool/include/objtool/builtin.h
··· 14 14 bool dump_orc; 15 15 bool hack_jump_label; 16 16 bool hack_noinstr; 17 + bool hack_skylake; 17 18 bool ibt; 18 19 bool mcount; 19 20 bool noinstr;