From patchwork Fri Jul 28 12:13:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 127616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp415505vqg; Fri, 28 Jul 2023 06:01:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlEZFoPqFFFK8yu1PLQ3XzxJtLLyxeOBAkfLqK4lZt/nLIeIN/2lZ2tc7p0TTfv7cLMZqkYu X-Received: by 2002:a17:90a:a798:b0:267:f094:afcf with SMTP id f24-20020a17090aa79800b00267f094afcfmr1193337pjq.12.1690549266500; Fri, 28 Jul 2023 06:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690549266; cv=none; d=google.com; s=arc-20160816; b=p5HURKKrsZffc+IVLDdKAwTS/4eCpTTbDD5by1LZ8IP9Cm7Lqd0DvU1JMQE2yD4Uc9 yca7mk2nZrgjhZDIFkfdQ6O7Qr958hKjJjibkyithpN3iVs2uPPKhyzG8qhIqnGvKtsC mZOWY8Y+6YpkLIPmK3rQt1lZtKhXinrW1MciF5mX9Mc0VCGwoKvkVnv1QEayrO4n7K8+ TFlU4QpChbnYEMVgnZ38reYjOWdJ7A5UZshsTpmZserSI3bo/0Z+EgfPXMQ9pxLkUPEi LxacFKZqeBkqt8v/VWDeb+3S2ZtdbMFy3tFgghiRe3ewnukuPFsYLnYgMaqPaySAE3Sv Nvwg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1-20020a17090ad30100b00268122b5e44si916784pju.134.2023.07.28.06.00.51; Fri, 28 Jul 2023 06:01:06 -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 S236579AbjG1MQU (ORCPT + 99 others); Fri, 28 Jul 2023 08:16:20 -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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772669387757041307 X-GMAIL-MSGID: 1772669387757041307 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)