From nobody Mon Feb 9 06:34:40 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 8FEC9314D2B for ; Fri, 6 Feb 2026 23:14:48 +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=1770419688; cv=none; b=lQlyI76gKKkLznFF9ZcnpIJ1GEHkbOBFQsye2Zez5XHGjwaWfVHk9s2mgMO6LIaDkRJeV2zkUWSEtZ3hehuohqZkveE1y8eZzT+DU4ibJs5H8NkvKxjxscaWQOwosJgxvLfDIDqRAHrcUUslN/ZlN4lcZDBygVwLH+47JH7Mp/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770419688; c=relaxed/simple; bh=R5dCWQZ1W3SOd7VJK5ms7Ud6cikz69g3LGl2Gaohv/o=; h=Subject:To:Cc:From:Date:References:In-Reply-To:Message-Id; b=PRtTHa1EiO3fZzW2eXwM5rmjqoKSjIinBlO7NA5fHZqOvMhNNymeaboJXCb0Kc37Bf/W22hlAjBKw4S5QoBiXP9QNrrWN09XpfnC0CvMoMBnNGw55k29X7lLnQr6pi8mStHNEF92A+3KvGdsVCVUZltxUxcFiSJWVGzN9NfrL5Q= 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=ndq3SCcU; 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="ndq3SCcU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1770419688; x=1801955688; h=subject:to:cc:from:date:references:in-reply-to: message-id; bh=R5dCWQZ1W3SOd7VJK5ms7Ud6cikz69g3LGl2Gaohv/o=; b=ndq3SCcUUCCE8HppcqZKuKjx4LlzlKXfkhVxZqogyNEKTbjRTSa5ArQZ h5swbmFsVoJ3qNAJInHi4vA0KEdxqhZGigMj0MYNnpFmBjqtCxzpdCFaF Zm4OciAI/CRxiivtXL45P14fpuBiEi6GUOT8Apn95v9Q8PJLXw/rjDtBa lhmtVCDGIPbG09o0R0IkIPmNGcJmeCsB2MZCtbiohZ0MHeXx8ummVYgyK CUnR9YFeBf439oCadEhQwmEJ3fz1zNh/ZtgOu4cgTpkwi1JkWr7ttoUGP 9CvrzQfkbbr7t0+u7XD/CyyTrTEbcZHu/aeKt8F4IQDUyP4+1WAYE6jTm Q==; X-CSE-ConnectionGUID: 2lvXw5INTEOYxFjQ/gXFKQ== X-CSE-MsgGUID: nJCJzPHcS5u74gYnrpn48Q== X-IronPort-AV: E=McAfee;i="6800,10657,11693"; a="74232717" X-IronPort-AV: E=Sophos;i="6.21,277,1763452800"; d="scan'208";a="74232717" 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:48 -0800 X-CSE-ConnectionGUID: 5sNpy8DZTLGZWp6+eSnRBQ== X-CSE-MsgGUID: HYCJavsQQiarGBg0ATYXCg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,277,1763452800"; d="scan'208";a="210851533" 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:48 -0800 Subject: [PATCH 5/6] x86/cpu: Add platform ID to CPU matching structure 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:47 -0800 References: <20260206231438.720FF4E3@davehans-spike.ostc.intel.com> In-Reply-To: <20260206231438.720FF4E3@davehans-spike.ostc.intel.com> Message-Id: <20260206231447.A708BA3D@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 existing x86_match_cpu() infrastructure can be used to match a bunch of attributes of a CPU: vendor, family, model, steppings and CPU features. But, there's one more attribute that's missing and unable to be matched against: the platform ID, enumerated on Intel CPUs in MSR_IA32_PLATFORM_ID. It is a little more obscure and is only queried during microcode loading. This is because Intel sometimes has CPUs with identical family/model/stepping but which need different microcode. These CPUs are differentiated with the platform ID. Add a field in 'struct x86_cpu_id' for the platform ID. Similar to the stepping field, make the new field a mask of platform IDs. Some examples: 0x01: matches only platform ID 0x0 0x02: matches only platform ID 0x1 0x03: matches platform IDs 0x0 or 0x1 0x80: matches only platform ID 0x7 0xff: matches all 8 possible platform IDs Since the mask is only a byte wide, it nestles in next to another u8 and does not even increase the size of 'struct x86_cpu_id'. Reserve the all 0's value as the wildcard (X86_PLATFORM_ANY). This avoids forcing changes changes to existing 'struct x86_cpu_id' users. They can just continue to fill the field with 0's and their matching will work exactly as before. Note: If someone is ever looking for space in 'struct x86_cpu_id', this new field could probably get stuck over in ->driver_data for the one user that there is. 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/kernel/cpu/match.c | 3 +++ b/include/linux/mod_devicetable.h | 2 ++ 2 files changed, 5 insertions(+) diff -puN arch/x86/kernel/cpu/match.c~platform-match arch/x86/kernel/cpu/ma= tch.c --- a/arch/x86/kernel/cpu/match.c~platform-match 2026-02-06 15:14:24.127811= 266 -0800 +++ b/arch/x86/kernel/cpu/match.c 2026-02-06 15:14:24.137811618 -0800 @@ -76,6 +76,9 @@ const struct x86_cpu_id *x86_match_cpu(c if (m->steppings !=3D X86_STEPPING_ANY && !(BIT(c->x86_stepping) & m->steppings)) continue; + if (m->platform_mask !=3D X86_PLATFORM_ANY && + !(BIT(c->x86_platform_id) & m->platform_mask)) + continue; if (m->feature !=3D X86_FEATURE_ANY && !cpu_has(c, m->feature)) continue; if (!x86_match_vendor_cpu_type(c, m)) diff -puN include/linux/mod_devicetable.h~platform-match include/linux/mod_= devicetable.h --- a/include/linux/mod_devicetable.h~platform-match 2026-02-06 15:14:24.13= 4811512 -0800 +++ b/include/linux/mod_devicetable.h 2026-02-06 15:14:24.137811618 -0800 @@ -692,6 +692,7 @@ struct x86_cpu_id { __u16 feature; /* bit index */ /* Solely for kernel-internal use: DO NOT EXPORT to userspace! */ __u16 flags; + __u8 platform_mask; __u8 type; kernel_ulong_t driver_data; }; @@ -703,6 +704,7 @@ struct x86_cpu_id { #define X86_STEPPING_ANY 0 #define X86_STEP_MIN 0 #define X86_STEP_MAX 0xf +#define X86_PLATFORM_ANY 0x0 #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ #define X86_CPU_TYPE_ANY 0 =20 _