Message ID | 20230814085114.183018283@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2628636vqi; Mon, 14 Aug 2023 02:43:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFh5Hcdb/oZZosfHFDyIUcz+mNxChfbRr5G4H6wecK2QmhzwSsAC2Al0a+spFCXw+bXxpo9 X-Received: by 2002:a17:906:31cb:b0:99c:e38d:e47f with SMTP id f11-20020a17090631cb00b0099ce38de47fmr6972654ejf.33.1692006231741; Mon, 14 Aug 2023 02:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692006231; cv=none; d=google.com; s=arc-20160816; b=g+WZ/wjbJS9QQ6oSayn5FZ4P34C/nHdDqyM14yKaOBB7SrxNVauN7ApTxxvBBQ6YCY ILfYNwcRkRh5Uq+yveFtAsIAW7AH2OigVJlXatMqutYpCEl3x23QBKODkqBfJPTdNjSc ANyuHmrcdnWOg0+zueoPY6dVYSs4D/YE9ywsQ6RBWOoyUHXXrUuRVr/q5ne3R+R/vCVp 8x7PTw0PIuoPKa5vdUA/LnjxJxl7D2SVVXV06ZB0FTagdNuFB5U5upUkrErXx2SMgZtd rT79GpQHWo17PolETzPrMn2l5OWXZV7IUwRBOq0bVqd7HEDI8zMkOJV9Ajs5L4LsGykL RgmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=53nlX+r/fEq0JBYCW+1MqV4BLn6IkJJvtfrqLhkPQXE=; fh=vmKIJtcbtoHWhyuxI4oEq8r1SWZ2V9Rrbp1Orw2DxqA=; b=uo5sPMIHQUhq5Ivm9MifrKQ0LOtexWKFtokDY9zGmcwHu+I6/btSRJGx3RjoeHutY+ gWGW+2iVtYIUffuV+006Dhr9nxfwCUeHHbTJG/Osw75HWpp60OKDCDtZd7oBU7HT0mWa dDgnzL6jwn9YQcBl9q5wCGCr3mSpJACFQeoyqS9wwua3egTV1oAPapy6jmahmdQzLP+e Ns5ChvVu+7hRtMTB+3CkhIOql9KvoYIhczwUdscljMB4OBEuC24RBYUO9ZZseyzdniIe TtTuurGEluY2chOhI/03ND1Luw46uFR1oK4KEqDxYh1OpTbdoVomGSPTd1Vzt8xpwxt2 Wnag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=eNgC1Lso; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ccngd3SN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id op8-20020a170906bce800b00997bd26a560si7297957ejb.938.2023.08.14.02.43.28; Mon, 14 Aug 2023 02:43:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=eNgC1Lso; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ccngd3SN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235580AbjHNI4b (ORCPT <rfc822;274620705z@gmail.com> + 99 others); Mon, 14 Aug 2023 04:56:31 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: x86@kernel.org, Tom Lendacky <thomas.lendacky@amd.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Arjan van de Ven <arjan@linux.intel.com>, Huang Rui <ray.huang@amd.com>, Juergen Gross <jgross@suse.com>, Dimitri Sivanich <dimitri.sivanich@hpe.com>, Michael Kelley <mikelley@microsoft.com>, Wei Liu <wei.liu@kernel.org>, Pu Wen <puwen@hygon.cn>, Qiuxu Zhuo <qiuxu.zhuo@intel.com>, Sohil Mehta <sohil.mehta@intel.com> 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 Content-Type: text/plain; charset=UTF-8 Date: Mon, 14 Aug 2023 10:54:30 +0200 (CEST) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774197126427246531 X-GMAIL-MSGID: 1774197126427246531 |
Series |
x86/cpu: Rework the topology evaluation
|
|
Commit Message
Thomas Gleixner
Aug. 14, 2023, 8:54 a.m. UTC
Now that everything is converted switch it over and remove the intermediate operation. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Juergen Gross <jgross@suse.com> Tested-by: Sohil Mehta <sohil.mehta@intel.com> Tested-by: Michael Kelley <mikelley@microsoft.com> --- 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; @@ -171,7 +171,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 (yet). */ - 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; }