Re: [PATCH v10 2/3] x86/cpu: Check if feature string is non-zero

From: Sohil Mehta

Date: Tue Mar 17 2026 - 16:30:19 EST


On 3/17/2026 1:00 PM, Maciej Wieczor-Retman wrote:
> From: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
>
> In filter_cpuid_features(), x86_cap_flags[] is read, but it's not verified
> whether the string is non-zero which could lead to unwanted output.
>
> In two more places there are open coded paths that try to retrieve a
> feature string, and if there isn't one, the feature word and bit are
> returned instead.
>
> Add a common helper to fix filter_cpuid_features() as well as clean up
> the open coded cases.
>
> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
> ---

Reviewed-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>