Re: [PATCH v5 1/5] x86/cpufeatures: Add {required,disabled} feature configs
From: H. Peter Anvin
Date: Sat Feb 15 2025 - 09:27:51 EST
On February 15, 2025 6:20:17 AM PST, Borislav Petkov <bp@xxxxxxxxx> wrote:
>On Sat, Feb 15, 2025 at 02:12:35AM -0800, H. Peter Anvin wrote:
>> CX8 is the name of the CPUID flag, for better or worse.
>
>Right, so a separate patch:
>
>git grep X86_CMPXCHG64
>arch/x86/Kconfig:135: select ARCH_USE_CMPXCHG_LOCKREF if X86_CMPXCHG64
>arch/x86/Kconfig.cpu:369:config X86_CMPXCHG64
>arch/x86/Kconfig.cpu:383: default "5" if X86_32 && X86_CMPXCHG64
>arch/x86/include/asm/asm-prototypes.h:19:#ifndef CONFIG_X86_CMPXCHG64
>arch/x86/include/asm/atomic64_32.h:51:#ifdef CONFIG_X86_CMPXCHG64
>arch/x86/include/asm/cmpxchg_32.h:72:#ifdef CONFIG_X86_CMPXCHG64
>arch/x86/include/asm/required-features.h:26:#ifdef CONFIG_X86_CMPXCHG64
>arch/x86/lib/Makefile:59:ifneq ($(CONFIG_X86_CMPXCHG64),y)
>arch/x86/lib/cmpxchg8b_emu.S:10:#ifndef CONFIG_X86_CMPXCHG64
>lib/atomic64_test.c:257:#elif defined(CONFIG_X86_CMPXCHG64)
>tools/arch/x86/include/asm/required-features.h:26:#ifdef CONFIG_X86_CMPXCHG64
>
>should be easy.
>
>> It seems to me to be a bit silly to have dummy symbols that mean literally
>> the same thing, but ...
>
>Why if they're confined and encapsulated in a single file:
>arch/x86/Kconfig.cpufeatures ?
>
>Rest of the kernel doesn't need to know whether a feature is required or not,
>right?
>
The point was that that is the *only* use of this particular flag, I believe.