Dave Hansen 85b08180df x86/cpu: Expose only stepping min/max interface
The x86_match_cpu() infrastructure can match CPU steppings. Since
there are only 16 possible steppings, the matching infrastructure goes
all out and stores the stepping match as a bitmap. That means it can
match any possible steppings in a single list entry. Fun.

But it exposes this bitmap to each of the X86_MATCH_*() helpers when
none of them really need a bitmap. It makes up for this by exporting a
helper (X86_STEPPINGS()) which converts a contiguous stepping range
into the bitmap which every single user leverages.

Instead of a bitmap, have the main helper for this sort of thing
(X86_MATCH_VFM_STEPS()) just take a stepping range. This ends up
actually being even more compact than before.

Leave the helper in place (renamed to __X86_STEPPINGS()) to make it
more clear what is going on instead of just having a random GENMASK()
in the middle of an already complicated macro.

One oddity that I hit was this macro:

       X86_MATCH_VFM_STEPS(vfm, X86_STEPPING_MIN, max_stepping, issues)

It *could* have been converted over to take a min/max stepping value
for each entry. But that would have been a bit too verbose and would
prevent the one oddball in the list (INTEL_COMETLAKE_L stepping 0)
from sticking out.

Instead, just have it take a *maximum* stepping and imply that the match
is from 0=>max_stepping. This is functional for all the cases now and
also retains the nice property of having INTEL_COMETLAKE_L stepping 0
stick out like a sore thumb.

skx_cpuids[] is goofy. It uses the stepping match but encodes all
possible steppings. Just use a normal, non-stepping match helper.

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20241213185129.65527B2A%40davehans-spike.ostc.intel.com
2024-12-17 16:14:49 -08:00
..
2024-11-26 18:05:44 -08:00
2024-11-23 10:44:31 -08:00
2024-11-25 17:12:54 -08:00
2024-12-05 10:06:47 -08:00
2024-11-25 10:31:39 -08:00
2024-12-05 15:02:20 -08:00
2024-11-09 09:14:12 -08:00
2024-11-30 15:47:29 -08:00
2024-11-20 12:51:32 -08:00
2024-11-29 11:43:29 -08:00
2024-12-04 10:28:30 -08:00
2024-11-15 00:32:29 +11:00
2024-11-28 09:40:53 -08:00
2024-11-29 11:43:29 -08:00
2024-11-29 11:43:29 -08:00
2024-11-30 14:45:29 -08:00
2024-11-21 08:28:08 -08:00
2024-11-25 18:50:55 -08:00
2024-11-12 15:48:08 +01:00
2024-12-05 10:03:43 -08:00