Re: [PATCH 1/6] x86/cpu: Break Vendor/Family/Model macros into separate header
From: Sohil Mehta
Date: Wed Feb 11 2026 - 16:54:47 EST
On 2/11/2026 1:12 PM, Dave Hansen wrote:
>
> So PECI and x86 both want the same data, but they do very different
> things with it.
>
> So let's just duplicate the constants. Completely untested patch attached.
>
This looks okay in principle. I haven't tested it yet. But, there seems
to be an inconsistency here?
> static int peci_device_info_init(struct peci_device *device)
> {
> u8 revision;
> @@ -100,7 +80,7 @@ static int peci_device_info_init(struct
> if (ret)
> return ret;
>
> - device->info.x86_vfm = IFM(peci_x86_cpu_family(cpu_id), peci_x86_cpu_model(cpu_id));
> + device->info.device_id = cpu_id >> 4;
>
I imagine this shifting the stepping. Should this be cpu_id & 0xF?
Because the devices are stored with the stepping info:
> +#define PECI_INTEL_HASWELL_X 0x306C0
> +#define PECI_INTEL_BROADWELL_X 0x406F0
> +#define PECI_INTEL_BROADWELL_D 0x50660
> +#define PECI_INTEL_SKYLAKE_X 0x50650
> +
> +#define PECI_INTEL_ICELAKE_X 0x606A0
> +#define PECI_INTEL_ICELAKE_D 0x606C0
> +#define PECI_INTEL_SAPPHIRERAPIDS_X 0x806F0
> +#define PECI_INTEL_EMERALDRAPIDS_X 0xC06F0
>
Or maybe define the CPUs without the stepping bits?
> ret = peci_get_revision(device, &revision);
> if (ret)