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

From: Arvind Sankar
Date: Fri Sep 25 2020 - 16:40:53 EST


On Fri, Sep 25, 2020 at 10:17:07PM +0200, Borislav Petkov wrote:
> On Fri, Sep 25, 2020 at 03:48:04PM -0400, Arvind Sankar wrote:
> > Ok. Another suggestion: while designing the format for the cpuid.txt
> > file, would it be possible to include enough information for
> > cpufeatures.h to be auto-generated from it?
>
> I think you're missing the previous discussion on this topic. In short:
> /proc/cpuinfo is not CPUID but what the kernel supports. The kcpuid tool
> is supposed to dump CPUID leafs and it should be updatable the easiest
> way possible.
>
> Here's some more documentation which should make this more clear:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=ea4e3bef4c94d5b5d8e790f37b48b7641172bcf5
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette

They're not the same, but aren't there going to be quite a few common
flags between the definitions in cpufeatures.h and the definitions in
cpuid.txt? If they're both living in the kernel repo, it would be nice
for them to not duplicate what's common between them, no?

This shouldn't affect how easy it is to update, I think. The kernel
build will use whatever version is in the source tree, the tool will use
whatever version is installed under /usr/share, so the latter can be
updated without needing a new kernel.

Thanks.