Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2445063rdg; Mon, 14 Aug 2023 02:46:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDuBPcKuGcXZzi4E/INHEcHcXErExQngOjvgRbccUbTtbLAJDyb12SkoaeY42ATmjEp81s X-Received: by 2002:a05:6a20:1d0:b0:140:6fa9:7001 with SMTP id 16-20020a056a2001d000b001406fa97001mr7131450pzz.40.1692006394954; Mon, 14 Aug 2023 02:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692006394; cv=none; d=google.com; s=arc-20160816; b=M2yIQBHaGJBIywwTrLGkWi2fXKWk+cvDuObaNnY6bBdjPn1zesT+AOjYvjta1RbzDa JcWigDRzyk7L7FwUgAwcprMg+fAEfkfZvWxy22NiqPLV1GxNyb3qB2bpUw7EIr660h5w L1aElK1x4OIE3zQdL35MsWyFDUG29bE02mh5OMdpUZFa9k95VXOvHFblaW/esvOXKfBu XAH6YSVMz2yDGkfz4fvL0rbcitJOO/Hx83FtGwuVymmQF03HY/H2en2Pv9JDJVWOdfL2 8oRULuLtw7WuNvFLDxqlWqd70rAZMuJblBQwBJG6M4R4b5Mdg8fGmXWdfkg94a1EUki4 7Yzg== 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=4iXkw5b5yzZbS9P0CLmmPoIGWnWH9U/f1eKITrK8kpw=; fh=vmKIJtcbtoHWhyuxI4oEq8r1SWZ2V9Rrbp1Orw2DxqA=; b=cVpCjGQcUpfbvkkVSzhPgGoFGAIVV5MGeuHlfbf1w9T1aszu+3F9USnJobtpgd+hAi 7+wyxPESb/sWPw8bl1nw/Wo+9jdSBaxx6RSOziV0WC76HSCB+PnM9JYvBUSiIVlEqvcz Nil0wcC9yqr2FL29Rw2I8m+aNB/JjYfG8jN/ESJ89CeFBO9/tEoTWjRawCE75dbilmMo 4c22xhGM8iy7Py5ikgMQlWd1T7pJDbYe/Dk6TIkRFIeISBtMRj7dUkDKw6WAhNwCwZ3p ZXFbA3EIRyX5AXgA67O6eObWmxUhcuuWHRAOjSXtISs2DurgNZRCBoU0AC/eQASIS0u8 XXDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sklJX4oA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=AcsWVBpC; 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 kj14-20020a17090306ce00b001b8b4ed422bsi7453866plb.308.2023.08.14.02.46.23; Mon, 14 Aug 2023 02:46:34 -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=sklJX4oA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=AcsWVBpC; 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 S235238AbjHNI4O (ORCPT + 99 others); Mon, 14 Aug 2023 04:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbjHNIyb (ORCPT ); Mon, 14 Aug 2023 04:54:31 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48B00E63 for ; Mon, 14 Aug 2023 01:54:26 -0700 (PDT) Message-ID: <20230814085113.943741781@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1692003264; 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=4iXkw5b5yzZbS9P0CLmmPoIGWnWH9U/f1eKITrK8kpw=; b=sklJX4oAPlfvpMTY5+d2q0Au85TgEjcHLA9xdA43L5u3Iyq1cmB0cc/eUvfGMD5J3bhUEX P48mwKli15guQW3EjGUz3yntth+fpRA+bPKMrP+ptYWpECbXH+irPHxkZh44jPMD58+Npy 3F850MWIkdUfpR15izpt9Syk/Chve3K9JS5u6VbaN19hDETY4RClvZURfQC1J+MOMLJb2O U2vl9e3zaqCInXyE8anzLHa3YxZz3GMa32YM58ee+jr9aOL6MM9MJjqL4EiCiWJlFZdpz1 qWQJJv1Hid2nWVshIaFj5oudK+A0efUw3kHsCyulKvBZzldg/AklIssOvznk5Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1692003264; 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=4iXkw5b5yzZbS9P0CLmmPoIGWnWH9U/f1eKITrK8kpw=; b=AcsWVBpCTuRd2eOsOedhyz0xNvRtlRz+J3WJc9E4BhY7ceFU1AJamHR2WOVtK3xHi+jFJr RKMI0EbgBqm+CRAw== 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 , Pu Wen , Qiuxu Zhuo , Sohil Mehta Subject: [patch V4 32/41] x86/smpboot: Teach it about topo.amd_node_id References: <20230814085006.593997112@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Mon, 14 Aug 2023 10:54:24 +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: 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 Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley --- 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 @@ -499,6 +499,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"); @@ -520,10 +521,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)