lkml.org 
[lkml]   [2022]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-02-27 04:47    [W:0.696 / U:1.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site