From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>, Thomas Gleixner <tglx@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
"H . Peter Anvin" <hpa@zytor.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
linux-kernel@vger.kernel.org, x86@kernel.org,
bpf@vger.kernel.org, kasan-dev@googlegroups.com,
linux-mm@kvack.org, kernel-team@meta.com
Subject: [PATCH v3 3/5] x86/cpu: Inline generic_identify() into identify_cpu()
Date: Wed, 16 Sep 2026 12:52:01 -0700 [thread overview]
Message-ID: <20260916195203.1099646-4-ihor.solodrai@linux.dev> (raw)
In-Reply-To: <20260916195203.1099646-1-ihor.solodrai@linux.dev>
generic_identify() has exactly one call site: at the top of
identify_cpu(). Fold it into identify_cpu() so that a single function
does the job for both the boot CPU and the secondary CPUs.
While at it, fix up both copies of the Cyrix comment.
No functional changes.
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
---
arch/x86/kernel/cpu/common.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 66695addbdf3..2b2a4c40ef76 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1825,7 +1825,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
if (!cpuid_feature())
identify_cpu_without_cpuid(c);
- /* cyrix could have cpuid enabled via c_identify()*/
+ /* Cyrix could have CPUID enabled via c_identify(). */
if (cpuid_feature()) {
cpuid_scan_cpu(c);
cpu_detect(c);
@@ -1989,14 +1989,23 @@ void check_null_seg_clears_base(struct cpuinfo_x86 *c)
set_cpu_bug(c, X86_BUG_NULL_SEG);
}
-static void generic_identify(struct cpuinfo_x86 *c)
+/*
+ * This does the hard work of actually picking apart the CPU stuff...
+ */
+static void identify_cpu(struct cpuinfo_x86 *c)
{
+ int i;
+
+ c->loops_per_jiffy = loops_per_jiffy;
+
+ init_cpu_info(c);
+
if (!cpuid_feature())
identify_cpu_without_cpuid(c);
- /* cyrix could have cpuid enabled via c_identify()*/
+ /* Cyrix could have CPUID enabled via c_identify(). */
if (!cpuid_feature())
- return;
+ goto no_cpuid;
cpuid_scan_cpu(c);
cpu_detect(c);
@@ -2024,21 +2033,8 @@ static void generic_identify(struct cpuinfo_x86 *c)
#ifdef CONFIG_X86_32
set_cpu_bug(c, X86_BUG_ESPFIX);
#endif
-}
-
-/*
- * This does the hard work of actually picking apart the CPU stuff...
- */
-static void identify_cpu(struct cpuinfo_x86 *c)
-{
- int i;
-
- c->loops_per_jiffy = loops_per_jiffy;
-
- init_cpu_info(c);
-
- generic_identify(c);
+no_cpuid:
cpu_parse_topology(c);
if (this_cpu->c_identify)
--
2.55.0
next prev parent reply other threads:[~2026-09-16 19:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 19:51 [PATCH v3 0/5] x86/cpu: Refactor identify_cpu() Ihor Solodrai
2026-09-16 19:51 ` [PATCH v3 1/5] x86/cpu: Factor init_cpu_info() out of identify_cpu() Ihor Solodrai
2026-09-17 23:49 ` bot+bpf-ci
2026-09-16 19:52 ` [PATCH v3 2/5] x86/cpu: Initialize boot CPU cpuinfo defaults early Ihor Solodrai
2026-09-17 23:49 ` bot+bpf-ci
2026-09-16 19:52 ` Ihor Solodrai [this message]
2026-09-17 23:49 ` [PATCH v3 3/5] x86/cpu: Inline generic_identify() into identify_cpu() bot+bpf-ci
2026-09-16 19:52 ` [PATCH v3 4/5] x86/cpu: Move 32-bit SEP setup " Ihor Solodrai
2026-09-17 23:49 ` bot+bpf-ci
2026-09-16 19:52 ` [PATCH v3 5/5] x86/cpu: Don't transiently clear the boot CPU's capabilities Ihor Solodrai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260916195203.1099646-4-ihor.solodrai@linux.dev \
--to=ihor.solodrai@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bp@alien8.de \
--cc=bpf@vger.kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kasan-dev@googlegroups.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=ryabinin.a.a@gmail.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.