mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ahmed S. Darwish" <darwi@linutronix.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	John Ogness <john.ogness@linutronix.de>,
	x86@kernel.org, x86-cpuid@lists.linux.dev,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 19/20] tools/x86/kcpuid: Update bitfields to x86-cpuid-db v2.3
Date: Wed, 19 Mar 2025 12:55:57 +0100	[thread overview]
Message-ID: <Z9qwzVuvV1p6MjRw@lx-t490> (raw)
In-Reply-To: <4BCBA481-AC3A-4A65-B791-235E580286CC@zytor.com>

Hi,

On Wed, 12 Mar 2025, H. Peter Anvin wrote:
>
> On Wed, 12 Mar 2025, "Ahmed S. Darwish" wrote:
> >
> > Update kcpuid's CSV file to version 2.3, as generated by x86-cpuid-db.
> >
> > Summary of the v2.3 changes:
> >
> > * Per H. Peter Anvin's feedback, leaf 0x3 is not unique to Transmeta as
> >   the CSV file earlier claimed.  Since leaf 0x3's format differs between
> >   Intel and Transmeta, and the project does not yet support having the
> >   same CPUID bitfield with varying interpretations across vendors, leaf
> >   0x3 is removed for now.  Given that Intel discontinued support for PSN
> >   from Pentium 4 onward, and Linux force disables it on early boot for
> >   privacy concerns, this should have minimal impact.
> >
> > * Leaf 0x80000021: Make bitfield IDs and descriptions coherent with each
> >   other.  Remove "_support" from bitfield IDs, as no other leaf has such
> >   convention.
> >
> > Reported-by: "H. Peter Anvin" <hpa@zytor.com>
> > Closes: https://lkml.kernel.org/r/C7684E03-36E0-4D58-B6F0-78F4DB82D737@zytor.com
> > Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
> > Link: https://gitlab.com/x86-cpuid.org/x86-cpuid-db/-/blob/v2.3/CHANGELOG.rst
> > ---
>
> As I said, you can simply treat leaf 3 as raw 128-bit hexadecimal
> number; there really isn't a need to "interpret" it since the only
> meaningful use of it is as a unique identifier combined with
> vendor-FMS.

Yes, but this would introduce special-case leaf handing in kcpuid.
So far, the kcpuid code is "dumb".  It just parses the CPUID bitfields
according to what's in the CSV file, with no intrinsic knowledge of any
certain leaf by the C code.

This is why, for example, kcpuid does not print CPU vendor strings in
human readable form.  It just dumps whatever is there in the various
leaves bitfields:

    $ kcpuid --all -l 0
        max_std_leaf        	: 0x16
        cpu_vendorid_0      	: 0x756e6547
        cpu_vendorid_2      	: 0x6c65746e
        cpu_vendorid_1      	: 0x49656e69

    $ kcpuid --all --detail -l 0
    CPUID_0x0_EAX[0x0]:
	max_std_leaf        	: 0x16      	- Highest standard CPUID leaf supported
    CPUID_0x0_EBX[0x0]:
	cpu_vendorid_0      	: 0x756e6547	- CPU vendor ID string bytes 0 - 3
    CPUID_0x0_ECX[0x0]:
	cpu_vendorid_2      	: 0x6c65746e	- CPU vendor ID string bytes 8 - 11
    CPUID_0x0_EDX[0x0]:
	cpu_vendorid_1      	: 0x49656e69	- CPU vendor ID string bytes 4 - 7

We can extend kcpuid to handle a special case for the PSN, but if we
gonna do that, then it would be much better to start that with CPUID
leaves that actually matter: CPU vendor strings, leaf 0x2 1-byte
descriptor semantics, etc., etc.

Given all that, can we please move on regarding this leaf 0x3PSN thing?
IMHO, there's no reason to block the series because of that :(

Thanks!

--
Ahmed S. Darwish
Linutronix GmbH

  reply	other threads:[~2025-03-19 11:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 14:37 [PATCH v2 00/20] tools/x86/kcpuid: x86-cpuid-db v2.3 update Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 01/20] tools/x86/kcpuid: Fix error handling Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 02/20] tools/x86/kcpuid: Exit the program on invalid parameters Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 03/20] tools/x86/kcpuid: Simplify usage() handling Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 04/20] tools/x86/kcpuid: Save CPUID output in an array Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 05/20] tools/x86/kcpuid: Print correct CPUID output register names Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 06/20] tools/x86/kcpuid: Remove unused local variable Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 07/20] tools/x86/kcpuid: Remove unused global variable Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 08/20] tools/x86/kcpuid: Set function return type to void Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 09/20] tools/x86/kcpuid: Use C99-style for loops Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 10/20] tools/x86/kcpuid: Use <cpuid.h> intrinsics Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 11/20] tools/x86/kcpuid: Refactor CPUID range handling for future expansion Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 12/20] tools/x86/kcpuid: Extend CPUID index mask macro Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 13/20] tools/x86/kcpuid: Consolidate index validity checks Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 14/20] tools/x86/kcpuid: Filter valid CPUID ranges Ahmed S. Darwish
2025-03-12 15:18   ` Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 15/20] tools/x86/kcpuid: Define Transmeta and Centaur index ranges Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 16/20] tools/x86/kcpuid: Update bitfields to x86-cpuid-db v2.0 Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 17/20] tools/x86/kcpuid: Update bitfields to x86-cpuid-db v2.1 Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 18/20] tools/x86/kcpuid: Update bitfields to x86-cpuid-db v2.2 Ahmed S. Darwish
2025-03-12 14:37 ` [PATCH v2 19/20] tools/x86/kcpuid: Update bitfields to x86-cpuid-db v2.3 Ahmed S. Darwish
2025-03-12 19:54   ` H. Peter Anvin
2025-03-19 11:55     ` Ahmed S. Darwish [this message]
2025-03-12 14:37 ` [PATCH v2 20/20] MAINTAINERS: Include kcpuid under X86 CPUID DATABASE Ahmed S. Darwish

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=Z9qwzVuvV1p6MjRw@lx-t490 \
    --to=darwi@linutronix.de \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86-cpuid@lists.linux.dev \
    --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

all inboxes | Powered by JetHome®