stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Tim Teichmann <teichmanntim@outlook.de>
Cc: Christian Heusel <christian@heusel.eu>,
	regressions@lists.linux.dev, x86@kernel.org,
	stable@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH Resend] x86/topology/amd: Evaluate SMT in CPUID leaf 0x8000001e only on family 0x17 and greater
Date: Tue, 28 May 2024 22:21:31 +0200	[thread overview]
Message-ID: <8734q1bsc4.ffs@tglx> (raw)
In-Reply-To: <87bk4pbve8.ffs@tglx>

The new AMD/HYGON topology parser evaluates the SMT information in CPUID
leaf 0x8000001e unconditionally while the original code restricted it to
CPUs with family 0x17 and greater.

This breaks family 0x15 CPUs which advertise that leaf and have a non-zero
value in the SMT section. The machine boots, but the scheduler complains
loudly about the mismatch of the core IDs:

  WARNING: CPU: 1 PID: 0 at kernel/sched/core.c:6482 sched_cpu_starting+0x183/0x250
  WARNING: CPU: 0 PID: 1 at kernel/sched/topology.c:2408 build_sched_domains+0x76b/0x12b0

Add the condition back to cure it.

Fixes: f7fb3b2dd92c ("x86/cpu: Provide an AMD/HYGON specific topology parser")
Reported-by: Tim Teichmann <teichmanntim@outlook.de>
Bisected-by: Christian Heusel <christian@heusel.eu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Tim Teichmann <teichmanntim@outlook.de>
Cc: regressions@lists.linux.dev
Cc: stable@vger.kernel.org
Closes: https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/issues/56
---
Resend with LKML in Cc. Sorry for the noise.
---
 arch/x86/kernel/cpu/topology_amd.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/x86/kernel/cpu/topology_amd.c
+++ b/arch/x86/kernel/cpu/topology_amd.c
@@ -84,9 +84,9 @@ static bool parse_8000_001e(struct topo_
 
 	/*
 	 * If leaf 0xb is available, then the domain shifts are set
-	 * already and nothing to do here.
+	 * already and nothing to do here. Only valid for family >= 0x17.
 	 */
-	if (!has_topoext) {
+	if (!has_topoext && c->x86 >= 0x17) {
 		/*
 		 * Leaf 0x80000008 set the CORE domain shift already.
 		 * Update the SMT domain, but do not propagate it.

  parent reply	other threads:[~2024-05-28 20:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 21:23 [REGRESSION][BISECTED] Scheduling errors with the AMD FX 8300 CPU Christian Heusel
2024-05-24 22:24 ` Thomas Gleixner
2024-05-25  0:12   ` Christian Heusel
2024-05-27 10:06     ` Thomas Gleixner
2024-05-27 12:35       ` Tim Teichmann
2024-05-27 15:01         ` Thomas Gleixner
2024-05-27 16:36           ` Tim Teichmann
2024-05-27 17:17             ` Thomas Gleixner
2024-05-28 15:43               ` Tim Teichmann
2024-05-28 19:15                 ` Thomas Gleixner
2024-05-28 19:17                   ` Jens Axboe
2024-05-28 20:19                     ` Niklas Cassel
2024-05-29 13:02                       ` Tim Teichmann
2024-05-29 18:33                         ` Niklas Cassel
2024-05-29 22:59                           ` Tim Teichmann
2024-05-28 20:19                   ` [PATCH] x86/topology/amd: Evaluate SMT in CPUID leaf 0x8000001e only on family 0x17 and greater Thomas Gleixner
2024-05-28 20:21                   ` Thomas Gleixner [this message]
2024-05-29  9:25 ` [tip: x86/urgent] " tip-bot2 for Thomas Gleixner
2024-05-30 14:06 ` tip-bot2 for Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734q1bsc4.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=christian@heusel.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=teichmanntim@outlook.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).