All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Dave Hansen <dave.hansen@intel.com>, Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>, "H . Peter Anvin" <hpa@zytor.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	"Gautham R . Shenoy" <gautham.shenoy@amd.com>,
	Perry Yuan <perry.yuan@amd.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Li RongQing <lirongqing@baidu.com>,
	"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<linux-kernel@vger.kernel.org>,
	"open list:ACPI" <linux-acpi@vger.kernel.org>,
	"open list:AMD PSTATE DRIVER" <linux-pm@vger.kernel.org>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Subject: Re: [PATCH v2 4/5] x86/cpu: Add CPU type to struct cpuinfo_topology
Date: Tue, 22 Oct 2024 11:13:00 -0500	[thread overview]
Message-ID: <13fd2271-f64e-4573-afdb-9881b8c399fe@amd.com> (raw)
In-Reply-To: <4476c7a5-bc48-4686-b815-3fae0838b7f9@intel.com>

On 10/22/2024 11:03, Dave Hansen wrote:
> On 10/22/24 04:57, Borislav Petkov wrote:
>> +enum x86_topology_cpu_type get_intel_cpu_type(struct cpuinfo_x86 *c)
>> +{
>> +	switch (c->topo.intel_type) {
>> +	case 0x20: return TOPO_CPU_TYPE_EFFICIENCY;
>> +	case 0x40: return TOPO_CPU_TYPE_PERFORMANCE;
>> +	}
>> +	return TOPO_CPU_TYPE_UNKNOWN;
>> +}
> 
> This makes me feel a _bit_ uneasy.  0x20 here really does mean "Atom
> microarchitecture" and 0x40 means "Core microarchitecture".
> 
> We want to encourage folks to use this new ABI when they want to find
> the fastest core to run on.  But we don't want them to use it to bind to
> a CPU and then deploy Atom-specific optimizations.
> 
> We *also* don't want the in-kernel code to do be doing things like:
> 
> 	if (get_intel_cpu_type() == TOPO_CPU_TYPE_EFFICIENCY)
> 		setup_force_cpu_bug(FOO);
> 
> That would fall over if Intel ever mixed fast and slow core types with
> the same microarchitecture, which is what AMD is doing today.
> 
> Having:
> 
> 	TOPO_CPU_TYPE_EFFICIENCY, and
> 	TOPO_CPU_TYPE_PERFORMANCE
> 
> is totally fine in generic code.  But we also need to preserve the:
> 
> 	TOPO_HW_CPU_TYPE_INTEL_ATOM
> 	TOPO_HW_CPU_TYPE_INTEL_CORE
> 
> values also for use in vendor-specific code.

What you're suggesting is to keep an enum in the intel.c code and any 
code that needs to match atom vs core can directly use

c->topo.intel_type == TOPO_HW_CPU_TYPE_INTEL_ATOM

Right?

> 
> In the ABI, I think we should probably make this an explicit
> power/performance interface rather than "cpu_type".  As much as I like
> the human readable "performance" and "efficiency", I'm worried it won't
> be flexible enough for future maniacal hardware designers.  To be 100%
> clear, all the hardware designs that I know of would fit in a two-bucket
> ("performance" and "efficiency") scheme.  But we've got to decide
> whether to commit to that forever.

As it stands today none of this is exported anywhere but debugfs; so I 
wouldn't say we have ABI concerns (yet).  Could we wait until the one 
that breaks the mold shows up?

  reply	other threads:[~2024-10-22 16:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22  3:46 [PATCH v2 0/5] x86 Heterogeneous design identification Mario Limonciello
2024-10-22  3:46 ` [PATCH v2 1/5] x86/cpufeatures: Rename X86_FEATURE_FAST_CPPC to have AMD prefix Mario Limonciello
2024-10-22  3:46 ` [PATCH v2 2/5] x86/cpufeatures: Add feature bits for AMD heterogeneous processor Mario Limonciello
2024-10-22  3:46 ` [PATCH v2 3/5] x86/cpu: Enable SD_ASYM_PACKING for PKG Domain on AMD Processors Mario Limonciello
2024-10-22  9:20   ` Gautham R. Shenoy
2024-10-22  3:46 ` [PATCH v2 4/5] x86/cpu: Add CPU type to struct cpuinfo_topology Mario Limonciello
2024-10-22 11:57   ` Borislav Petkov
2024-10-22 12:03     ` Borislav Petkov
2024-10-22 15:41       ` Mario Limonciello
2024-10-22 16:03     ` Dave Hansen
2024-10-22 16:13       ` Mario Limonciello [this message]
2024-10-22 17:09         ` Dave Hansen
2024-10-23  3:58         ` Pawan Gupta
2024-10-23  4:40     ` Pawan Gupta
2024-10-23 15:59       ` Borislav Petkov
2024-10-22  3:46 ` [PATCH v2 5/5] x86/amd: Use heterogeneous core topology for identifying boost numerator Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13fd2271-f64e-4573-afdb-9881b8c399fe@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=gautham.shenoy@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=perry.yuan@amd.com \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.