[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <29c7b5b9-3a27-4b3c-85af-e08287944a00@amd.com>
Date: Tue, 22 Oct 2024 10:41:13 -0500
From: Mario Limonciello <mario.limonciello@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
"H . Peter Anvin" <hpa@...or.com>, "Rafael J . Wysocki" <rafael@...nel.org>,
"Gautham R . Shenoy" <gautham.shenoy@....com>,
Perry Yuan <perry.yuan@....com>, Brijesh Singh <brijesh.singh@....com>,
Peter Zijlstra <peterz@...radead.org>, Li RongQing <lirongqing@...du.com>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<linux-kernel@...r.kernel.org>, "open list:ACPI"
<linux-acpi@...r.kernel.org>,
"open list:AMD PSTATE DRIVER" <linux-pm@...r.kernel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
Subject: Re: [PATCH v2 4/5] x86/cpu: Add CPU type to struct cpuinfo_topology
On 10/22/2024 07:03, Borislav Petkov wrote:
> On Tue, Oct 22, 2024 at 01:57:20PM +0200, Borislav Petkov wrote:
>> diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/topology_common.c
>> index 9a6069e7133c..38220b64c6b3 100644
>> --- a/arch/x86/kernel/cpu/topology_common.c
>> +++ b/arch/x86/kernel/cpu/topology_common.c
>> @@ -27,6 +27,23 @@ void topology_set_dom(struct topo_scan *tscan, enum x86_topology_domains dom,
>> }
>> }
>>
>> +const char *get_topology_cpu_type_name(struct cpuinfo_x86 *c)
>> +{
>> + enum x86_topology_cpu_type type;
>> +
>> + if (c->x86_vendor == X86_VENDOR_INTEL)
>> + type = get_intel_cpu_type(c);
>> + if (c->x86_vendor == X86_VENDOR_AMD)
>> + type = get_amd_cpu_type(c);
>> +
>> + if (type == TOPO_CPU_TYPE_PERFORMANCE)
>> + return "performance";
>> + else if (type == TOPO_CPU_TYPE_EFFICIENCY)
>> + return "efficiency";
>> + else
>> + return "unknown";
>> +}
>
> I guess you still need topology_cpu_type() in your next patch but that's easy
> - you simply call it in get_topology_cpu_type_name().
>
> The point being debugfs will dump the name of the core type and not some magic
> number which no one knows.
Yeah; makes sense. I'll pull your suggestions in.
Powered by blists - more mailing lists