[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200928070723.GA25109@shbuild999.sh.intel.com>
Date: Mon, 28 Sep 2020 15:07:23 +0800
From: Feng Tang <feng.tang@...el.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H . Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Dave Hansen <dave.hansen@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v2] tools/x86: add kcpuid tool to show raw CPU
features
On Fri, Sep 25, 2020 at 07:24:37PM +0200, Borislav Petkov wrote:
> 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?
Thanks, it looks good to me. One thing is in v2 we supported ',' in the
long name field, but that's minor as we could avoid using it in .csv
- Feng
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists