Re: [PATCH v12 2/4] x86/cpu: Check if feature string is non-zero
From: Sohil Mehta
Date: Fri Mar 27 2026 - 13:56:53 EST
On 3/27/2026 8:10 AM, Maciej Wieczor-Retman wrote:
> arch/x86/kernel/cpu/common.c | 30 +++++++++++++++++++++++++-----
> arch/x86/kernel/cpu/cpu.h | 4 ++++
> arch/x86/kernel/cpu/cpuid-deps.c | 19 +++----------------
> 3 files changed, 32 insertions(+), 21 deletions(-)
>
Reviewed-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>
A couple of minor points below:
> @@ -1637,6 +1638,7 @@ static inline bool parse_set_clear_cpuid(char *arg, bool set)
>
> while (arg) {
> bool found __maybe_unused = false;
> + char name_buf[X86_NAMELESS_FEAT_BUFLEN];
> unsigned int bit;
>
> opt = strsep(&arg, ",");
> @@ -1657,10 +1659,7 @@ static inline bool parse_set_clear_cpuid(char *arg, bool set)
> setup_clear_cpu_cap(bit);
> }
> /* empty-string, i.e., ""-defined feature flags */
Can you delete this comment as well. It doesn't make sense now.
> - if (!x86_cap_flags[bit])
> - pr_cont(" %d:%d\n", bit >> 5, bit & 31);
> - else
> - pr_cont(" %s\n", x86_cap_flags[bit]);
> + pr_cont(" %s\n", x86_feature_name(bit, name_buf));
All the other equivalent buffers are defined as feature_buf, but this
one is named as name_buf. Just curious, any specific reason?
>
> taint++;
> }