[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b9518f5-8b92-1c24-286c-47bf9e8b8a2e@intel.com>
Date: Tue, 15 Aug 2023 14:15:53 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>
Cc: 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>,
Michael Kelley <mikelley@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Pu Wen <puwen@...on.cn>,
Qiuxu Zhuo <qiuxu.zhuo@...el.com>,
Sohil Mehta <sohil.mehta@...el.com>
Subject: Re: [patch V4 02/41] cpu/SMT: Make SMT control more robust against
enumeration failures
On 8/14/23 01:53, Thomas Gleixner wrote:
> -static inline bool cpu_smt_allowed(unsigned int cpu)
> +static inline bool cpu_bootable(unsigned int cpu)
> {
> if (cpu_smt_control == CPU_SMT_ENABLED)
> return true;
>
> + if (cpu_smt_control == CPU_SMT_NOT_SUPPORTED)
> + return true;
I found this new pair of if()'s rather counterintuitive to read.
The first one reads like:
"If SMT is not supported, the CPU is always bootable"
but "supported" could easily mean CONFIG_SMP==n (which is actually
covered in the next case). Would this be better named:
CPU_SMT_NOT_ENUMERATED
or
CPU_SMT_NOT_DETECTED
?
/* Every CPU is bootable on non-SMT systems: */
if (cpu_smt_control == CPU_SMT_NOT_DETECTED)
return true;
For the next one:
> + if (cpu_smt_control == CPU_SMT_NOT_IMPLEMENTED)
> + return true;
This reads a bit like "SMT is not implemented" rather than "SMT controls
are not implemented". Maybe a comment would help:
/* All CPUs are bootable if controls are not implemented: */
Powered by blists - more mailing lists