From: Thomas Gleixner <tglx@kernel.org>
To: Borislav Petkov <bp@alien8.de>,
Vishal Badole <Vishal.Badole@amd.com>,
dave.hansen@linux.intel.com
Cc: mingo@redhat.com, x86@kernel.org, hpa@zytor.com,
rafael@kernel.org, lenb@kernel.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, peterz@infradead.org,
tony.luck@intel.com, chang.seok.bae@intel.com,
wei.w.wang@hotmail.com
Subject: Re: [PATCH 1/2] x86/topology: Name the AMD core-type values
Date: Fri, 03 Jul 2026 00:06:32 +0200 [thread overview]
Message-ID: <8733y1nj13.ffs@fw13> (raw)
In-Reply-To: <20260702002704.GGakWwWMHxbRnSsfiO@fat_crate.local>
On Wed, Jul 01 2026 at 17:27, Borislav Petkov wrote:
> On Mon, Jun 29, 2026 at 03:13:48PM +0530, Vishal Badole wrote:
> And it does make sense to me - x86_match_vendor_cpu_type() is supposed to
> receive the *hardware* defined CPU type - not the generic ones. And I think
> that was a mistake because the value 0 on AMD means a performance core type
> but in the kernel we called it X86_CPU_TYPE_ANY. Which is also not surprising
> - all our ANY types are 0.
>
> Now, one fix would be if we define X86_CPU_TYPE_ANY as 0xff and hope that
> Intel will never define it.
>
> On AMD that value is guaranteed to be invalid because the core type field is
> only 4 bits.
>
> But it can happen that one vendor's core type field can match another core
> type of the other vendor. Which would mean that we cannot use X86_VENDOR_ANY
> in any of the match_id tables when using a core type.
>
> Or, we do the proper fix and we map all vendor core types to the kernel's,
> vendor-agnostic TOPO_CPU_TYPE_* enums and then we're all good - we'd only need
> to convert the vendor ones to the generic ones on comparison but we do that
> anyway.
Just do the mapping to vendor-agnostic types _once_ when you enumerate the CPU
and store that information in the per CPU data.
Then you can do proper vendor agnostic matching against that and define
the TYPE_ANY value as you want without ever colliding with vendor
muck.
As a bonus get_topology_cpu_type() goes away too as the translation has
been done already.
Thanks,
tglx
next prev parent reply other threads:[~2026-07-02 22:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 9:43 [PATCH 0/2] x86/topology: Add support for Low Power cpu_type Vishal Badole
2026-06-29 9:43 ` [PATCH 1/2] x86/topology: Name the AMD core-type values Vishal Badole
2026-07-02 0:27 ` Borislav Petkov
2026-07-02 22:06 ` Thomas Gleixner [this message]
2026-07-02 23:03 ` Borislav Petkov
2026-07-03 19:32 ` Borislav Petkov
2026-07-03 19:39 ` Thomas Gleixner
2026-06-29 9:43 ` [PATCH 2/2] x86/topology: Add TOPO_CPU_TYPE_LOW_POWER Vishal Badole
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=8733y1nj13.ffs@fw13 \
--to=tglx@kernel.org \
--cc=Vishal.Badole@amd.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=tony.luck@intel.com \
--cc=wei.w.wang@hotmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox