From nobody Thu Sep 11 12:57:03 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 4D6F8C001DF for ; Wed, 2 Aug 2023 10:24:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234126AbjHBKYm (ORCPT ); Wed, 2 Aug 2023 06:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233969AbjHBKXg (ORCPT ); Wed, 2 Aug 2023 06:23:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 994C42D63 for ; Wed, 2 Aug 2023 03:22:10 -0700 (PDT) Message-ID: <20230802101934.697864803@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690971713; 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=u2nALLK7m8WtmbLIhAtObAjpwOgRje3zo0FH2XahcbM=; b=V1ZQMVFtncXtGerj1HgIM1h59JhPlJ0LMTjszh4xqFaJdDWIa3KDngXHayE016EySYRWge z0yPaL8vi07fb/MDCjbhkUOmA2vyOKNyKSPt7o2756Xuy9Q09mu3UfF2SwsQyckj6paJgR Zk9W+eGkBiMI5O+Nj8ryIKn09CI+Px68+no7DEyY8lZtFCiQHWatJu20OKBr9bW4DPc+9o UocJH1Tlus2VgxkqIjnzsbc9tIBvpbAuI3mGBg2P3grBZZFzLxjwck+SgyDDzywF2oLTjO pFrQGYRWrWzM9B7PLmnYwN9f6fDm4YYkeyeDKVXT2I4BB6e/QRmc3+e7ZTi3ng== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690971713; 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=u2nALLK7m8WtmbLIhAtObAjpwOgRje3zo0FH2XahcbM=; b=KUxFA0xVZ8ayqRUIOZBP71zhYfRW4LR2h51trRVzZrx4qIYFw/Z5tLHObASu+spzuIj3sz 3p8OYCsXLqQ61BCw== 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 Subject: [patch V3 35/40] x86/cpu: Make topology_amd_node_id() use the actual node info References: <20230802101635.459108805@linutronix.de> MIME-Version: 1.0 Date: Wed, 2 Aug 2023 12:21:52 +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" Now that everything is converted switch it over and remove the intermediate operation. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/topology.h | 4 ++-- arch/x86/kernel/cpu/topology_common.c | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -136,7 +136,7 @@ extern const struct cpumask *cpu_cluster #define topology_core_id(cpu) (cpu_data(cpu).topo.core_id) #define topology_ppin(cpu) (cpu_data(cpu).ppin) =20 -#define topology_amd_node_id(cpu) (cpu_data(cpu).topo.die_id) +#define topology_amd_node_id(cpu) (cpu_data(cpu).topo.amd_node_id) =20 extern unsigned int __max_die_per_package; =20 @@ -171,7 +171,7 @@ extern unsigned int __amd_nodes_per_pkg; =20 static inline unsigned int topology_amd_nodes_per_pkg(void) { - return __max_die_per_package; + return __amd_nodes_per_pkg; } =20 extern struct cpumask __cpu_primary_thread_mask; --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c @@ -143,9 +143,7 @@ static void topo_set_ids(struct topo_sca /* Relative core ID */ c->topo.core_id =3D topo_relative_domain_id(apicid, TOPO_CORE_DOMAIN); =20 - /* Temporary workaround */ - if (tscan->amd_nodes_per_pkg) - c->topo.amd_node_id =3D c->topo.die_id =3D tscan->amd_node_id; + c->topo.amd_node_id =3D tscan->amd_node_id; =20 if (c->x86_vendor =3D=3D X86_VENDOR_AMD) cpu_topology_fixup_amd(tscan); @@ -231,6 +229,5 @@ void __init cpu_init_topology(struct cpu * AMD systems have Nodes per package which cannot be mapped to * APIC ID (yet). */ - if (c->x86_vendor =3D=3D X86_VENDOR_AMD || c->x86_vendor =3D=3D X86_VENDO= R_HYGON) - __amd_nodes_per_pkg =3D __max_die_per_package =3D tscan.amd_nodes_per_pk= g; + __amd_nodes_per_pkg =3D tscan.amd_nodes_per_pkg; }