From mboxrd@z Thu Jan 1 00:00:00 1970 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 681D138DE0 for ; Tue, 28 May 2024 20:19:29 +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=1716927572; cv=none; b=arSrRCpROiY/hDVsbu6XuqU/sk2P3WkIBpwV+TBTSKQfyxJMAiV5sMuJHIsg6AdZi7Yt/32+DI0nzlkMLxsnQ11hyicajqimpIgme6PUpJNDSLCr0ADfUdvAiCobENhrjK9yOJlrvCcaRMF7UvHbrYIKV+pNcvc8wup5VvqrGMo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716927572; c=relaxed/simple; bh=bCnyNkYcT7CnMYxVqury3Go1NVn1uoE60pzIYieV7zQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=CjxrPotqRpld8LiEgigEo6+Jyl+6fWNDLgU5R4OctJPTYwsVfnyT8JxQpXHScbMNJEQE2BjeWECOyDNLbSTvIzrpYq1xwQ9tclVOlfvRTHzcmHea6DDuGyQnxyDs9lxpxMgXchShz1tVa8u5tBWvCklE1LbWE377d/rO8dA79M4= 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=XQoApnAF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=pl8HrQYL; 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="XQoApnAF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="pl8HrQYL" From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716927565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2JUnm0PsqDt3KpgMKu7BKosD7NeQC2DNtUPv6HiUxz4=; b=XQoApnAF1xJa6zYl5llzAnhWR95vlKVO07m37m2lBquSG5mgI075B+EAo9N3idnGVRlK8b vuKnLG/HtK2xqo3Rj/rfuDEFWQRspdXwz8gkct7unkZy9WcdZHEcn1EHddeDGogAebNovg z+pgWy0fRS8zUIyikb4wVGDe+zpdSCdW8HboS1c+6YM5s42yvPr1T3mb/Qlg2sRLp1n0FR H0aunRHYhH5LgaeVhdgXHhAlgv9go0cMaTpxdyJZmQ7jTpOXemseq4YUd1FLhrDq+jOJEk lVoTA1shIXgvDy2mSSKIWH9ykRSLP4Rnd6P+HRVEffz4z8IXWpWBtUivoy6qrg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716927565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2JUnm0PsqDt3KpgMKu7BKosD7NeQC2DNtUPv6HiUxz4=; b=pl8HrQYLydZspU9SDiVAbgCsy5FdVqn2vJcd8nXU6zRMHiZG76TaJxeIQAJGyxLnTNcdnc Jhovwcs5pXr5qBBA== To: Tim Teichmann Cc: Christian Heusel , regressions@lists.linux.dev, x86@kernel.org, stable@vger.kernel.org Subject: [PATCH] x86/topology/amd: Evaluate SMT in CPUID leaf 0x8000001e only on family 0x17 and greater In-Reply-To: <87bk4pbve8.ffs@tglx> References: <7skhx6mwe4hxiul64v6azhlxnokheorksqsdbp7qw6g2jduf6c@7b5pvomauugk> <87r0dqdf0r.ffs@tglx> <87h6ejd0wt.ffs@tglx> <874jajcn9r.ffs@tglx> <87msobb2dp.ffs@tglx> <87bk4pbve8.ffs@tglx> Date: Tue, 28 May 2024 22:19:23 +0200 Message-ID: <874jahbsfo.ffs@tglx> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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 Bisected-by: Christian Heusel Signed-off-by: Thomas Gleixner Tested-by: Tim Teichmann Cc: regressions@lists.linux.dev Cc: stable@vger.kernel.org Closes: https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/issues/56 --- 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.