From nobody Mon Feb 9 00:20:51 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C56E92741B5 for ; Mon, 19 Jan 2026 19:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768852252; cv=none; b=r0OudDOcxqMKPgOMxJ+sS4zW2WtJvlR4IjTRn7s4icriOeYYOnzmNtOYSxzLzqF6p4xCYY4fEVyW/FdiR4hkaoya8qTJZl8Ay+ozLzQ0BRphiFxinAV3TEbfdxCEVm6X7QuUXuJryVMD4Jwb6gAMUPobxv4KjCiMLdg+2YsgCCc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768852252; c=relaxed/simple; bh=YNJ7izt4sOz1UMackROPNeT2WK37KjKCDMC5eJjUxrA=; h=Subject:To:Cc:From:Date:References:In-Reply-To:Message-Id; b=AE+MauHXxwn610rEm1um9G2kPcpi15thZLYZuROG2zFVat7elrGjLZ4qm3MS34+M4O0S0AZ9PO3Sbcq8UV/jRYIBYEDdH6ERR2/nlG6gIGv9ab76uVdLByw7HFzZDkaWDCaJA0Qm3w5YaZom3Z17CJhZOYkXytnCeBJ6eVzfmFk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=O+KuAdKZ; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="O+KuAdKZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768852251; x=1800388251; h=subject:to:cc:from:date:references:in-reply-to: message-id; bh=YNJ7izt4sOz1UMackROPNeT2WK37KjKCDMC5eJjUxrA=; b=O+KuAdKZkl4VMPIcbCi52KdTc+278OrHU1fm2kBFdKEJH1DkUffIjK+k pUXkEqwM+ym94Sftlpyd5R2iRcij6/Uccsog4Yl0ieNdljngwgQrEP78b 0hUIlT12cD4pv37kXS1Uy/6yBdAkzbb5DfCM7PU6QRBv5sWgZllaLBogX WdOZBztf9SOJ4MQB9lMGwSLVD8LkBakut5wXazuKaZ4pQdZxHMosVZg/t 2srvra72+rcpWuTqeYisGtraEoOzy/7tYRxHF/qsDWDc1yDc/19yGtIOJ 5+eIk3EfPklnb6Mt5c+OgjLVqQWq3slRzVcxImJtfgrGIKq/0tnfxgV5R w==; X-CSE-ConnectionGUID: veXb+g7AR+u10xKyeIwE9Q== X-CSE-MsgGUID: Z6tVohefQXey0yqoJzFy7A== X-IronPort-AV: E=McAfee;i="6800,10657,11676"; a="57623056" X-IronPort-AV: E=Sophos;i="6.21,238,1763452800"; d="scan'208";a="57623056" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2026 11:50:50 -0800 X-CSE-ConnectionGUID: Zr4DzgpZQBeDP0zeehw3fw== X-CSE-MsgGUID: lE+bvA+dTHi3yK2fKbR2JQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,238,1763452800"; d="scan'208";a="210786557" Received: from davehans-spike.ostc.intel.com (HELO localhost.localdomain) ([10.165.164.11]) by fmviesa004.fm.intel.com with ESMTP; 19 Jan 2026 11:50:50 -0800 Subject: [PATCH 1/6] x86/cpu: Break Vendor/Family/Model macros into separate header To: linux-kernel@vger.kernel.org Cc: sohil.mehta@intel.com, Dave Hansen , Borislav Petkov , "H. Peter Anvin" , Ingo Molnar , Jon Kohler , Pawan Gupta , "Peter Zijlstra (Intel)" , Thomas Gleixner , Tony Luck , x86@kernel.org From: Dave Hansen Date: Mon, 19 Jan 2026 11:50:49 -0800 References: <20260119195047.86E3C696@davehans-spike.ostc.intel.com> In-Reply-To: <20260119195047.86E3C696@davehans-spike.ostc.intel.com> Message-Id: <20260119195049.43DDFD4E@davehans-spike.ostc.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Dave Hansen The intel-family.h header uses Vendor/Family/Model macros but it does not #include the header where they are defined. If that header is included, the build blows up in #include hell. Luckily, these macros are completely independent and do not themselves have any dependencies on other code. Break the VFM_*() macros out into their own header. Signed-off-by: Dave Hansen Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Tony Luck Cc: Pawan Gupta Cc: "Peter Zijlstra (Intel)" Cc: x86@kernel.org Cc: Jon Kohler --- b/arch/x86/include/asm/cpu_device_id.h | 33 ---------------------------- b/arch/x86/include/asm/vfm.h | 38 ++++++++++++++++++++++++++++= +++++ 2 files changed, 39 insertions(+), 32 deletions(-) diff -puN arch/x86/include/asm/cpu_device_id.h~x86-vfm_h arch/x86/include/a= sm/cpu_device_id.h --- a/arch/x86/include/asm/cpu_device_id.h~x86-vfm_h 2026-01-19 11:38:07.71= 4851835 -0800 +++ b/arch/x86/include/asm/cpu_device_id.h 2026-01-19 11:38:07.717851949 -0= 800 @@ -2,38 +2,7 @@ #ifndef _ASM_X86_CPU_DEVICE_ID #define _ASM_X86_CPU_DEVICE_ID =20 -/* - * Can't use because it generates expressions that - * cannot be used in structure initializers. Bitfield construction - * here must match the union in struct cpuinfo_86: - * union { - * struct { - * __u8 x86_model; - * __u8 x86; - * __u8 x86_vendor; - * __u8 x86_reserved; - * }; - * __u32 x86_vfm; - * }; - */ -#define VFM_MODEL_BIT 0 -#define VFM_FAMILY_BIT 8 -#define VFM_VENDOR_BIT 16 -#define VFM_RSVD_BIT 24 - -#define VFM_MODEL_MASK GENMASK(VFM_FAMILY_BIT - 1, VFM_MODEL_BIT) -#define VFM_FAMILY_MASK GENMASK(VFM_VENDOR_BIT - 1, VFM_FAMILY_BIT) -#define VFM_VENDOR_MASK GENMASK(VFM_RSVD_BIT - 1, VFM_VENDOR_BIT) - -#define VFM_MODEL(vfm) (((vfm) & VFM_MODEL_MASK) >> VFM_MODEL_BIT) -#define VFM_FAMILY(vfm) (((vfm) & VFM_FAMILY_MASK) >> VFM_FAMILY_BIT) -#define VFM_VENDOR(vfm) (((vfm) & VFM_VENDOR_MASK) >> VFM_VENDOR_BIT) - -#define VFM_MAKE(_vendor, _family, _model) ( \ - ((_model) << VFM_MODEL_BIT) | \ - ((_family) << VFM_FAMILY_BIT) | \ - ((_vendor) << VFM_VENDOR_BIT) \ -) +#include =20 /* * Declare drivers belonging to specific x86 CPUs diff -puN /dev/null arch/x86/include/asm/vfm.h --- /dev/null 2025-12-13 18:24:00.793641044 -0800 +++ b/arch/x86/include/asm/vfm.h 2026-01-19 11:38:07.717851949 -0800 @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_X86_VFM +#define _ASM_X86_VFM + +/* + * Can't use because it generates expressions that + * cannot be used in structure initializers. Bitfield construction + * here must match the union in struct cpuinfo_86: + * union { + * struct { + * __u8 x86_model; + * __u8 x86; + * __u8 x86_vendor; + * __u8 x86_reserved; + * }; + * __u32 x86_vfm; + * }; + */ +#define VFM_MODEL_BIT 0 +#define VFM_FAMILY_BIT 8 +#define VFM_VENDOR_BIT 16 +#define VFM_RSVD_BIT 24 + +#define VFM_MODEL_MASK GENMASK(VFM_FAMILY_BIT - 1, VFM_MODEL_BIT) +#define VFM_FAMILY_MASK GENMASK(VFM_VENDOR_BIT - 1, VFM_FAMILY_BIT) +#define VFM_VENDOR_MASK GENMASK(VFM_RSVD_BIT - 1, VFM_VENDOR_BIT) + +#define VFM_MODEL(vfm) (((vfm) & VFM_MODEL_MASK) >> VFM_MODEL_BIT) +#define VFM_FAMILY(vfm) (((vfm) & VFM_FAMILY_MASK) >> VFM_FAMILY_BIT) +#define VFM_VENDOR(vfm) (((vfm) & VFM_VENDOR_MASK) >> VFM_VENDOR_BIT) + +#define VFM_MAKE(_vendor, _family, _model) ( \ + ((_model) << VFM_MODEL_BIT) | \ + ((_family) << VFM_FAMILY_BIT) | \ + ((_vendor) << VFM_VENDOR_BIT) \ +) + +#endif /* _ASM_X86_VFM */ _