| Date | Sat, 26 Feb 2022 19:46:13 -0800 | From | Josh Poimboeuf <> | Subject | Re: [PATCH v2 36/39] objtool: Find unused ENDBR instructions |
| |
On Thu, Feb 24, 2022 at 03:52:14PM +0100, Peter Zijlstra wrote: > +#ifdef CONFIG_X86_KERNEL_IBT > + . = ALIGN(8); > + .ibt_endbr_sites : AT(ADDR(.ibt_endbr_sites) - LOAD_OFFSET) { > + __ibt_endbr_sites = .; > + *(.ibt_endbr_sites) > + __ibt_endbr_sites_end = .; > + } > +#endif
".ibt_endbr_superfluous" maybe? It's not *all* the endbr sites.
> + > /* > * struct alt_inst entries. From the header (alternative.h): > * "Alternative instructions for different CPU types or capabilities" > --- a/tools/objtool/builtin-check.c > +++ b/tools/objtool/builtin-check.c > @@ -21,7 +21,7 @@ > > bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, > lto, vmlinux, mcount, noinstr, backup, sls, dryrun, > - ibt, ibt_fix_direct; > + ibt, ibt_fix_direct, ibt_seal; > > static const char * const check_usage[] = { > "objtool check [<options>] file.o", > @@ -50,6 +50,7 @@ const struct option check_options[] = { > OPT_BOOLEAN(0, "dry-run", &dryrun, "don't write the modifications"), > OPT_BOOLEAN(0, "ibt", &ibt, "validate ENDBR placement"), > OPT_BOOLEAN(0, "ibt-fix-direct", &ibt_fix_direct, "fixup direct jmp/call to ENDBR"), > + OPT_BOOLEAN(0, "ibt-seal", &ibt_seal, "list superfluous ENDBR instructions"),
s/list/annotate/ ?
Not sure "ibt-seal" is the appropriate name since the "seal" is done at boot time.
Do we really need a separate option anyway? To get the full benefits of IBT you might as well enable it... And always enabling it helps flush out bugs quicker.
-- Josh
|