From nobody Thu Apr 2 23:55:28 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 1455333D4F0 for ; Fri, 13 Feb 2026 23:51:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771026686; cv=none; b=rgZmp3gviRj4Du/QMHI1gz7sCkfsR66BeKOCUHxAbSQ9ffWsL4pfbIncKTXBIUnjg/jmUaSjVjxZE0Hd8tu4ugKia4HZjzufVmtpEhxt9tEcPUmfUpI48lUDghNe6Tg9dGsKObFF8uRsEbSWWueDJ7Hwwu8kEy/Sy7kyqAcByqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771026686; c=relaxed/simple; bh=kcFoLtBCTwv2Jji86wpU3adqxvLHXdG/w+I7qI91UE4=; h=Subject:To:Cc:From:Date:References:In-Reply-To:Message-Id; b=Q5oiETyyN3VqPOn+SoyDQffH4jTbfc2Mzgf6P52SpurEuJuB+/86Qt1ZJFI7PyzolBm7S9hqh16xVo2tYPxn4gEq8VPwKoGQ+oluWvGYEe9MYGWVVmAD1ASqJHJkjICMZPLSSDH+KpezyUF1mB2oMRBLPn1+qchIFbtBJWQ1ca4= 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=As41i1jE; arc=none smtp.client-ip=192.198.163.8 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="As41i1jE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771026685; x=1802562685; h=subject:to:cc:from:date:references:in-reply-to: message-id; bh=kcFoLtBCTwv2Jji86wpU3adqxvLHXdG/w+I7qI91UE4=; b=As41i1jEloS3aBr6WCRjuODwNomSDjebN1xb637P7PNN5Spb5Q2Lujok +APQXzxxC1KJMEXf7B75dT8vBdH8HbONSzAkFl+zyr1FXM+NstIyT2GwL LwszECm28R86ny5z5NggwU3vLBrQQ0x/uc9P323w8pB0zkliZS38jXP7I vBHSr3CZB6tCF+QyeIFnJ/ZIXpb6+dNA8+E3XlnVXPRPWitiTR45h7FZW YGpxECBdVxQrnz20wcDNkwBVKe1L7QAWYrRQKP5mgl8e8AuH6w/H/BOQF HtbRVdv10aaSVSZqGWOrf+6Yy1psFzI0XrPIDanIME9CWZMLJtub8cLyP Q==; X-CSE-ConnectionGUID: mpLO7jvYRCuSRCQhYocoHw== X-CSE-MsgGUID: h3GkQ3qOQauryr6C2d66TA== X-IronPort-AV: E=McAfee;i="6800,10657,11700"; a="89803983" X-IronPort-AV: E=Sophos;i="6.21,289,1763452800"; d="scan'208";a="89803983" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2026 15:51:24 -0800 X-CSE-ConnectionGUID: UHW48gnaSUeKLDnWZNdhqA== X-CSE-MsgGUID: CXdrMC7lQPi4GPDxjBT7Xw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,289,1763452800"; d="scan'208";a="212895757" Received: from davehans-spike.ostc.intel.com (HELO localhost.localdomain) ([10.165.164.11]) by orviesa009.jf.intel.com with ESMTP; 13 Feb 2026 15:51:24 -0800 Subject: [PATCH 3/4] 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, 13 Feb 2026 15:51:24 -0800 References: <20260213235119.6A9A0F80@davehans-spike.ostc.intel.com> In-Reply-To: <20260213235119.6A9A0F80@davehans-spike.ostc.intel.com> Message-Id: <20260213235124.9006C3FC@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 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 Reviewed-by: Sohil Mehta 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-13 15:51:01.671378= 173 -0800 +++ b/arch/x86/kernel/cpu/match.c 2026-02-13 15:51:01.675378328 -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->intel_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-13 15:51:01.67= 2378212 -0800 +++ b/include/linux/mod_devicetable.h 2026-02-13 15:51:01.675378328 -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 _