Re: [PATCH 1/6] x86/cpu: Break Vendor/Family/Model macros into separate header

From: Sohil Mehta

Date: Tue Feb 10 2026 - 18:03:34 EST


On 2/10/2026 2:17 PM, Dave Hansen wrote:

> The reality is that we have non-x86 code using an x86 header. That's
> crazy and it's very very unusual and we're probably going to keep
> accidentally breaking it.
>
> Our only hope is to just move all that gunk to generic code for _real_.

I agree all VFM stuff needs to be moved to resolve this cleanly.

However, I feel, the partial fix makes the situation worse in the short
term. The new header x86-vfm.h isn't directly used by any generic code.
It is only included from arch/x86 headers.

arch/x86/include/asm/cpu_device_id.h:
5: #include <asm-generic/x86-vfm.h>

arch/x86/include/asm/intel-family.h:
10: #include <asm-generic/x86-vfm.h>

With the new changes, the PECI driver still relies on some copied code
and includes an explicit x86 header (which then includes an x86-vfm
header from asm-generic). intel-family.h *still* implicitly relies on
asm/processor.h.

Instead, would it be better to avoid the first two patches in the series
(until we have a cleaner solution) and do this?

diff --git a/arch/x86/include/asm/microcode.h
b/arch/x86/include/asm/microcode.h
index 3e1987642ecc..92fa64904ee5 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -3,6 +3,7 @@
#define _ASM_X86_MICROCODE_H

#include <asm/cpu.h>
+#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
#include <asm/msr.h>

I verified that this compiles cleanly. Though it's your call in the end.
I wouldn't push for it further.