From nobody Mon Feb 9 04:29:59 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 E646B2C3248 for ; Mon, 19 Jan 2026 19:50:58 +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=1768852264; cv=none; b=uQTsCVLe/DopIcfNisXHONE5RtgvAXVpFoS63W1YNDKI7p9fD0o1Htu3nyzhSqX8gtHXciQ055YCRvpobhIHkx3KL1/tTaDdWAhDituZr2HLsEJWoO/mqmBV3Dcv7/4Vt8BAPBkt5QCxwAGeEZHyhvqrWigQ5IJ11C99XKnSWBM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768852264; c=relaxed/simple; bh=lIcBeF8+Cb7YC2wTaaiVLH2/cJ4wT6RPOerOs7ENMg4=; h=Subject:To:Cc:From:Date:References:In-Reply-To:Message-Id; b=PKlzQDV6sNpejWN9EHWINBEErSnt6JjqG4myDUAaztHxa8faOSu836nRtczDqih+ngU8f8q/uI6R+cXXK4DqvlVtCI0vk2U1ny8anEKGU/np2RrgEtnrjHZAtvMq6ryw4gwrEaqxLi3oCTjSAo2OZ7az6NL0kkKZDfNvLCbPHik= 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=LB7XsceT; 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="LB7XsceT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768852259; x=1800388259; h=subject:to:cc:from:date:references:in-reply-to: message-id; bh=lIcBeF8+Cb7YC2wTaaiVLH2/cJ4wT6RPOerOs7ENMg4=; b=LB7XsceTZOT+WRPQicXWmE5GvMnvJb1JuV+pkn4A4+PDcR8OeOCaIWJG ZmFTed5eneRj1aOzUE+DA+R2R3fxqNX++YcGA7X2uJmaRApv5d6WfG/Ii VRU9j+NL6bxf/b+NcNd5DjuXVjJrd304+w9L9V4KUVGmHOsyAj4WUpz+L cV+ubqoUJ5qz1BigS8preEi32sJf9aujWub07WGFOcZBMuF5wa6oupSBX Y9J4R9HLLcZCJ0lILYbxTapCSgBIHqhV6c7UxvO4tF0/DgMBaCegMAlYu pqjUcRhcgnPow8F++av3jYmA+Hibo82rBUKF+UIM7OHHEQnO/5QzzDmMd g==; X-CSE-ConnectionGUID: zI1yJrlhSZ+pBIpQCMbrJw== X-CSE-MsgGUID: LcoDuCBOQJeQ44yu9TinGQ== X-IronPort-AV: E=McAfee;i="6800,10657,11676"; a="57623089" X-IronPort-AV: E=Sophos;i="6.21,238,1763452800"; d="scan'208";a="57623089" 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:59 -0800 X-CSE-ConnectionGUID: AltSH20wTSuDGMJxutD8iw== X-CSE-MsgGUID: WjQYwbF8TuqXmmfwsj/rqA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,238,1763452800"; d="scan'208";a="210786583" 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:58 -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, 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:57 -0800 References: <20260119195047.86E3C696@davehans-spike.ostc.intel.com> In-Reply-To: <20260119195047.86E3C696@davehans-spike.ostc.intel.com> Message-Id: <20260119195057.E6728139@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-01-19 11:38:10.020939= 979 -0800 +++ b/arch/x86/kernel/cpu/match.c 2026-01-19 11:38:10.046940973 -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 && + !(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-01-19 11:38:10.04= 3940858 -0800 +++ b/include/linux/mod_devicetable.h 2026-01-19 11:38:10.046940973 -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 _