Re: [PATCH v11 4/4] x86/cpu: Clear feature bits whose dependencies were cleared
From: Borislav Petkov
Date: Mon Mar 23 2026 - 15:38:01 EST
On Mon, Mar 23, 2026 at 11:57:45AM -0700, H. Peter Anvin wrote:
> I do have to say that using awk for these things, especially being restricted
> to POSIX awk, is really awful as it really is pushing the limits of that tool.
> String processing in C is most definitely no fun either -- the single biggest
> shortcoming of what is otherwise one of my favorite languages -- but it
> *would* also be possible to refactor cpuid-deps.c so that it can be compiled
> in user space and linked with a C tool that would replace cpufeaturesmask.awk,
> mkcapflags.sh, and boot/mkcpustr.c.
>
> This seemed to me to be a bit excessive in terms of churn and complexity, but
> perhaps this is what you are looking for?
I was actually suggesting we handle the dependent features in
apply_forced_caps() and keep that all in one place.
As to the whole glue handling deps, feature flags, names, yadda yadda, yap,
I agree, it ain't easy and I need to grep each time where the generated files
are and go stare at them.
So I really like the idea of replacing it all with a C tool which you can
massage in luserspace and replace all that other gunk and we won't depend on
the awk flavor or shell script or whatnot but keep everything in a single
C program and a header.
I don't know whether that would work and how ugly it would become - we need to
try it I guess - but the idea ure sounds enticing...
Maybe something for a future todo.
:-)
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette