From: Borislav Petkov <bp@alien8.de>
To: Feng Tang <feng.tang@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Dave Hansen <dave.hansen@intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2] tools/x86: add kcpuid tool to show raw CPU features
Date: Fri, 25 Sep 2020 19:24:37 +0200 [thread overview]
Message-ID: <20200925172437.GM16872@zn.tnic> (raw)
In-Reply-To: <1600752470-43179-1-git-send-email-feng.tang@intel.com>
On Tue, Sep 22, 2020 at 01:27:50PM +0800, Feng Tang wrote:
> +++ b/tools/arch/x86/kcpuid/cpuid.txt
> @@ -0,0 +1,58 @@
> +# Leaf 00H
> +
> +LEAF[00000000],SUBLEAF[00],EAX[ 31:0],max_basic_leafs, Max input value for supported subleafs
> +
> +
> +# Leaf 01H
> +
> +LEAF[00000001],SUBLEAF[00],EAX[ 3:0],stepping, Stepping ID
> +LEAF[00000001],SUBLEAF[00],EAX[ 7:4],model, Model
> +LEAF[00000001],SUBLEAF[00],EAX[ 11:8],family, Family ID
> +LEAF[00000001],SUBLEAF[00],EAX[13:12],processor, Processor Type
> +LEAF[00000001],SUBLEAF[00],EAX[19:16],model_ext, Extended Model ID
> +LEAF[00000001],SUBLEAF[00],EAX[27:20],family_ext, Extended Family ID
Yeah, this looks good but how about we simplify and ease the parsing
even more? I.e., make it a real csv:
# Table row names:
# LEAF,SUBLEAF,register_name,bits,short name, long name
0x1,0,EBX,7:0,brand,Brand Index
0x1,0,EBX,15:8,clflush_size,CLFLUSH line size (value * 8) in bytes
0x1,0,EBX,23:16,max_cpu_id,Maxim number of addressable logic cpu ID in this package
...
Yeah, this way it might not be as readable but the format is pretty simple and
everybody knows .csv so....
We can even do vertical alignment for better readability:
# LEAF,SUBLEAF,register, bits,short name, long name
1, 0, EBX, 7:0,brand,Brand Index
1, 0, EBX, 15:8,clflush_size,CLFLUSH line size (value * 8) in bytes
1, 0, EBX, 23:16,max_cpu_id,Maxim number of addressable logic cpu ID in this package
0x80000000, 12, EAX, 3,eee, EEE
and can keep it in tabellary form this way. The parsing code should
asimply split on ',' and ignore whitespace.
Thoughts?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2020-09-25 17:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 5:27 [RFC PATCH v2] tools/x86: add kcpuid tool to show raw CPU features Feng Tang
2020-09-22 19:38 ` Dave Hansen
2020-09-25 7:22 ` Feng Tang
2020-09-25 17:27 ` Borislav Petkov
2020-09-22 20:10 ` Borislav Petkov
2020-09-22 22:15 ` Arvind Sankar
2020-09-23 2:45 ` Feng Tang
2020-09-25 17:16 ` Borislav Petkov
2020-09-25 19:48 ` Arvind Sankar
2020-09-25 20:17 ` Borislav Petkov
2020-09-25 20:40 ` Arvind Sankar
2020-09-25 20:57 ` Borislav Petkov
2020-09-25 17:24 ` Borislav Petkov [this message]
2020-09-25 17:26 ` Dave Hansen
2020-09-28 7:07 ` Feng Tang
2020-09-28 8:34 ` Borislav Petkov
2020-09-28 8:56 ` Feng Tang
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=20200925172437.GM16872@zn.tnic \
--to=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=feng.tang@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox