From nobody Fri Jun 12 17:18:13 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 6C5AE391E7C; Wed, 13 May 2026 16:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778689466; cv=none; b=G7MF86l5o1iOh7aG1InJRX4crSOAxgvUWIPjpvQhrJnB95xT2ti7QVulJcJOCdemHg6XYkxcqya15kAowJ6KRabzR/EJjoTnBSTSR7O30cZ3N4tile734am5w1GQvII/ZMrJJ6jwpbo1rNZc0AShkxT60I0e5+Scd/Tul96cXKw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778689466; c=relaxed/simple; bh=uqdmInR5FKfLxUNHPopYcts6LrwDtijC2MFq9/sblZ8=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=KCySOgLhHbOIinKT2c6pbFslHivuPdJG7MfUbrN0nDCDrWjm9k6juZa8TLfpG1wiyGko8BsEcidaiy9nELOAo8e4Dj+y3KdvQ/Zx0+WcUmt+99Jrg9049QXm+IZoVXBohHNehaUdaX9HnZjf3gevXoL1j8OK3Ick/wZL7VohS3A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Bdagg+Nq; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=93MaTort; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Bdagg+Nq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="93MaTort" Date: Wed, 13 May 2026 16:24:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1778689463; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=By9TyEa5J94oV+0Pb1ua4oqr1c67upRvUhexw8lwsDk=; b=Bdagg+NqK8WMUAEULsSl93IPiezZarModNRBI4/3zH8VsTPwDUbyxKIGVqQSI9b5wF+E4N BI4rZ7UvZQ2zoJ0Xd6SmMU2KjR4RLcI+QytLu6+pZ7NL/2y+R/yfqMctvy+j3O+qYLyuTL roPnBu+Tfy4dAweXQAN+Ci9yUedIUZpah+HJjeQqSVRIE2HCF7p5XL9H/zzMpZc5iwireq LUckqvcdjslh8+nJ1GeckUJc1leoJNwBISrngFCa6wOaZ8mfLM46YtFDl9yb/3Vie/WyKe rLc7vvhEgkTcEUm0nsK/5IF5kToh/EdaHJ5UujoQzL1CmUdC9udBy5P1FWiLVg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1778689463; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=By9TyEa5J94oV+0Pb1ua4oqr1c67upRvUhexw8lwsDk=; b=93MaTortEUDKmZoRIhdA4S4IyIUtkhCtnr6bck/iPVuKc3GdFy4OevtgRb6s6dV7STHfka ODMT9FHCI6g2gbBw== From: "tip-bot2 for Ahmed S. Darwish" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/cpu: Rescan CPUID table after disabling PSN Cc: "Ahmed S. Darwish" , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177868946174.188840.10895626352041064805.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 32e3732c0325385d389792bbe494434b3efae485 Gitweb: https://git.kernel.org/tip/32e3732c0325385d389792bbe494434b3= efae485 Author: Ahmed S. Darwish AuthorDate: Fri, 27 Mar 2026 03:15:24 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 13 May 2026 17:29:12 +02:00 x86/cpu: Rescan CPUID table after disabling PSN On Pentium-III and Transmeta CPUs, disabling the CPUID(0x3) Processor Serial Number (PSN) can affect the maximum valid CPUID standard leaf. Rescan the CPUID table in that case in order not to have stale cached data. [ bp: Zap unrelated changes, rescan the full range after disabling CPUID(3). ] Signed-off-by: Ahmed S. Darwish Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/all/20260327021645.555257-1-darwi@linutronix.= de --- arch/x86/kernel/cpu/common.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index a3df21d..c51cdca 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -339,13 +339,13 @@ bool cpuid_feature(void) =20 static void squash_the_stupid_serial_number(struct cpuinfo_x86 *c) { + const struct leaf_0x0_0 *l0; unsigned long lo, hi; =20 if (!cpu_has(c, X86_FEATURE_PN) || !disable_x86_serial_nr) return; =20 /* Disable processor serial number: */ - rdmsr(MSR_IA32_BBL_CR_CTL, lo, hi); lo |=3D 0x200000; wrmsr(MSR_IA32_BBL_CR_CTL, lo, hi); @@ -353,8 +353,16 @@ static void squash_the_stupid_serial_number(struct cpu= info_x86 *c) pr_notice("CPU serial number disabled.\n"); clear_cpu_cap(c, X86_FEATURE_PN); =20 - /* Disabling the serial number may affect the cpuid level */ - c->cpuid_level =3D cpuid_eax(0); + /* Disabling CPUID(0x3) can change the maximum base CPUID level. */ + cpuid_refresh_leaf(c, 0x0); + l0 =3D cpuid_leaf(c, 0x0); + if (!l0) + return; + + c->cpuid_level =3D l0->max_std_leaf; + + /* Rescan from the whole range. */ + cpuid_refresh_range(c, 0, CPUID_BASE_END); } =20 static int __init x86_serial_nr_setup(char *s)