Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp451561rdb; Tue, 23 Jan 2024 04:58:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0dzuIxB3cyAgNS857w9g1gtazRoGh8LLcZgsqoM5bhP1SJ0M963K9ZJ7Jc13yoCD8V5Uy X-Received: by 2002:a05:6358:e49e:b0:176:61b5:1d6 with SMTP id by30-20020a056358e49e00b0017661b501d6mr2089445rwb.4.1706014734709; Tue, 23 Jan 2024 04:58:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706014734; cv=pass; d=google.com; s=arc-20160816; b=PDYBNfPEt9McZukvISANA9mwZAa/I+/DGQrNxi8Jgo+HcdOOiqQWNHHsBcrO9yDaID RtV4fHyQMbe9vX9LRs0z6Svz871kHSYaUfvTSbI5bLKIM0/Xhpart6Gs77qfM3TBADqU eRwCQDD8riXkjyCeee+YjBidildkMZ1NOGFOO+I5/ycIppQx9RcensHpZ/ExYCC3Z4Mx 4/G85217I+kA9OR9x59shp0t0gn8YAphisMVt61UaJTmwFQHF7XnImfdCqfRSa8VFe1K ODYEg7maZHy2yxWHbUuOI8Pu1x0WvBWSx4ABZ6lPJWKoGLg/H8kgfnU7Y58SV7j8Dtui U2Uw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=LX3PhNTWCMPpuLR0eISm6zXY5IPronq86Dl5H/SqaXU=; fh=Te0fDPJ/sd+7p881M6fa/oF213lBbJvGdEFWr/TLqNA=; b=v8r5Na2EuSYJ0zUfGEJT8BblnmwJXHCLZnrfDO2s1t5LsZ6urgfHOdjQ0HVHWB2yL3 pibDDdQSrLAb0O/Rh47MWQ/Pu/MUQDhe5g10fBT9XgI17MN48gs3QRhp4WCSCv3kMb+U /J6uWd+Ju3vNw25gCMxjuHm5pll5JwZH6R/q8KcLbv4DXunhGAoHFb/2zQRn7aVpJUJO BurZ5ueDQBou/z0gm+LFSoKAuQkWkhjGuMaY3qXZIhRk53iPaRqsg2cu/qA71T09s6YS NUThmh4Halv03SFGSRb3H1dSKcQ3PJ66Gk9nxwDgGk3tOnMQ6ylsmibt2Kq0IeYOpmcS 86Gg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IOC3Q1Nf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-35279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35279-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id fj19-20020a056a003a1300b006dd1cdbcbb4si1406883pfb.180.2024.01.23.04.58.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 04:58:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IOC3Q1Nf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-35279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35279-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 48BE7B210AC for ; Tue, 23 Jan 2024 12:57:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17E465F574; Tue, 23 Jan 2024 12:53:57 +0000 (UTC) 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" 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 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 Content-Type: text/plain; charset=UTF-8 Date: Tue, 23 Jan 2024 13:53:52 +0100 (CET) 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) -#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) extern unsigned int __max_die_per_package; @@ -172,7 +172,7 @@ extern unsigned int __amd_nodes_per_pkg; static inline unsigned int topology_amd_nodes_per_pkg(void) { - return __max_die_per_package; + return __amd_nodes_per_pkg; } 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 = (apicid & topo_domain_mask(TOPO_PKG_DOMAIN)) >> x86_topo_system.dom_shifts[TOPO_SMT_DOMAIN]; - /* Temporary workaround */ - if (tscan->amd_nodes_per_pkg) - c->topo.amd_node_id = c->topo.die_id = tscan->amd_node_id; + c->topo.amd_node_id = tscan->amd_node_id; if (c->x86_vendor == 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 == X86_VENDOR_AMD || c->x86_vendor == X86_VENDOR_HYGON) - __amd_nodes_per_pkg = __max_die_per_package = tscan.amd_nodes_per_pkg; + __amd_nodes_per_pkg = tscan.amd_nodes_per_pkg; }