Re: [PATCH 45/48] x86/Kconfig: Enable CONFIG_PREFIX_SYMBOLS for FineIBT

From: Josh Poimboeuf

Date: Tue Apr 28 2026 - 12:33:30 EST


On Tue, Apr 28, 2026 at 02:37:17AM +0100, David Laight wrote:
> > static const struct option check_options[] = {
> > OPT_GROUP("Actions:"),
> > - OPT_BOOLEAN(0, "cfi", &opts.cfi, "annotate kernel control flow integrity (kCFI) function preambles"),
> > OPT_STRING_OPTARG('d', "disas", &opts.disas, "function-pattern", "disassemble functions", "*"),
> > 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"),
> > @@ -84,7 +83,7 @@ static const struct option check_options[] = {
> > OPT_BOOLEAN('r', "retpoline", &opts.retpoline, "validate and annotate retpoline usage"),
> > OPT_BOOLEAN(0, "rethunk", &opts.rethunk, "validate and annotate rethunk usage"),
> > OPT_BOOLEAN(0, "unret", &opts.unret, "validate entry unret placement"),
> > - OPT_INTEGER(0, "prefix", &opts.prefix, "generate prefix symbols"),
> > + OPT_INTEGER(0, "prefix", &opts.prefix, "generate or grow prefix symbols for N-byte function padding"),
> > OPT_BOOLEAN('l', "sls", &opts.sls, "validate straight-line-speculation mitigations"),
> > OPT_BOOLEAN('s', "stackval", &opts.stackval, "validate frame pointer rules"),
> > OPT_BOOLEAN('t', "static-call", &opts.static_call, "annotate static calls"),
> > @@ -92,6 +91,7 @@ static const struct option check_options[] = {
> > OPT_CALLBACK_OPTARG(0, "dump", NULL, NULL, "orc", "dump metadata", parse_dump),
> >
> > OPT_GROUP("Options:"),
> > + OPT_BOOLEAN(0, "cfi", &opts.cfi, "annotate and grow kCFI preamble symbols (use with --prefix)"),
> > OPT_BOOLEAN(0, "backtrace", &opts.backtrace, "unwind on error"),
> > OPT_BOOLEAN(0, "backup", &opts.backup, "create backup (.orig) file on warning/error"),
> > OPT_BOOLEAN(0, "dry-run", &opts.dryrun, "don't write modifications"),
> > @@ -163,6 +163,11 @@ static bool opts_valid(void)
> > return false;
> > }
> >
> > + if (opts.cfi && !opts.prefix) {
> > + ERROR("--cfi requires --prefix");
> > + return false;
> > + }
> > +
>
> Wouldn't it be more friendly to have:
> opts.prefix |= opts.cfi;
> and change the help to (implies --prefix).

It would, if prefix didn't take an integer as an argument ;-)

--
Josh