Re: [PATCH v2 1/3] x86/cpufeatures: Add {required,disabled} feature configs

From: Borislav Petkov
Date: Fri Jun 21 2024 - 13:33:20 EST


On Sun, Jun 16, 2024 at 01:57:41AM -0700, Xin Li (Intel) wrote:
> diff --git a/arch/x86/Kconfig.cpufeatures b/arch/x86/Kconfig.cpufeatures
> new file mode 100644
> index 000000000000..5ed24e45df87
> --- /dev/null
> +++ b/arch/x86/Kconfig.cpufeatures
> @@ -0,0 +1,197 @@
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# x86 feature bits (see arch/x86/include/asm/cpufeatures.h) that are
> +# either REQUIRED to be enabled, or DISABLED (always ignored) for this
> +# particular compile-time configuration. The tests for these features
> +# are turned into compile-time constants via the generated
> +# <asm/featuremasks.h>.
> +#
> +# The naming of these variables *must* match asm/cpufeatures.h, e.g.,
> +# X86_FEATURE_ALWAYS <==> X86_REQUIRED_FEATURE_ALWAYS
> +# X86_FEATURE_FRED <==> X86_DISABLED_FEATURE_FRED
> +#
> +# And these REQUIRED and DISABLED config options are manipulated in an
> +# AWK script as the following example:
> +#
> +# +----------------------+
> +# | X86_FRED = y ? |
> +# +----------------------+
> +# / \
> +# Y / \ N
> +# +-------------------------------------+ +-------------------------------+
> +# | X86_DISABLED_FEATURE_FRED undefined | | X86_DISABLED_FEATURE_FRED = y |
> +# +-------------------------------------+ +-------------------------------+
> +# |
> +# |
> +# +-------------------------------------------+ |
> +# | X86_FEATURE_FRED: feature word 12, bit 17 | ---->|
> +# +-------------------------------------------+ |
> +# |
> +# |
> +# +-------------------------------+
> +# | set bit 17 of DISABLED_MASK12 |
> +# +-------------------------------+
> +#

Look ma, a picture. :-)

But yeah, this is better.

Thx.

--
Regards/Gruss,
Boris.

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