From patchwork Fri Jul 28 12:12:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 13331793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50FE4C04E69 for ; Fri, 28 Jul 2023 12:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235048AbjG1MNK (ORCPT ); Fri, 28 Jul 2023 08:13:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235168AbjG1MMy (ORCPT ); Fri, 28 Jul 2023 08:12:54 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5EB1268B; Fri, 28 Jul 2023 05:12:52 -0700 (PDT) Message-ID: <20230728120930.055388145@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690546371; 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=WfNPFKAN9GG2GFdyit2jWhoSZIUriu/Y8Ta0CK3Muoc=; b=fmUzRCRg7yR2P9DmPno2iwKqUa/L1iNvs+O7AUmd4kIAmUT4fMakJpdvK0MPA1cVWsXKr8 AcAa4z8GCuOZuEuYsvXY7kkt70i2xlBdZlSP0q1UUxXbVpHR56wgtqxCIO9JZrp7TbXU48 paINd20ybEWFgxAHbtD+0DSlQKMZfsIlubSiXlLZuiYVlTSyhhsxR6eq5BElO7R0tv3znI jgQu8y2p1U7B4zlJJ6R2Fpj5uHzALuFGq5QAX6gcCRrJOYaGyrgAtwrDstu8c+sI2PFxKc oncHCfSY5oQnNO/aRAW0GfDbvmoX8Rc77qxisAnfeddue3K91oMNGu4sQUyEow== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690546371; 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=WfNPFKAN9GG2GFdyit2jWhoSZIUriu/Y8Ta0CK3Muoc=; b=ymtc3pobhOczipG+blBIQKfKln91uF8i+irowFLB4i13KBEAhcn5Fkx+nwjjjbLq2mtD0S ATWxtqL4UhsgbTDA== 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 07/38] x86/cpu: Move cu_id into topology info References: <20230728105650.565799744@linutronix.de> MIME-Version: 1.0 Date: Fri, 28 Jul 2023 14:12:51 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org No functional change. Signed-off-by: Thomas Gleixner --- 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(-) --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -89,6 +89,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; }; @@ -109,7 +112,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: */ --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -341,7 +341,7 @@ static void amd_get_topology(struct cpui 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; --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1789,7 +1789,7 @@ static void identify_cpu(struct cpuinfo_ 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; --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -490,9 +490,9 @@ static bool match_smt(struct cpuinfo_x86 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"); }