From nobody Thu Sep 11 12:46:48 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C315FC41513 for ; Mon, 14 Aug 2023 08:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235289AbjHNI4Q (ORCPT ); Mon, 14 Aug 2023 04:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbjHNIyb (ORCPT ); Mon, 14 Aug 2023 04:54:31 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48B00E63 for ; Mon, 14 Aug 2023 01:54:26 -0700 (PDT) Message-ID: <20230814085113.943741781@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1692003264; 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: references:references; bh=4iXkw5b5yzZbS9P0CLmmPoIGWnWH9U/f1eKITrK8kpw=; b=sklJX4oAPlfvpMTY5+d2q0Au85TgEjcHLA9xdA43L5u3Iyq1cmB0cc/eUvfGMD5J3bhUEX P48mwKli15guQW3EjGUz3yntth+fpRA+bPKMrP+ptYWpECbXH+irPHxkZh44jPMD58+Npy 3F850MWIkdUfpR15izpt9Syk/Chve3K9JS5u6VbaN19hDETY4RClvZURfQC1J+MOMLJb2O U2vl9e3zaqCInXyE8anzLHa3YxZz3GMa32YM58ee+jr9aOL6MM9MJjqL4EiCiWJlFZdpz1 qWQJJv1Hid2nWVshIaFj5oudK+A0efUw3kHsCyulKvBZzldg/AklIssOvznk5Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1692003264; 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: references:references; bh=4iXkw5b5yzZbS9P0CLmmPoIGWnWH9U/f1eKITrK8kpw=; b=AcsWVBpCTuRd2eOsOedhyz0xNvRtlRz+J3WJc9E4BhY7ceFU1AJamHR2WOVtK3xHi+jFJr RKMI0EbgBqm+CRAw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , Huang Rui , Juergen Gross , Dimitri Sivanich , Michael Kelley , Wei Liu , Pu Wen , Qiuxu Zhuo , Sohil Mehta Subject: [patch V4 32/41] x86/smpboot: Teach it about topo.amd_node_id References: <20230814085006.593997112@linutronix.de> MIME-Version: 1.0 Date: Mon, 14 Aug 2023 10:54:24 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When switching AMD over to the new topology parser then the match functions need to look for AMD systems with the extended topology feature at the new topo.amd_node_id member which is then holding the node id information. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley --- arch/x86/kernel/smpboot.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -499,6 +499,7 @@ static bool match_smt(struct cpuinfo_x86 =20 if (c->topo.pkg_id =3D=3D o->topo.pkg_id && c->topo.die_id =3D=3D o->topo.die_id && + c->topo.amd_node_id =3D=3D o->topo.amd_node_id && per_cpu_llc_id(cpu1) =3D=3D per_cpu_llc_id(cpu2)) { if (c->topo.core_id =3D=3D o->topo.core_id) return topology_sane(c, o, "smt"); @@ -520,10 +521,13 @@ static bool match_smt(struct cpuinfo_x86 =20 static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) { - if (c->topo.pkg_id =3D=3D o->topo.pkg_id && - c->topo.die_id =3D=3D o->topo.die_id) - return true; - return false; + if (c->topo.pkg_id !=3D o->topo.pkg_id || c->topo.die_id !=3D o->topo.die= _id) + return false; + + if (boot_cpu_has(X86_FEATURE_TOPOEXT) && topology_amd_nodes_per_pkg() > 1) + return c->topo.amd_node_id =3D=3D o->topo.amd_node_id; + + return true; } =20 static bool match_l2c(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)