Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1368664rwb; Fri, 28 Jul 2023 08:27:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlE/hnjhkV1XJezkoJWb8Q0v4/vpZ2dw2R8MQhb+d1NkTJzpP5ep3iMwpqbYHTu1brNVWsFU X-Received: by 2002:a17:90a:648a:b0:263:514:5eda with SMTP id h10-20020a17090a648a00b0026305145edamr1480190pjj.29.1690558031188; Fri, 28 Jul 2023 08:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690558031; cv=none; d=google.com; s=arc-20160816; b=wr66081wmc9gYwFsO0/9np2yyKW9m8umZogHlk2nxt3M1YTFmjU/lYtC9uYQue+kKZ ccSCNR85eyT2UIRrvYQzDTehidA++N2y5yjB3wG1ZsbV5Ok6EemlhnhAjsVzalxpW0JA YvWP6NVTjBFwDUyy8LBfz61zJXa0S1JFFtXokdPYQNVE0z0OZEEEv4K74G9hkkuj5DcG anBPKQfBDQAEKrGZu/Fs8HdfcxmNMnldd/VXn6KgAskXfnmk28i877oBXXwKxeJcuKZJ 4vvvSQZ3V9U1Sk9o90lUVOwUfNXRm/luJrCS5FYWzgJwwjx/NVxxsROCeQsffNMSj94f qUjw== 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=4pQHURzHcwcFZ9S0vbzPTsi43pbiloyiG3aJ+/xAmII=; fh=y/slnYrqOPbByUK75sFPvq3cYp2SbZKM1q7UWSqjNrY=; b=UXuNJrU+AgGQSqnK9YnwiNFsNvvmaKg8uQvYCXWakZ2MkkVFqW8LlN2A2jKr4IyKXE Wq766UQCBs+ibLcby5GTFkrVbxWUGTzjY0NJ6wfen1u2/BEZqLMnwRgoi2OwhpE8wAph 4YNmMf0rv77PzqMUrlDTUbNBm+yMuuNS7UXd/zTJUHaJVB3oy19ntB6L8CO/DzhpSKap 9Chk4K26yWN/U6ut9ksLNVKShXvEUYXKcB/QCC+MWEudIduAtPid7PkTya+6pgDGQkxR GkcSUV3Vk3uDPK49vlVbo+KjiausEE6fwmzzBgQDFjPuTXD85q3GIr3Fs4DM2KftiGJ2 IIVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2uxuTBpL; dkim=neutral (no key) header.i=@linutronix.de; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c66-20020a633545000000b00563fc307786si3233427pga.398.2023.07.28.08.26.59; Fri, 28 Jul 2023 08:27:11 -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=2uxuTBpL; dkim=neutral (no key) header.i=@linutronix.de; 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 S236497AbjG1MQT (ORCPT + 99 others); Fri, 28 Jul 2023 08:16:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233770AbjG1MPZ (ORCPT ); Fri, 28 Jul 2023 08:15:25 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4717346B3; Fri, 28 Jul 2023 05:13:22 -0700 (PDT) Message-ID: <20230728120931.280604061@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690546399; 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=4pQHURzHcwcFZ9S0vbzPTsi43pbiloyiG3aJ+/xAmII=; b=2uxuTBpLwnNiWyOhNirtwcOZpXwsG5iYOGFKkk99p4gjv1Oj/UngUBmdoPuvcVAjIiN93Z Sx2kaSkgPgpSWs4Rg7uoHcdnWZ5PKbWM8AfjsqSLM4URWGaCs8mZPenAnBIlIMN3Fj6kgm aMzoJVmcJotI7QeMswhSuvMjcAWPmNowqMe44Y6IpY214nOPHimYFzbg3F2U2t9LZMIiRo T63RAeQEKfj7M8DfJyO+9k2OOQm3GIrmhNbAnsuY4/3UzGDUJnGRkSbRrDtRTk0gibHa49 Vo+e93PhMaoNznQyDGsU2WX43qHtv3zTKUgCCpWOjEf4+Fk4b1f5lVLNGoPl4g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690546399; 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=4pQHURzHcwcFZ9S0vbzPTsi43pbiloyiG3aJ+/xAmII=; b=LnATTY+oDj8YYsxyo2raV/mPTp7jHEzbX3HxCfkoy8KZGvnR5TSACd4nF/Kli099gpgUGo avDL74KfZwjcj7Cg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , "James E.J. Bottomley" , Dick Kennedy , James Smart , "Martin K. Petersen" , linux-scsi@vger.kernel.org, Guenter Roeck , linux-hwmon@vger.kernel.org, Jean Delvare , Huang Rui , Juergen Gross , Steve Wahl , Mike Travis , Dimitri Sivanich , Russ Anderson Subject: [patch v2 29/38] x86/smpboot: Teach it about topo.amd_node_id References: <20230728105650.565799744@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Fri, 28 Jul 2023 14:13:18 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org When switching AMD over to the new topology parser then the match functions need to look for AMD systems with the extended topology feature at the new topo.amd_node_id member which is then holding the node id information. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/smpboot.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -486,6 +486,7 @@ static bool match_smt(struct cpuinfo_x86 if (c->topo.pkg_id == o->topo.pkg_id && c->topo.die_id == o->topo.die_id && + c->topo.amd_node_id == o->topo.amd_node_id && per_cpu_llc_id(cpu1) == per_cpu_llc_id(cpu2)) { if (c->topo.core_id == o->topo.core_id) return topology_sane(c, o, "smt"); @@ -507,10 +508,13 @@ static bool match_smt(struct cpuinfo_x86 static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) { - if (c->topo.pkg_id == o->topo.pkg_id && - c->topo.die_id == o->topo.die_id) - return true; - return false; + if (c->topo.pkg_id != o->topo.pkg_id || c->topo.die_id != o->topo.die_id) + return false; + + if (boot_cpu_has(X86_FEATURE_TOPOEXT) && topology_amd_nodes_per_pkg() > 1) + return c->topo.amd_node_id == o->topo.amd_node_id; + + return true; } static bool match_l2c(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)