Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2468528rdg; Mon, 14 Aug 2023 03:43:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsnbC6JSk4VqIkd/Fd1lBFS4J4ZUPC4OBNBrmQpF/sJIw+HU34Q6gF1E6NqH0W9Ip2nXv2 X-Received: by 2002:a17:903:22c7:b0:1bb:141c:3034 with SMTP id y7-20020a17090322c700b001bb141c3034mr9416988plg.12.1692009800222; Mon, 14 Aug 2023 03:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692009800; cv=none; d=google.com; s=arc-20160816; b=udZk3SSBNEGDqn9e3CQLtxxxTIkbKWV9SMQ3AC72q8UemRaOopN9NfOFETOdCnxFqv W3fhEvsyoAEDrmE0ZpKM6zdO96ieKXctAMYkfqluX1z7LHQbTuzXiZuaSlESE5xERD76 1JYq4Wt4nEcVlZ6oGFPjkOALsSvJaYiicOCplsZfFZ2D+2cBsEdvWaZtxe/IZ6SCPloF QTKAFOE2RluqqUvlunXoSPpM8TkP1w1rbMWOpz3VPTFtmCJ5FBm/GFYkK+kjf/Yek5Qr 9ziH75x48WSxiebvjOYKiShJ6XoI1fP2nnzc3TeQAVoZVVOrCtAnWVwpy+CLQ59FplR3 egtQ== 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=yTUgg0W0G9jWjgIj3wVyaf91exB4JINYBe4Wj/AZErU=; fh=vmKIJtcbtoHWhyuxI4oEq8r1SWZ2V9Rrbp1Orw2DxqA=; b=HDF1ImzoJYk0VkVJXs1KNMVUU75NlcX+via4IPmwx6fHTBo8hioj1Rmdq3Nu5AVsbu IY9iTg9r3k7zsP5FucITVzhW9NZqYyVJGoX/5ynBY9wqcaXmj0tN+HMa4e1rC3hNMSH8 32YJKJLL52lJtG3XNCyIHK7xM+CjaIBcdJcDe3PnLH3PJzBKcZLGGct+tt2RYgqbF/WV 9EhcDTv3/IfVJwNFaGx1rVSl18YjCyaEOy+FCrLiC5XRH5cBeO3OHPp4KMzggsrvH3cH N7VUAxbnR+PyQjPF3LHF626nflWrX9m3XiGOJXFdqrRO40kyxJO6M1gcA9bCq6niiNNt ixLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=agUQvFvO; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a170903108400b001bbc63065dfsi7668684pld.568.2023.08.14.03.43.04; Mon, 14 Aug 2023 03:43:20 -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=agUQvFvO; 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 S235252AbjHNIyb (ORCPT + 99 others); Mon, 14 Aug 2023 04:54:31 -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 Content-Type: text/plain; charset=UTF-8 Date: Mon, 14 Aug 2023 10:53:49 +0200 (CEST) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS 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 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; + // 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 @@ -408,7 +408,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"); }