[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 9 Oct 2020 20:14:50 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, x86@...nel.org,
Borislav Petkov <bp@...e.de>, Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Tony Luck <tony.luck@...el.com>,
Len Brown <len.brown@...el.com>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>,
Dave Hansen <dave.hansen@...el.com>,
"Gautham R. Shenoy" <ego@...ux.vnet.ibm.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Subject: Re: [PATCH 1/4] drivers core: Introduce CPU type sysfs interface
On 10/5/20 6:15 PM, Ricardo Neri wrote:
> On Fri, Oct 02, 2020 at 08:27:41PM -0700, Randy Dunlap wrote:
>> On 10/2/20 6:17 PM, Ricardo Neri wrote:
>>> +/**
>>> + * arch_get_cpu_type() - Get the CPU type number
>>> + * @cpu: Index of the CPU of which the index is needed
>>> + *
>>> + * Get the CPU type number of @cpu, a non-zero unsigned 32-bit number that
>
> Thank you for your feedback Randy!
>
>> Are you sure that @cpu is non-zero?
>
> This is the intent. Maybe it can be reworked to return -EINVAL instead?
> I gues it is plausible but less likely that an arch defines a type as
> 0xffffffea;
You lost me here.
>>
>>> + * uniquely identifies a type of CPU micro-architecture. All CPUs of the same
>>> + * type have the same type number. Type numbers are defined by each CPU
>>> + * architecture.
>>> + */
>>> +u32 __weak arch_get_cpu_type(int cpu)
>>> +{
>>> + return 0;
>>> +}
>>
>> arch_get_cpu_type() in patch 4/4 allows @cpu to be 0.
>
> It should not return 0 if the system does not have
> X86_FEATURE_HYBRID_CPU. The currently existing CPU types are all
> non-zero as per the Intel SDM. Am I missing anything?
@cpu is a cpu index, not a cpu type.
--
~Randy
Powered by blists - more mailing lists