From nobody Wed Dec 24 23:35:23 2025 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 D228D604C9 for ; Tue, 23 Jan 2024 12:53:54 +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=1706014436; cv=none; b=DhhwcvmA6LDLtkqXaOh5yd74/psFDEMQtZXPNbeSYjcTUZoYkX7NgyLpBiAHPVzVEMgG+SOFS+aJ2dT990SKyaZzzelmQp8P4ogc8VW68DN5ArltnTTKpKB+P+ADWLQulvoKQ9MLyi13SMk+YtbXrZm9l1o5xRQg6wdbBiQxIvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706014436; c=relaxed/simple; bh=dxJPvwsmxdFo/LFFVRtcyswigBmF+7W8Cgmx74fu2jA=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=Qo9E9nvu2/9gtDGICKK8sHJFmmik9IwAF2i1sp8SA9RKF01gl8WpNvYmtuK/c4jFfRKq0zctw9JGcBX8JJNo+kdorRnfWCKEw6YYSF8Uu7NluknDYQtsXjmFajQKz02jzzHqZdccOiJlj2MIuSf9BaIe7QTC2xfqJsmnetFs/PU= 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=IOC3Q1Nf; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hiUJeyIv; 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="IOC3Q1Nf"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hiUJeyIv" Message-ID: <20240117115909.207795463@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706014432; 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=LX3PhNTWCMPpuLR0eISm6zXY5IPronq86Dl5H/SqaXU=; b=IOC3Q1NfZoYkF2fUzZ84snVBGvQ7qQPuJa7wto/Fp5PguyXR5ZrOcwruDzLypsR8sd8jW3 ayWFiud+i1RldfMfLKPPrfYguuXXz2yatNNOi+EnK6rlenFnVSPjm5KXjxnRNSDKEQyBNf YAG1ezk1YU4lomTyOChB3opnW+AWfrsdiMBgmcFANL5E5sb7XN+h5kvVtA3MBpotPBPMgF afpPnBwJNiabzW7Z8mOKOA/U8ROqPd7LF6mqhdh0C0LnkaMNIWeJYWy3txf+Bt4zxPM50r Bah8w2pZj/YUMPJrh6SDvBdPJxSuvDmJ7n660XqixxgJgmtr77w1lv0GaQcHqA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706014432; 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=LX3PhNTWCMPpuLR0eISm6zXY5IPronq86Dl5H/SqaXU=; b=hiUJeyIvJJiyUuLZ23DsYlP/DPL0gfMcE8mi/OMP+Sq2nN/BbnBGc4/Ef84h0bBLdtyBh8 8t7mLZ2Qvxu1eQCQ== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , Huang Rui , Juergen Gross , Dimitri Sivanich , Sohil Mehta , K Prateek Nayak , Kan Liang , Zhang Rui , "Paul E. McKenney" , Feng Tang , Andy Shevchenko , Michael Kelley , "Peter Zijlstra (Intel)" Subject: [patch v5 14/19] x86/cpu: Make topology_amd_node_id() use the actual node info References: <20240117115752.863482697@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Tue, 23 Jan 2024 13:53:52 +0100 (CET) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Thomas Gleixner 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 @@ -172,7 +172,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. */ - 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; }