From patchwork Fri Oct 13 09:38:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 152466 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1769753vqb; Fri, 13 Oct 2023 02:41:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEur/Gpd6PilDCqZ1yudFq+LNCgHAi/iNDCpDXXo9TPZCoWtEOsyNTdBpZEC30mASDu1CHl X-Received: by 2002:a17:90a:e7c4:b0:27d:15e3:3aa9 with SMTP id kb4-20020a17090ae7c400b0027d15e33aa9mr5285998pjb.3.1697190101029; Fri, 13 Oct 2023 02:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697190101; cv=none; d=google.com; s=arc-20160816; b=K3rmBVUtQ6ivYnnrsdWu6iWxvHsXLlYuhujCdd0x6amFTLiQVOKBRRQTMtFT0x8GWo sCXxnmgGvBG9UpngdRJm9Ib40NC7/gvuW7lCpHP+nmnx3z9P/3uQhfxgqFxuqq1oQX8U Au1yIxhvH7/VYXmLM6bTbGUc8F4+utuf0p//D5YK0T02TpjUNEPM0WI6sHdXXhBNnfwh o/JSD0VHks0fNehP6aEATjAU+t7W/3GeW3WLjNKsKQvCXLCgD388TdVrcTHLgqVXE1TH dXUvQRq7rG8lEM1bIcuZe3mUtIUJsBFFDpsfIuZ3SqRMjLt7LiamV+lh1W3sSNpthgAc MwNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Kqf/BoUJZcJ2Xcq4Hb3P58umHenSlBTPeLgsifWCH0k=; fh=9Et1xDJOjLzpfljkBv6WL6N9yJ3F7a92x/mCc58zBBw=; b=zHAFvBPVB3Gzpjb9oH/Bd+XmY11+q3yu7jIQoxAuxH7vLesY8vK9eeJVOLV9hCItAq Zwlu7mAElKp4SkOo/mpgFpKiMVSq1DA0TfpFc4jEwAqYApYzSbS7Wo4k5mjTsdDcFA84 BaOn2OGADVcMUk+diqjwYjTB4FnLRugMtc+odyl4Eg1LtzJQYs25Yg3X7FKjef28kf1t 9Ophg6dlTtbvkUbpg7zcDAvdP/iriY929C6HyhnP/fjF77bGfDDl2P+W5p5/+PS6W4K7 whA1Mo6tqSCG4h/zPMVRE5jGKK7vxypulz7UGYS3Hr6GmW+PHURO7cMITPfUOpnCQKzh o6Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GMIl3yCs; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id ce17-20020a17090aff1100b0025bb4a1c12esi4122715pjb.148.2023.10.13.02.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:41:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GMIl3yCs; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8FBEB807D3F4; Fri, 13 Oct 2023 02:40:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231439AbjJMJio (ORCPT + 19 others); Fri, 13 Oct 2023 05:38:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231230AbjJMJiM (ORCPT ); Fri, 13 Oct 2023 05:38:12 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5525CC0; Fri, 13 Oct 2023 02:38:11 -0700 (PDT) Date: Fri, 13 Oct 2023 09:38:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697189890; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kqf/BoUJZcJ2Xcq4Hb3P58umHenSlBTPeLgsifWCH0k=; b=GMIl3yCs81eubRDr7siFSyGE1I0vg7D6d9IAsUW541bytt3sK4jabiYIDNhHeltkSZz0Kj J+yPUP2kyMBrJrq3cLPrcyPMxD3zCjI2S7yjp8IE1/GDpKlL4CizzlttdW2k0xkWIzu7b6 JZ/5AA7DxuOGQkKvNzdZvXy8QjqEtjvBYedj3tbOMS+16k/ygREXIO9m/lwSyNHOcIXsfy /aNDhbU42RFKkF1oZzA4IhfMhz2P640Ag+Uvw8bbgF2Myfe2f91gkFxd4X2NTLPGvSNWo4 I71KfrKc5H5z9pWCf6bpo7ZEgq1c1DJnFYPA1MwugQoRucQoTvpiRZxoEKj6xA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697189890; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kqf/BoUJZcJ2Xcq4Hb3P58umHenSlBTPeLgsifWCH0k=; b=jpNnYOz2FhkaKmJJoJwNE0vLKwUNOrMyFh4W0RKHhVIH5uXI0qUG6yT09qJSwGrNoU244l Ijk9whjMWbKyZEBA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/core] x86/cpu: Move cu_id into topology info Cc: Thomas Gleixner , Juergen Gross , Sohil Mehta , Michael Kelley , "Peter Zijlstra (Intel)" , Zhang Rui , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230814085112.628405546@linutronix.de> References: <20230814085112.628405546@linutronix.de> MIME-Version: 1.0 Message-ID: <169718988942.3135.7810611573349152830.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 13 Oct 2023 02:40:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774196276043639830 X-GMAIL-MSGID: 1779632807361081124 The following commit has been merged into the x86/core branch of tip: Commit-ID: e3c0c5d52ad34ab2c97f93ca4a0c2e9ca2fdc06b Gitweb: https://git.kernel.org/tip/e3c0c5d52ad34ab2c97f93ca4a0c2e9ca2fdc06b Author: Thomas Gleixner AuthorDate: Mon, 14 Aug 2023 10:18:35 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 10 Oct 2023 14:38:18 +02:00 x86/cpu: Move cu_id into topology info No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.628405546@linutronix.de --- arch/x86/include/asm/processor.h | 4 +++- arch/x86/kernel/cpu/amd.c | 2 +- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/smpboot.c | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index a637602..517d0bc 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -90,6 +90,9 @@ struct cpuinfo_topology { // Physical die ID on AMD, Relative on Intel u32 die_id; + // Compute unit ID - AMD specific + u32 cu_id; + // Core ID relative to the package u32 core_id; }; @@ -110,7 +113,6 @@ struct cpuinfo_x86 { __u8 x86_phys_bits; /* CPUID returned core id bits: */ __u8 x86_coreid_bits; - __u8 cu_id; /* Max extended CPUID function supported: */ __u32 extended_cpuid_level; /* Maximum supported CPUID level, -1=no CPUID: */ diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 66bb929..a744d8d 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -413,7 +413,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c) c->topo.die_id = ecx & 0xff; if (c->x86 == 0x15) - c->cu_id = ebx & 0xff; + c->topo.cu_id = ebx & 0xff; if (c->x86 >= 0x17) { c->topo.core_id = ebx & 0xff; diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 4147665..106b27f 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1829,7 +1829,7 @@ static void identify_cpu(struct cpuinfo_x86 *c) c->x86_model_id[0] = '\0'; /* Unset */ c->x86_max_cores = 1; c->x86_coreid_bits = 0; - c->cu_id = 0xff; + c->topo.cu_id = 0xff; #ifdef CONFIG_X86_64 c->x86_clflush_size = 64; c->x86_phys_bits = 36; diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 7ab9224..17b86f4 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -482,9 +482,9 @@ static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) if (c->topo.core_id == o->topo.core_id) return topology_sane(c, o, "smt"); - if ((c->cu_id != 0xff) && - (o->cu_id != 0xff) && - (c->cu_id == o->cu_id)) + if ((c->topo.cu_id != 0xff) && + (o->topo.cu_id != 0xff) && + (c->topo.cu_id == o->topo.cu_id)) return topology_sane(c, o, "smt"); }