Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp837119rdg; Fri, 13 Oct 2023 02:39:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVcRJ6Pq6ca+5xR7/hfYnrHt1LRW81KQIViiKiQb17FGNEUf7Q8LitbfFmKFIxSpBAPDyY X-Received: by 2002:a17:902:e890:b0:1c7:3156:ca48 with SMTP id w16-20020a170902e89000b001c73156ca48mr27605838plg.47.1697189971499; Fri, 13 Oct 2023 02:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697189971; cv=none; d=google.com; s=arc-20160816; b=gU6SRBmeNhhoE1AjfHgED5XeBqC2e7gmEsf67iewBZRKqcPL9Ie9U0dy7AqidVXh20 fsAc+Fww85hIWFdXu+qc+7+xiLsamaPOiAiSruBg0VqVXyTUcmuPRNDUR2mwqyCFRexn kwuxHJab8ZGKeu3qPM9Khv5m6fcvhV6ieUAEd5H2aac13IoMaHhGIyaB5c99CTIJJU6b jRhWAO+grlr/C/fSDc676k4eQ5Y0hgO3ykW2Xh0YNGz3BW9vUa52evax0Hc0fqcDjsF3 yyuvB9AUMyy+UMcCKRws+7tdZ+RXp7tFcGQ5y5/zq5o2AVa9GpCgMHzcRm32weaC/36j OeGQ== 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 header.s=2020e header.b=jpNnYOz2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id k3-20020a170902c40300b001bbc138af04si4626381plk.158.2023.10.13.02.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:39:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; 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 header.s=2020e header.b=jpNnYOz2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 36F0C8269C5E; Fri, 13 Oct 2023 02:39:20 -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 S231405AbjJMJin (ORCPT + 99 others); Fri, 13 Oct 2023 05:38:43 -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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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:39:20 -0700 (PDT) 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"); }