From nobody Thu Sep 11 12:46:49 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 65FACC04FDF for ; Mon, 14 Aug 2023 08:56:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235583AbjHNI4c (ORCPT ); Mon, 14 Aug 2023 04:56:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234663AbjHNIye (ORCPT ); Mon, 14 Aug 2023 04:54:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7327A18E for ; Mon, 14 Aug 2023 01:54:32 -0700 (PDT) Message-ID: <20230814085114.183018283@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1692003271; 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=53nlX+r/fEq0JBYCW+1MqV4BLn6IkJJvtfrqLhkPQXE=; b=eNgC1LsoEznrxFiuUNUWa33Gw7F3kPsxszaafBI1YkLk/VMqXpxggYRauYy/zBtlquCfw5 N6RSOQF3FXQXMqEYpzUyCFFE+EcrtVSiXP5t0QeTCvcpRk40mh3nyVYmknvJ/1NrFlKxAB CWwn0HlQ5w3gjVj/7A4Lr0SEBLqaIGyiKnZJ9YunpZNXCw+FZv1ThbO/+Tj443f55zDh/F xPBKLS/H1nItKZK56ZITZZFCBS0ju0vIUAzCytbAvE4aG4Zo8MCTwzB1MWSFJ2JyecYsFu AQGWzRg9djwNBtgYVGJMSKhU/Y8gyg1RKQxQKlc4h71T9tQqz8YWkAaZS0XstQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1692003271; 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=53nlX+r/fEq0JBYCW+1MqV4BLn6IkJJvtfrqLhkPQXE=; b=ccngd3SNxF6qfuRpIxGi97cI9OLxWSkpv8b7gUwj+60KeFNXlRnMxjqtySuZFqJgFU7Xny 9dwvGjNahKtL44Ag== 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 36/41] x86/cpu: Make topology_amd_node_id() use the actual node info References: <20230814085006.593997112@linutronix.de> MIME-Version: 1.0 Date: Mon, 14 Aug 2023 10:54:30 +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 Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley --- 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 @@ -151,9 +151,7 @@ static void topo_set_ids(struct topo_sca c->topo.core_id =3D (apicid & topo_domain_mask(TOPO_PKG_DOMAIN)) >> x86_topo_system.dom_shifts[TOPO_SMT_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); @@ -239,6 +237,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; }