From patchwork Wed Aug 2 10:21:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 129756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp359838vqx; Wed, 2 Aug 2023 03:41:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlEqGgvbLRAJ3xTEgKHKOQj//VTwCnz/zM1dcuNwTXrKpJhHZ29bhdsM0esSOJJjijDqTS1T X-Received: by 2002:a05:6402:1659:b0:522:cb97:f196 with SMTP id s25-20020a056402165900b00522cb97f196mr4806740edx.36.1690972902248; Wed, 02 Aug 2023 03:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690972902; cv=none; d=google.com; s=arc-20160816; b=JkX+CJkRPzFnDZ8G755VHsVUYH/+v7KPYRtaoHlMzAhURTWloocZ+We1opHZzM+m+v U2XjMgQV6SO9vxxnSRLxB4bNoWGrGgf17xctXiVWNppIlsrBlRb4HPv+ZKbpRnGfXDXd mHu0oK9CMAKqz2mP03VQDQdAhRZL6V8fU4SPbL6UTNmaL2gSc7qwojKqVtQ6f9u8Nvh1 5R/W7johzeiNP/m2LipiR1ESILA+bwbPY0QdyRt0DxhjlVJ0v//ycY3BTbIEE0bQxtzI dXYC76BxVNBo2wm/yWhITpr0zNmCfH4n62rlJqarAjQPGvAQndBG9lYpw/RPdv88NbA0 q/aA== 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=O9JPtEgoXN20WvvffwC9vht4C9mlV4cjm0SKbEbqoG0=; b=bLysuvzZXfyqjQOjfrJNq7phb8WDWKitn3Yud3CxOR1E5xPiUwqKMleWdl0IxokqOY pjED3EYjflsSLYXVD/+UGocexIvsnz5KdOMyoScIpYzD0BBiFPp2Bbf65B5eIvX3jMBD HzM9KmyfM8thg9J+L2y3ncuMmGuwdWx2KOf9R9kjJY1p9m3MQsmOlBsAD5l5kUynYbe0 YC/Jo7h0nV2d83eO6O6om3jTDaBVw52W8fCLe4hSyNhSqQJhVBfmwmeQzLLxEyq7mdp3 oUZVRMX4QIGEkGjSn7blWsynlWLrZhNLDvSxMccCZHjisKk0/yS6EzQr+EtCTecbiJyP G7bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZPGr7pYO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=AkvBRaWY; 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 v15-20020aa7d80f000000b0052275937198si9476427edq.628.2023.08.02.03.41.18; Wed, 02 Aug 2023 03:41:42 -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=ZPGr7pYO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=AkvBRaWY; 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 S234021AbjHBKZp (ORCPT + 99 others); Wed, 2 Aug 2023 06:25:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232222AbjHBKYw (ORCPT ); Wed, 2 Aug 2023 06:24:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 763A546AA for ; Wed, 2 Aug 2023 03:22:40 -0700 (PDT) Message-ID: <20230802101934.472046549@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690971706; 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=ZPGr7pYOkLkHbHgU9IHgxAm+F05vXEQiHjAIco+FVcRjUPK2HJ/LW98ZCUcuxyAK10UPH+ vVtO4sRtEuAv0xiJ6cZIKUAwmBJY86yC/KzK0BhtSUAroVZ1f+b4wSQQoSlD9KnrP1SWrN Lnzci1i0P0b8SDkzpzRj42FxNJJpp9ApLhJOSkd2Z6shpahsDbjJTIsBciyH0nJIFkLE2z 4ACOFEctr8v25ODusINbLocH2cjktAtKwz4D7xByY7G3nvOZfnqTxN6s+T7OzoyZqagkYs P9fv0RZRQ86z8yWpYVqdct8HrKDmrGEYpQw4lBD8s83wpy5RA7r1oQ/0medWeg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690971706; 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=AkvBRaWYKTLKp73ignhKa8jp2GwMNvjpExIfbxsYcQ0qoWATCdR2LFgwoiqp6sC3v4HMUM SvvAQ2wxCImd+mAg== 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 Subject: [patch V3 31/40] x86/smpboot: Teach it about topo.amd_node_id References: <20230802101635.459108805@linutronix.de> MIME-Version: 1.0 Date: Wed, 2 Aug 2023 12:21:46 +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,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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773113601595722597 X-GMAIL-MSGID: 1773113601595722597 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)