[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240124201258.GVZbFvSiaMkKbU3goX@fat_crate.local>
Date: Wed, 24 Jan 2024 21:12:58 +0100
From: Borislav Petkov <bp@...en8.de>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Tom Lendacky <thomas.lendacky@....com>,
Andrew Cooper <andrew.cooper3@...rix.com>,
Arjan van de Ven <arjan@...ux.intel.com>,
Huang Rui <ray.huang@....com>, Juergen Gross <jgross@...e.com>,
Dimitri Sivanich <dimitri.sivanich@....com>,
Sohil Mehta <sohil.mehta@...el.com>,
K Prateek Nayak <kprateek.nayak@....com>,
Kan Liang <kan.liang@...ux.intel.com>,
Zhang Rui <rui.zhang@...el.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Feng Tang <feng.tang@...el.com>,
Andy Shevchenko <andy@...radead.org>,
Michael Kelley <mhklinux@...look.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>
Subject: Re: [patch v5 03/19] x86/cpu: Add legacy topology parser
On Tue, Jan 23, 2024 at 01:53:34PM +0100, Thomas Gleixner wrote:
> From: Thomas Gleixner <tglx@...utronix.de>
>
> The legacy topology detection via CPUID leaf 4, which provides the number
> of cores in the package and CPUID leaf 1 which provides the number of
> logical CPUs in case that FEATURE_HT is enabled and the CMP_LEGACY feature
> is not set, is shared for Intel, Centaur amd Zhaoxin CPUs.
^^^
x86 maintainer Freudian slip. :-P
Happens to me too.
> Lift the code from common.c without the early detection hack and provide it
> as common fallback mechanism.
>
> Will be utilized in later changes.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Tested-by: Juergen Gross <jgross@...e.com>
> Tested-by: Sohil Mehta <sohil.mehta@...el.com>
> Tested-by: Michael Kelley <mhklinux@...look.com>
>
>
> ---
> arch/x86/kernel/cpu/common.c | 3 ++
> arch/x86/kernel/cpu/topology.h | 3 ++
> arch/x86/kernel/cpu/topology_common.c | 46 +++++++++++++++++++++++++++++++++-
> 3 files changed, 51 insertions(+), 1 deletion(-)
> ---
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -891,6 +891,9 @@ void detect_ht(struct cpuinfo_x86 *c)
> #ifdef CONFIG_SMP
> int index_msb, core_bits;
>
> + if (topo_is_converted(c))
> + return;
> +
> if (detect_ht_early(c) < 0)
> return;
>
> --- a/arch/x86/kernel/cpu/topology.h
> +++ b/arch/x86/kernel/cpu/topology.h
> @@ -6,6 +6,9 @@ struct topo_scan {
> struct cpuinfo_x86 *c;
> unsigned int dom_shifts[TOPO_MAX_DOMAIN];
> unsigned int dom_ncpus[TOPO_MAX_DOMAIN];
> +
> + // Legacy CPUID[1]:EBX[23:16] number of logical processors
Can we pretty please use the good 'ol multi-line comment style and not
turn tip into a mess with a mixture between single-line and multi-line
comments?
Thanks.
> + unsigned int ebx1_nproc_shift;
> };
>
> bool topo_is_converted(struct cpuinfo_x86 *c);
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists