From nobody Wed Apr 1 21:34:12 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A425E1FECA6 for ; Tue, 4 Mar 2025 08:52:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741078369; cv=none; b=qLAGxW0k5D7xWyusY/mkwAZebT9qjDoO52dwzB2EOCYUxEi7d1/oH32xBYkU4UuQqbeVtp+4vxUayAAbo9HWG3AGTM7P8ulMSlT2yDfRh0CNekqb+UQzmC6YAzSRuncGTFmVBtfpNkEh/kpMo7bJzaoUnIJRtkp+WB6D6hLIAuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741078369; c=relaxed/simple; bh=Tmj/cLIyeG6+f+uZ16VKIG/sVwDhoLo8Vqglr6TX98c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LA9vifDXxi1UAxvrpytjibXGIwoowRzsUAMpkhsyUoWzuPm6gUwpl7UHIYxdnlKpvBg+gEhrwq2PrRS1D34dRAt+ICZuZ7kPxlXzEcmgYz9egJ82l2jGt0NiQz2I3Q74bbcsfMX3C4E/1ZTgP+/Rpj83g5E7FYKJClQ4NRx12E8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Xnj8RG68; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=BFom4vVq; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Xnj8RG68"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BFom4vVq" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1741078366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wyMX8soR+fgFHwjHOc5NCrkcv2E7TNoGZkTf9OqgSm4=; b=Xnj8RG68pM6Lfmqt0AXl376Sbv8mDwI62MG8Hw/Ls6hpS9ettgFhHrcqGBiPNpDfznljc+ lqCYq62U1RZBF1sH7LIEBtjmDgk5yVCGfrtLvYTP0oqtzBFQaCS3HeABXWfPmszMaYxi+i 5vtFiH2DJD2sjt+VGzYufzoH7YBxp8qeAolWh3QxAndsQ8go6q+tAgRYfAjpf3JrXMKRQY 5jOh4wfJrdpg608MLRTF0xXjzE8UvPV5FjVM2Oq3FfDIKQcf6NPDVIGn/j/uNQ2XZ4YJdu NY1rGBRXy3tWQ8nQySVPXEj0JBnB4Jcpj0MQUNeTv8KIZ+47Qw180VSvvSsjdw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1741078366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wyMX8soR+fgFHwjHOc5NCrkcv2E7TNoGZkTf9OqgSm4=; b=BFom4vVq9eGlnA1qDBWMLueLbFD8L1M/odxgkol3x6ij1I+XlgnSVjOa670jdm3jT+adza YOvbh7Z2ibRfKBBA== To: Borislav Petkov , Ingo Molnar , Dave Hansen Cc: Thomas Gleixner , John Ogness , "H. Peter Anvin" , Andrew Cooper , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v1 11/40] x86/cacheinfo: Remove the P4 trace leftovers for real Date: Tue, 4 Mar 2025 09:51:22 +0100 Message-ID: <20250304085152.51092-12-darwi@linutronix.de> In-Reply-To: <20250304085152.51092-1-darwi@linutronix.de> References: <20250304085152.51092-1-darwi@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Thomas Gleixner commit 851026a2bf54 ("x86/cacheinfo: Remove unused trace variable") removed the switch case for LVL_TRACE but did not get rid of the surrounding gunk. Signed-off-by: Thomas Gleixner Signed-off-by: Ahmed S. Darwish --- arch/x86/kernel/cpu/cacheinfo.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinf= o.c index a6c6bccfa8b8..eccffe2ea06c 100644 --- a/arch/x86/kernel/cpu/cacheinfo.c +++ b/arch/x86/kernel/cpu/cacheinfo.c @@ -31,7 +31,6 @@ #define LVL_1_DATA 2 #define LVL_2 3 #define LVL_3 4 -#define LVL_TRACE 5 =20 /* Shared last level cache maps */ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map); @@ -96,10 +95,6 @@ static const struct _cache_table cache_table[] =3D { 0x66, LVL_1_DATA, 8 }, /* 4-way set assoc, sectored cache, 64 byte line= size */ { 0x67, LVL_1_DATA, 16 }, /* 4-way set assoc, sectored cache, 64 byte lin= e size */ { 0x68, LVL_1_DATA, 32 }, /* 4-way set assoc, sectored cache, 64 byte lin= e size */ - { 0x70, LVL_TRACE, 12 }, /* 8-way set assoc */ - { 0x71, LVL_TRACE, 16 }, /* 8-way set assoc */ - { 0x72, LVL_TRACE, 32 }, /* 8-way set assoc */ - { 0x73, LVL_TRACE, 64 }, /* 8-way set assoc */ { 0x78, LVL_2, MB(1) }, /* 4-way set assoc, 64 byte line size */ { 0x79, LVL_2, 128 }, /* 8-way set assoc, sectored cache, 64 byte li= ne size */ { 0x7a, LVL_2, 256 }, /* 8-way set assoc, sectored cache, 64 byte li= ne size */ @@ -787,19 +782,13 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c) } } } - /* - * Don't use cpuid2 if cpuid4 is supported. For P4, we use cpuid2 for - * trace cache - */ - if ((!ci->num_leaves || c->x86 =3D=3D 15) && c->cpuid_level > 1) { + + /* Don't use CPUID(2) if CPUID(4) is supported. */ + if (!ci->num_leaves && c->cpuid_level > 1) { /* supports eax=3D2 call */ int j, n; unsigned int regs[4]; unsigned char *dp =3D (unsigned char *)regs; - int only_trace =3D 0; - - if (ci->num_leaves && c->x86 =3D=3D 15) - only_trace =3D 1; =20 /* Number of times to iterate */ n =3D cpuid_eax(2) & 0xFF; @@ -820,8 +809,6 @@ void init_intel_cacheinfo(struct cpuinfo_x86 *c) /* look up this descriptor in the table */ while (cache_table[k].descriptor !=3D 0) { if (cache_table[k].descriptor =3D=3D des) { - if (only_trace && cache_table[k].cache_type !=3D LVL_TRACE) - break; switch (cache_table[k].cache_type) { case LVL_1_INST: l1i +=3D cache_table[k].size; --=20 2.48.1