Commit 0c0a6d89 authored by Peter Zijlstra's avatar Peter Zijlstra

objtool: Add --hacks=skylake

Make the call/func sections selectable via the --hacks option.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220915111146.120821440@infradead.org
parent 00abd384
...@@ -254,6 +254,7 @@ objtool := $(objtree)/tools/objtool/objtool ...@@ -254,6 +254,7 @@ objtool := $(objtree)/tools/objtool/objtool
objtool-args-$(CONFIG_HAVE_JUMP_LABEL_HACK) += --hacks=jump_label objtool-args-$(CONFIG_HAVE_JUMP_LABEL_HACK) += --hacks=jump_label
objtool-args-$(CONFIG_HAVE_NOINSTR_HACK) += --hacks=noinstr objtool-args-$(CONFIG_HAVE_NOINSTR_HACK) += --hacks=noinstr
objtool-args-$(CONFIG_CALL_DEPTH_TRACKING) += --hacks=skylake
objtool-args-$(CONFIG_X86_KERNEL_IBT) += --ibt objtool-args-$(CONFIG_X86_KERNEL_IBT) += --ibt
objtool-args-$(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL) += --mcount objtool-args-$(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL) += --mcount
objtool-args-$(CONFIG_UNWINDER_ORC) += --orc objtool-args-$(CONFIG_UNWINDER_ORC) += --orc
......
...@@ -57,12 +57,17 @@ static int parse_hacks(const struct option *opt, const char *str, int unset) ...@@ -57,12 +57,17 @@ static int parse_hacks(const struct option *opt, const char *str, int unset)
found = true; found = true;
} }
if (!str || strstr(str, "skylake")) {
opts.hack_skylake = true;
found = true;
}
return found ? 0 : -1; return found ? 0 : -1;
} }
const struct option check_options[] = { const struct option check_options[] = {
OPT_GROUP("Actions:"), OPT_GROUP("Actions:"),
OPT_CALLBACK_OPTARG('h', "hacks", NULL, NULL, "jump_label,noinstr", "patch toolchain bugs/limitations", parse_hacks), OPT_CALLBACK_OPTARG('h', "hacks", NULL, NULL, "jump_label,noinstr,skylake", "patch toolchain bugs/limitations", parse_hacks),
OPT_BOOLEAN('i', "ibt", &opts.ibt, "validate and annotate IBT"), OPT_BOOLEAN('i', "ibt", &opts.ibt, "validate and annotate IBT"),
OPT_BOOLEAN('m', "mcount", &opts.mcount, "annotate mcount/fentry calls for ftrace"), OPT_BOOLEAN('m', "mcount", &opts.mcount, "annotate mcount/fentry calls for ftrace"),
OPT_BOOLEAN('n', "noinstr", &opts.noinstr, "validate noinstr rules"), OPT_BOOLEAN('n', "noinstr", &opts.noinstr, "validate noinstr rules"),
......
...@@ -4352,11 +4352,13 @@ int check(struct objtool_file *file) ...@@ -4352,11 +4352,13 @@ int check(struct objtool_file *file)
goto out; goto out;
warnings += ret; warnings += ret;
if (opts.hack_skylake) {
ret = create_direct_call_sections(file); ret = create_direct_call_sections(file);
if (ret < 0) if (ret < 0)
goto out; goto out;
warnings += ret; warnings += ret;
} }
}
if (opts.mcount) { if (opts.mcount) {
ret = create_mcount_loc_sections(file); ret = create_mcount_loc_sections(file);
......
...@@ -14,6 +14,7 @@ struct opts { ...@@ -14,6 +14,7 @@ struct opts {
bool dump_orc; bool dump_orc;
bool hack_jump_label; bool hack_jump_label;
bool hack_noinstr; bool hack_noinstr;
bool hack_skylake;
bool ibt; bool ibt;
bool mcount; bool mcount;
bool noinstr; bool noinstr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment