From nobody Mon Feb 9 13:35:44 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 721063101C6 for ; Fri, 6 Feb 2026 23:14:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770419681; cv=none; b=TJrwg64ZFtr1bzPAZKQLxoqAJ07kejWCFfg8w7OGSC+00mM9gd68e025nWG5HlUjfRmZVQdyZYL8hN2Il8ERaE16wOqIjN7upfl22hVl0p9C8BC4DyrY26inq5YOS1RImN7+6Y9q3e472mDUIJWCffMF2Rg4nPUOMoY+GLX108Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770419681; c=relaxed/simple; bh=IS8TW44iEpHpuM+JgIMeJqcPNWQEOXSmBw95MaDb2H0=; h=Subject:To:Cc:From:Date:References:In-Reply-To:Message-Id; b=q0bVqsKMPzSxxfMWO0F9DgBJE7n/VTJQLqOxKuhS/3VjyxUNVlX0DnscmslNH2dkxyzmDZQ7HPu1v4SuJkQFz/BR8d9T4PX2POgTCTA8iRnfz5nvRjud1UPVl5Z7bEeBilDLhmaW0BPYNF6TO8fRvPBBBh2sNHgE4zpfypUjXlk= 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=BCyMFMXX; arc=none smtp.client-ip=192.198.163.13 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="BCyMFMXX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1770419681; x=1801955681; h=subject:to:cc:from:date:references:in-reply-to: message-id; bh=IS8TW44iEpHpuM+JgIMeJqcPNWQEOXSmBw95MaDb2H0=; b=BCyMFMXXo9arpYzeNPm0ADhAvBfXo3yX+E4y4U5OoIB9dmGlIT3VwpJ9 kg/P/92V26pCnNMVhII2rZ2AaPNonPiq1WLf7OZZi9zigVqdZFDqXeKdP JROvTs1u0Y3ZcZchDYjglB1Nje/YvKkggwtDkSsU5NEya9On5uWTBDZdE tELg7M73CfWUUQAM9HLdVSOz8NHjCRwt9MdmqsGGtjlWsOJ93LpKaKgum iDsIcRbQyg9PmQ0CKwcvUl+2t2JOa+1hNBJhzNLPsVq6QLiVwYkKArIT+ IN9jDnbpGJKyCF1zWGe7XSWW21nG3kBIZym4X854k98pcFBfQarjwQDX+ g==; X-CSE-ConnectionGUID: 6e4r6wlKSBChdwpi4DaNWQ== X-CSE-MsgGUID: /Lf5rRgOSeuC/nF4V/RPrg== X-IronPort-AV: E=McAfee;i="6800,10657,11693"; a="74232684" X-IronPort-AV: E=Sophos;i="6.21,277,1763452800"; d="scan'208";a="74232684" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2026 15:14:41 -0800 X-CSE-ConnectionGUID: T+DC0UWKTYW8zM/kKuxqFA== X-CSE-MsgGUID: ZFrRe41DTnONa0Ilz036cA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,277,1763452800"; d="scan'208";a="210851511" Received: from davehans-spike.ostc.intel.com (HELO localhost.localdomain) ([10.165.164.11]) by fmviesa008.fm.intel.com with ESMTP; 06 Feb 2026 15:14:41 -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, zhao1.liu@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: Fri, 06 Feb 2026 15:14:40 -0800 References: <20260206231438.720FF4E3@davehans-spike.ostc.intel.com> In-Reply-To: <20260206231438.720FF4E3@davehans-spike.ostc.intel.com> Message-Id: <20260206231440.C35AD1C5@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. Note that the new header is in asm-generic. Believe it or not, the intel-family.h header is included from a driver in arch-generic code: #include "../../arch/x86/include/asm/intel-family.h" Putting the header in generic code will move in the right direction of reducing the amount of code that the "peci" driver needs to copy. 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/include/asm-generic/x86-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-02-06 15:14:21.84= 8731168 -0800 +++ b/arch/x86/include/asm/cpu_device_id.h 2026-02-06 15:14:21.851731274 -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 include/asm-generic/x86-vfm.h --- /dev/null 2026-01-31 18:22:27.334169132 -0800 +++ b/include/asm-generic/x86-vfm.h 2026-02-06 15:14:21.851731274 -0800 @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_GENERIC_X86_VFM +#define _ASM_GENERIC_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_GENERIC_X86_VFM */ _