From: Feng Tang <feng.tang@intel.com>
To: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Borislav Petkov <bp@alien8.de>,
Tom Lendacky <thomas.lendacky@amd.com>,
Yazen Ghannam <yazen.ghannam@amd.com>,
Wei Huang <wei.huang2@amd.com>,
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: Wed, 23 Sep 2020 10:45:29 +0800 [thread overview]
Message-ID: <20200923024529.GA15894@shbuild999.sh.intel.com> (raw)
In-Reply-To: <20200922221523.GA1185357@rani.riverdale.lan>
Hi Arvind,
On Tue, Sep 22, 2020 at 06:15:23PM -0400, Arvind Sankar wrote:
> On Tue, Sep 22, 2020 at 10:10:24PM +0200, Borislav Petkov wrote:
> > + AMD folks.
> >
> > On Tue, Sep 22, 2020 at 01:27:50PM +0800, Feng Tang wrote:
> > > End users frequently want to know what features their processor
> > > supports, independent of what the kernel supports.
> > >
> > > /proc/cpuinfo is great. It is omnipresent and since it is provided by
> > > the kernel it is always as up to date as the kernel. But, it could be
> > > ambiguous about processor features which can be disabled by the kernel
> > > at boot-time or compile-time.
> > >
> > > There are some user space tools showing more raw features, but they are
> > > not bound with kernel, and go with distros. Many end users are still
> > > using old distros with new kernels (upgraded by themselves), and may
> > > not upgrade the distros only to get a newer tool.
> > >
> > > So here arise the need for a new tool, which
> > > * Shows raw cpu features got from running cpuid
> > > * Be easier to obtain updates for compared to existing userspace
> > > tooling (perhaps distributed like perf)
> > > * Inherits "modern" kernel development process, in contrast to some
> > > of the existing userspace cpuid tools which are still being developed
> > > without git and distributed in tarballs from non-https sites.
> > > * Can produce output consistent with /proc/cpuinfo to make comparison
> > > easier.
>
> Rather than a tool, would additional file(s) in, say,
> /sys/devices/system/cpu/cpu<n> be nicer? They could show the raw CPUID
> features, one file per leaf or sub-leaf, maybe even along with whether
> they were disabled at boot-time.
My thought is we already have in-kernel powerful /proc/cpuinfo, while
a user space tool could be more flexible for text parsing/layout, and
show different info on user's demand/options.
> > > * Be in-kernel, could leverage kernel enabling, and even
> > > theoretically consume arch/x86/boot/cpustr.h so it could pick up
> > > new features directly from one-line X86_FEATURE_* definitions.
>
> That's arch/x86/include/asm/cpufeatures.h right -- cpustr.h is generated
> from that. The table there already has comments which could be extracted
> as the one-line description.
Thanks for the hint! I found the comments in cpufeatures.h is much better
than what I extraced from SDM :), which I should use instead.
One other thing as Boris has mentioned, cpu feature is mixture of raw
silicon features and kernel software ones. Also, cpufeatures.h only
contains shows ont-bit boolean flag, while cpuid has multiple-bits field
containing numbers.
Thanks,
Feng
next prev parent reply other threads:[~2020-09-23 2:45 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 [this message]
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
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=20200923024529.GA15894@shbuild999.sh.intel.com \
--to=feng.tang@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nivedita@alum.mit.edu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=wei.huang2@amd.com \
--cc=x86@kernel.org \
--cc=yazen.ghannam@amd.com \
/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