Re: [RFC PATCH v2] tools/x86: add kcpuid tool to show raw CPU features

From: Borislav Petkov
Date: Fri Sep 25 2020 - 13:16:41 EST


On Wed, Sep 23, 2020 at 10:45:29AM +0800, Feng Tang wrote:
> > 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.

The important thing here is that a separate tool would be decoupled from
the kernel and thus will be independent from it, i.e., you can get the
tool and run it without having to install a new kernel.

And with the CPUID leafs specified in a text file, you won't even need
to update the tool even - just cpuid.txt. It can't get any better than
that.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette