lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5ef17179-7557-b609-2e72-20caa1369d46@intel.com>
Date:   Wed, 2 Sep 2020 09:25:17 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     Borislav Petkov <bp@...en8.de>, Feng Tang <feng.tang@...el.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H . Peter Anvin" <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] tools/x86: add kcpuid tool to show raw CPU features

On 9/2/20 8:40 AM, Borislav Petkov wrote:
> When you need to add a new leaf, you simply extend the text file and the
> tool parses it anew and has its all CPUID info uptodate. This way you
> won't even have to recompile it. Adding new CPUID leafs would be adding new
> lines to the file.
> 
> For example:
> 
> LEAF<num>,SUBLEAF<num>,[EAX,EBX,ECX,EDX]{[width]<Mnemonic>|<Long text>,...}
> 
> LEAF07,SUBLEAF00,EAX{[31:0]max_value|Max input value for supported subleafs}
> LEAF07,SUBLEAF00,EBX{[0]FSGSBASE|RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE if 1.,
> 		     [1]TSC_ADJUST|IA32_TSC_ADJUST MSR is supported if 1.,
> 		     [2]SGX|Supports Intel® Software Guard Extensions (Intel® SGX Extensions) if 1.,
> 		     ...
> }
> LEAF07,SUBLEAF00,ECX{[0]PREFETCHWT1|(Intel® Xeon PhiTM only.),
> 		     [1]AVX512_VBMI|,
> 		     ...
> 
> This is just a dumb attempt but I hope it comes across where I'm getting
> with this.

Ugh.  I hate text parsers.  But, I do see what you're getting at.

If we do this, I bet having each value on its own line, I bet this would
be a bit less painful to parse.  It'll be a _bit_ harder to read, but
not really.  Maybe:

LEAF[07],SUBLEAF[00],EAX[31:0],max_value,	Max input value for supported
subleafs
LEAF[07],SUBLEAF[00],EBX[   0],FSGSBASE,
RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE if 1.
LEAF[07],SUBLEAF[00],EBX[   1],TSC_ADJUST,	IA32_TSC_ADJUST MSR is
supported if 1.
LEAF[07],SUBLEAF[00],EBX[   2],SGX,		Supports Intel® Software Guard
Extensions (Intel® SGX Extensions) if 1.

I was *really* hoping that we could eventually feed kcpuid and the
X86_FEATURE_* bits from the same source.  Does this take us away from
that?  Is that a worthy long-term goal?

Maybe we'd be better off reusing the parser for cpufeatures.h.  The
majority of the same information is there, except for the mapping from
word to CPUID leaf, and multi-bit values.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ