Re: [PATCH] x86/cpufeatures: Free up unused feature bits

From: Sohil Mehta
Date: Thu Nov 07 2024 - 21:18:19 EST


On 11/7/2024 5:12 PM, Dave Hansen wrote:
> Sohil, go look at:
>
> # cat /sys/devices/system/cpu/modalias
> cpu:type:x86,ven0000fam0006mod008C:feature:,0000,0001,0002,0003,0004,0005,0006,...
>

Thanks for the explanation. Peter's comment makes sense to me now.

>
> I sure hope we haven't been using too many of these synthetic features
> in MODULE_DEVICE_TABLE()s, because we tend to move them around, but I
> guess it's possible.

I found at least one recent usage that matches this pattern.
Look at commit cbcddaa33d7e ("perf/x86/rapl: Use CPUID bit on AMD and
Hygon parts"). It defines a synthetic feature bit X86_FEATURE_RAPL and
adds it to the rapl_model_match[] table.

MODULE_DEVICE_TABLE(x86cpu, rapl_model_match);

It almost seems like some of these bits are now ABI. We probably need to
mark them and keep these mappings pinned to avoid future issues.
Recycling these bits seems to be very common.