From nobody Fri Oct 2 03:38:05 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 9BF713E00B4; Wed, 5 Aug 2026 15:03:21 +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=1785942204; cv=none; b=eH9xAo4G5ZQxS4HgQoawfBzVqAGIkgXdPcGzgbd6M59KFDw5h3mbgFQbWL060wIvn3W1TsrIiE52EcV3jDHcylghk9O33D6N696dYvlbyTklR6CJtd6OJ1OASFz+zoGnZ19wX1QW7D+YjIGfm+g4a/9mTAELNBZJozYYxC4NVfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785942204; c=relaxed/simple; bh=fwLJtPGPKQjNLAZpItooSTLXJrLuKdJNjFhdlKEPK7o=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=sXr6fz0/TKck6K3DrKAq4kj4UiQ3jBFCF5WG0ufqqcLLi8XNRriyCI1IS9itfEJ2yR7k4vy3GT3TSa9j5HOKzHqJFuSauJRF+E6G7WM4dbybkWNHce5qyB2cIFq50cMC7rAgOLQwA1comB08u/Cl8tN/ebY9VplZMEa1JBw2xFA= 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=mZybZnCW; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wqxvKiZW; 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="mZybZnCW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wqxvKiZW" Date: Wed, 05 Aug 2026 15:03:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1785942199; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Qovzu0Vm05EvWGWRc0zTrLaUkUiuJDBX+Tbl4mBSGg=; b=mZybZnCWxFQCZu3gm7syZrDqTZ/7RzFkiHK4JHOyhwegNhQxzW1JvDA1ChhMDgh492RycH t2qMuYMLtUTjPyh9x6sV2CW2Kto/ZZ1wjxirAhPrz/oXQ5xOem4y0NroUsYkcV05H2hvls 1iWuyX3XuVA25RG0Ltciry5MvrbRUgXcP/UNvFrzouYqg5obY6ruiOMFVv7Skh1uCQi+Fj iQI0UqWcJE7h4BO2YSDFomQ0iwz5xS+lw0408wlAs9oX1GnSMFWas1wRT/M4yrhyHfA+yj zAIBZcM7wpyCJxs9zLRUqpYQ8Z0gi9aMw8eRI/+XneljahEz7pgHQXmmER4bAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1785942199; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Qovzu0Vm05EvWGWRc0zTrLaUkUiuJDBX+Tbl4mBSGg=; b=wqxvKiZWoYJHzbevzFzIiE1n2PBQDt0H7EfOwwqx9vJU7uMw85jvDX6wgeHCGxnESP+vFN C7Bsj8sWC4DY5WCA== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/CPU: Rename struct cpuid_read_output to struct cpuid_output Cc: "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178594219742.708.922147445545785722.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 6cc3a72caa6eb118c38f887d4608b9adb80e90e8 Gitweb: https://git.kernel.org/tip/6cc3a72caa6eb118c38f887d4608b9adb= 80e90e8 Author: Borislav Petkov (AMD) AuthorDate: Tue, 04 Aug 2026 18:53:41 -07:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 05 Aug 2026 07:40:33 -07:00 x86/CPU: Rename struct cpuid_read_output to struct cpuid_output There's no CPUID "write" operation so there's no need to have a cpuid_read_output thing - cpuid_output is perfectly clear. And shortens the code just fine. Remove the funky function signature line breaks while at it. No functional changes. Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20260805025323.GCanKlox0DF7Gwhpf1@fat_crate= .local --- arch/x86/kernel/cpu/cpuid_parser.c | 42 +++++++++++++---------------- arch/x86/kernel/cpu/cpuid_parser.h | 20 +++++++------- 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/arch/x86/kernel/cpu/cpuid_parser.c b/arch/x86/kernel/cpu/cpuid= _parser.c index 898b0c4..dcf8fff 100644 --- a/arch/x86/kernel/cpu/cpuid_parser.c +++ b/arch/x86/kernel/cpu/cpuid_parser.c @@ -11,14 +11,14 @@ #include "cpuid_parser.h" =20 /* Clear a single CPUID table entry */ -static void cpuid_clear(const struct cpuid_parse_entry *e, const struct cp= uid_read_output *output) +static void cpuid_clear(const struct cpuid_parse_entry *e, const struct cp= uid_output *out) { - struct cpuid_regs *regs =3D output->regs; + struct cpuid_regs *regs =3D out->regs; =20 for (int i =3D 0; i < e->maxcnt; i++, regs++) memset(regs, 0, sizeof(*regs)); =20 - memset(output->info, 0, sizeof(*output->info)); + memset(out->info, 0, sizeof(*out->info)); } =20 /* @@ -29,12 +29,11 @@ static void cpuid_clear(const struct cpuid_parse_entry = *e, const struct cpuid_re * Default CPUID read function * Satisfies the requirements stated at 'struct cpuid_parse_entry'->read(). */ -static void -cpuid_read_generic(const struct cpuid_parse_entry *e, const struct cpuid_r= ead_output *output) +static void cpuid_read_generic(const struct cpuid_parse_entry *e, const st= ruct cpuid_output *out) { - struct cpuid_regs *regs =3D output->regs; + struct cpuid_regs *regs =3D out->regs; =20 - for (int i =3D 0; i < e->maxcnt; i++, regs++, output->info->nr_entries++) + for (int i =3D 0; i < e->maxcnt; i++, regs++, out->info->nr_entries++) cpuid_read_subleaf(e->leaf, e->subleaf + i, regs); } =20 @@ -60,15 +59,14 @@ static unsigned int cpuid_range_max_leaf(const struct c= puid_table *t, unsigned i } } =20 -static void -__cpuid_reset_table(struct cpuid_table *t, const struct cpuid_parse_entry = entries[], - unsigned int nr_entries, unsigned int start, unsigned int end, bool = fill) +static void __cpuid_reset_table(struct cpuid_table *t, const struct cpuid_= parse_entry entries[], + unsigned int nr_entries, unsigned int start, unsigned int end, bool fi= ll) { const struct cpuid_parse_entry *entry =3D entries; unsigned int range =3D CPUID_RANGE(start); =20 for (unsigned int i =3D 0; i < nr_entries; i++, entry++) { - struct cpuid_read_output output =3D { + struct cpuid_output out =3D { .regs =3D cpuid_table_regs_p(t, entry->regs_offs), .info =3D cpuid_table_info_p(t, entry->info_offs), }; @@ -76,14 +74,14 @@ __cpuid_reset_table(struct cpuid_table *t, const struct= cpuid_parse_entry entrie if (entry->leaf < start || entry->leaf > end) continue; =20 - cpuid_clear(entry, &output); + cpuid_clear(entry, &out); =20 /* * Read the range's anchor leaf unconditionally so that the cached * maximum valid leaf value is available for the remaining entries. */ if (fill && (entry->leaf =3D=3D range || entry->leaf <=3D cpuid_range_ma= x_leaf(t, range))) - entry->read(entry, &output); + entry->read(entry, &out); } } =20 @@ -91,22 +89,20 @@ __cpuid_reset_table(struct cpuid_table *t, const struct= cpuid_parse_entry entrie * Zero all cached CPUID entries within [@start-@end] range. This is need= ed when * certain operations like MSR writes induce changes to the CPU's CPUID la= yout. */ -static void -__cpuid_zero_table(struct cpuid_table *t, const struct cpuid_parse_entry e= ntries[], - unsigned int nr_entries, unsigned int start, unsigned int end) +static void __cpuid_zero_table(struct cpuid_table *t, const struct cpuid_p= arse_entry entries[], + unsigned int nr_entries, unsigned int start, unsigned int end) { __cpuid_reset_table(t, entries, nr_entries, start, end, false); } =20 -static void -__cpuid_fill_table(struct cpuid_table *t, const struct cpuid_parse_entry e= ntries[], - unsigned int nr_entries, unsigned int start, unsigned int end) +static void __cpuid_fill_table(struct cpuid_table *t, const struct cpuid_p= arse_entry entries[], + unsigned int nr_entries, unsigned int start, unsigned int end) { __cpuid_reset_table(t, entries, nr_entries, start, end, true); } =20 -static void -cpuid_fill_table(struct cpuid_table *t, const struct cpuid_parse_entry ent= ries[], unsigned int nr_entries) +static void cpuid_fill_table(struct cpuid_table *t, const struct cpuid_par= se_entry entries[], + unsigned int nr_entries) { static const struct { unsigned int start; @@ -127,8 +123,8 @@ static void __cpuid_scan_cpu_full(struct cpuinfo_x86 *c) cpuid_fill_table(table, cpuid_parse_entries, nr_entries); } =20 -static void -__cpuid_scan_cpu_partial(struct cpuinfo_x86 *c, unsigned int start_leaf, u= nsigned int end_leaf) +static void __cpuid_scan_cpu_partial(struct cpuinfo_x86 *c, unsigned int s= tart_leaf, + unsigned int end_leaf) { unsigned int nr_entries =3D ARRAY_SIZE(cpuid_parse_entries); struct cpuid_table *table =3D &c->cpuid; diff --git a/arch/x86/kernel/cpu/cpuid_parser.h b/arch/x86/kernel/cpu/cpuid= _parser.h index df62730..3d83373 100644 --- a/arch/x86/kernel/cpu/cpuid_parser.h +++ b/arch/x86/kernel/cpu/cpuid_parser.h @@ -35,21 +35,21 @@ * Translation of compile time offsets to generic runtime pointers: */ =20 -static inline struct cpuid_regs * -cpuid_table_regs_p(const struct cpuid_table *t, unsigned long regs_offset) +static inline struct cpuid_regs *cpuid_table_regs_p(const struct cpuid_tab= le *t, + unsigned long regs_offset) { return (struct cpuid_regs *)((unsigned long)(&t->leaves) + regs_offset); } =20 -static inline struct leaf_parse_info * -cpuid_table_info_p(const struct cpuid_table *t, unsigned long info_offset) +static inline struct leaf_parse_info *cpuid_table_info_p(const struct cpui= d_table *t, + unsigned long info_offset) { return (struct leaf_parse_info *)((unsigned long)(&t->leaves) + info_offs= et); } =20 /** - * struct cpuid_read_output - Output of a CPUID read operation - * @regs: Pointer to an array of CPUID outputs, where each array element c= overs the + * struct cpuid_output - Output of a CPUID operation + * @regs: Pointer to an array of CPUID results, where each array element c= overs the * full EAX->EDX output range. * @info: Pointer to query info; for saving the number of filled elements = at @regs. * @@ -59,7 +59,7 @@ cpuid_table_info_p(const struct cpuid_table *t, unsigned = long info_offset) * * See struct cpuid_parse_entry.read(). */ -struct cpuid_read_output { +struct cpuid_output { struct cpuid_regs *regs; struct leaf_parse_info *info; }; @@ -74,8 +74,8 @@ struct cpuid_read_output { * passed to cpuid_table_info_p(). * @maxcnt: Maximum number of output storage entries available for the CPU= ID query. * @read: Read function for this entry. It must save the parsed CPUID out= put to the passed - * 'struct cpuid_read_output'->regs array of size >=3D @maxcnt. It must = set - * 'struct cpuid_read_output'->info.nr_entries to the number of CPUID out= put entries + * 'struct cpuid_output'->regs array of size >=3D @maxcnt. It must set + * 'struct cpuid_output'->info.nr_entries to the number of CPUID output e= ntries * parsed and filled. A generic implementation is provided at cpuid_read= _generic(). */ struct cpuid_parse_entry { @@ -84,7 +84,7 @@ struct cpuid_parse_entry { unsigned int regs_offs; unsigned int info_offs; unsigned int maxcnt; - void (*read)(const struct cpuid_parse_entry *e, const struct cpuid_read_= output *o); + void (*read)(const struct cpuid_parse_entry *e, const struct cpuid_outpu= t *o); }; =20 #define __CPUID_PARSE_ENTRY(_leaf, _subleaf, _suffix, _reader_fn) \