From nobody Thu Sep 11 12:46:48 2025 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 6D416C0729B for ; Mon, 14 Aug 2023 08:54:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235272AbjHNIyc (ORCPT ); Mon, 14 Aug 2023 04:54:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234736AbjHNIxw (ORCPT ); Mon, 14 Aug 2023 04:53:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71FB691 for ; Mon, 14 Aug 2023 01:53:51 -0700 (PDT) Message-ID: <20230814085112.628405546@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1692003230; 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=yTUgg0W0G9jWjgIj3wVyaf91exB4JINYBe4Wj/AZErU=; b=agUQvFvOR3ncPpfT2vMaWdtZz+cRJL9KInltadLEn/7CtXEUWpklCDKX8RuPCGAjYV1S4L fOnn+ssthYt12Cm36gG5nO3y7zxjEvOZ21oC+NPZxbYpOaebNyT4XVMOJIX7TTllopyP3y +8WTY9uc5kyHc9eOgrBVOcatA8i9r935sIfxzKhKX7qGE/zUhdqn3QM/izNsAjsitz46bM 2uX2DA5iZnSHMYv/M47aiUuv9uv9wjAyPud0RkZ1xLwdtQ5gY+ozRvtsMkozHjWZgJzNm3 6Wgo1tiXQzGi1X+efvBk+Q0o275i5Qsibgf9n1hg3PjVKW40CNzpiYrdgMIz7w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1692003230; 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=yTUgg0W0G9jWjgIj3wVyaf91exB4JINYBe4Wj/AZErU=; b=TKRAtQVE4TiH9GewlTAyRvq2bs257mKlKvw0hKF3pIWQ2vKwTyJx+qknSr0bzgY+Qr8pBJ 3pHazl87UhVk2RAg== 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 10/41] x86/cpu: Move cu_id into topology info References: <20230814085006.593997112@linutronix.de> MIME-Version: 1.0 Date: Mon, 14 Aug 2023 10:53:49 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley --- 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; =20 + // 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=3Dno CPUID: */ --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -408,7 +408,7 @@ static void amd_get_topology(struct cpui c->topo.die_id =3D ecx & 0xff; =20 if (c->x86 =3D=3D 0x15) - c->cu_id =3D ebx & 0xff; + c->topo.cu_id =3D ebx & 0xff; =20 if (c->x86 >=3D 0x17) { c->topo.core_id =3D 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] =3D '\0'; /* Unset */ c->x86_max_cores =3D 1; c->x86_coreid_bits =3D 0; - c->cu_id =3D 0xff; + c->topo.cu_id =3D 0xff; #ifdef CONFIG_X86_64 c->x86_clflush_size =3D 64; c->x86_phys_bits =3D 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 =3D=3D o->topo.core_id) return topology_sane(c, o, "smt"); =20 - if ((c->cu_id !=3D 0xff) && - (o->cu_id !=3D 0xff) && - (c->cu_id =3D=3D o->cu_id)) + if ((c->topo.cu_id !=3D 0xff) && + (o->topo.cu_id !=3D 0xff) && + (c->topo.cu_id =3D=3D o->topo.cu_id)) return topology_sane(c, o, "smt"); }