From nobody Thu Apr 2 20:28:15 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 EDF7B3921D0 for ; Fri, 27 Mar 2026 02:22:28 +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=1774578151; cv=none; b=sZzQUm4LAVZR83paiyjuRY+HseWE50ExaryDlxIhtjfoQhzTjRB1TGIco0lEQT8LoRigUsN9zFzLqv9CaKRbU3/mhDLUPHtbIiRlcBUtH1cVbqq89/Nn+DmbFyf0+ZK6HM2k6cEye66LIFrR0cV7fhtaH5XOLa+wfZLKyYa/Clk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774578151; c=relaxed/simple; bh=NcyHq7OCmwiFaPHG91BMY6vz5YdXWgJNRJb1ugfFLkw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tV5yCSeMjZPaEWtleRbjBhESFI/5ubB8pPL9PPKz3Q1tHu/v6+5kc7IpVCsUC76r97y+5oVXdTLNpxMh5Oif3nXDnTnikmiQFwTH1NzOKwiu9uwAMPdA03IF2RvZZSgLtoPIe5v7TeYVbwP9tTKGFO7hWxq98ZBV+pvqhCjEsRw= 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=CPb6kTPa; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=5s7+3XQZ; 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="CPb6kTPa"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="5s7+3XQZ" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774578147; 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=eVM/2a8qsyfJPHaCxnwzGObirqjcz/jVYuSOKlyUg48=; b=CPb6kTPaRCRNyhGCnUwVoBMYCBSrzurpQjhU412CXiTZXBmQD3OTrW2ZYmKiO/5jmy0QQI DPgpf1+QNzUYhl9ZK/u2f+RzD7J8SbulBn46Hb19fd5+97r8jZl2DBSRiWxwcp2WSxGE0q BJ+usOuJaqDZgVOUrGhT7zOn+J9O6KD/Pw3yJvqNilueLELCBac10ERje1WcpgouSUstxw DiI87r0mxGqC3NbxAqptbk/vla6kPd/2g/6OqpPMTv3OMGPPAqxeGq1u8888+Oh6Mus2cp Tue9//CLBhbOY9SR+7Kcoh54e2V+U1/SHw+qlPAyFnZn56mmvwAohdABvPp1VQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774578147; 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=eVM/2a8qsyfJPHaCxnwzGObirqjcz/jVYuSOKlyUg48=; b=5s7+3XQZ5lwG1Czyfvi+cvMel8m9Wk5SIBWSb2nGgPYY4Pnz057FXbdAZiuh06ERGo6Z6E n1ZCQDNSzBMiWuBg== To: Borislav Petkov , Dave Hansen , Ingo Molnar Cc: Thomas Gleixner , Andrew Cooper , "H. Peter Anvin" , Sean Christopherson , David Woodhouse , Peter Zijlstra , Christian Ludloff , Sohil Mehta , John Ogness , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v6 85/90] x86/cpu: Remove x86_capability[] and x86_power initialization Date: Fri, 27 Mar 2026 03:16:39 +0100 Message-ID: <20260327021645.555257-86-darwi@linutronix.de> In-Reply-To: <20260327021645.555257-1-darwi@linutronix.de> References: <20260327021645.555257-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" X86_FEATURE queries are now routed to the CPUID tables instead of to x86_capability[]. x86_power call sites have all been converted to parsed CPUID(0x80000007) access. Remove all direct CPUID queries which populate x86_capability[] and x86_power. Signed-off-by: Ahmed S. Darwish --- arch/x86/kernel/cpu/common.c | 58 ------------------------------------ 1 file changed, 58 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 98e53f5aa41d..4c2739f31e3d 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1018,70 +1018,12 @@ static void init_speculation_control(struct cpuinfo= _x86 *c) void get_cpu_cap(struct cpuinfo_x86 *c) { const struct leaf_0x80000000_0 *el0; - u32 eax, ebx, ecx, edx; =20 cpuid_scan_cpu(c); =20 - /* Intel-defined flags: level 0x00000001 */ - if (c->cpuid_level >=3D 0x00000001) { - cpuid(0x00000001, &eax, &ebx, &ecx, &edx); - - c->x86_capability[CPUID_1_ECX] =3D ecx; - c->x86_capability[CPUID_1_EDX] =3D edx; - } - - /* Thermal and Power Management Leaf: level 0x00000006 (eax) */ - if (c->cpuid_level >=3D 0x00000006) - c->x86_capability[CPUID_6_EAX] =3D cpuid_eax(0x00000006); - - /* Additional Intel-defined flags: level 0x00000007 */ - if (c->cpuid_level >=3D 0x00000007) { - cpuid_count(0x00000007, 0, &eax, &ebx, &ecx, &edx); - c->x86_capability[CPUID_7_0_EBX] =3D ebx; - c->x86_capability[CPUID_7_ECX] =3D ecx; - c->x86_capability[CPUID_7_EDX] =3D edx; - - /* Check valid sub-leaf index before accessing it */ - if (eax >=3D 1) { - cpuid_count(0x00000007, 1, &eax, &ebx, &ecx, &edx); - c->x86_capability[CPUID_7_1_EAX] =3D eax; - } - } - - /* Extended state features: level 0x0000000d */ - if (c->cpuid_level >=3D 0x0000000d) { - cpuid_count(0x0000000d, 1, &eax, &ebx, &ecx, &edx); - - c->x86_capability[CPUID_D_1_EAX] =3D eax; - } - el0 =3D cpuid_leaf(c, 0x80000000); c->extended_cpuid_level =3D el0 ? el0->max_ext_leaf : 0; =20 - if (c->extended_cpuid_level >=3D 0x80000001) { - cpuid(0x80000001, &eax, &ebx, &ecx, &edx); - - c->x86_capability[CPUID_8000_0001_ECX] =3D ecx; - c->x86_capability[CPUID_8000_0001_EDX] =3D edx; - } - - if (c->extended_cpuid_level >=3D 0x80000007) - c->x86_power =3D cpuid_edx(0x80000007); - - if (c->extended_cpuid_level >=3D 0x80000008) { - cpuid(0x80000008, &eax, &ebx, &ecx, &edx); - c->x86_capability[CPUID_8000_0008_EBX] =3D ebx; - } - - if (c->extended_cpuid_level >=3D 0x8000000a) - c->x86_capability[CPUID_8000_000A_EDX] =3D cpuid_edx(0x8000000a); - - if (c->extended_cpuid_level >=3D 0x8000001f) - c->x86_capability[CPUID_8000_001F_EAX] =3D cpuid_eax(0x8000001f); - - if (c->extended_cpuid_level >=3D 0x80000021) - c->x86_capability[CPUID_8000_0021_EAX] =3D cpuid_eax(0x80000021); - init_scattered_cpuid_features(c); init_speculation_control(c); =20 --=20 2.53.0