Re: [PATCH v4] x86/bugs: Add a separate config for each mitigation

From: Borislav Petkov
Date: Sun Oct 15 2023 - 11:14:05 EST


On Thu, Oct 12, 2023 at 09:48:14AM -0700, Josh Poimboeuf wrote:
> It adds clarity by making the options more self-documenting.

Why would you want to highlight mitigation-specific Kconfig options? You
grep for the symbol and you find what it is.

Why do the mitigation options need to self-document at all?

> For users who care about such things it makes it easier to identify
> which options they need to enable or disable. And it makes it clearer
> what those options do without having to go read the docs.

Sorry, if I see CONFIG_MITIGATE_X and CONFIG_X, I still wanna go see
what X is. And we enable the defaults for users - they don't really
need to read the docs.

> For developers it helps code readability: "ah, this nasty code is for a
> side channel mitigation". Also it makes it easier to grep for.

It doesn't matter - Kconfig options are Kconfig options. We grep
regardless.

> Right, but we have a global option for that. I was wondering if anybody
> actually uses the individual options (though I agree with Linus they
> should exist to help with code readability).

Read Linus' mail - there is some merit to having separate options.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette