From: "H. Peter Anvin" <hpa@zytor.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Maciej Wieczor-Retman <m.wieczorretman@pm.me>,
dave.hansen@linux.intel.com, xin@zytor.com,
chang.seok.bae@intel.com, mingo@redhat.com,
elena.reshetova@intel.com, maciej.wieczor-retman@intel.com,
babu.moger@amd.com, sohil.mehta@intel.com,
pawan.kumar.gupta@linux.intel.com, pmladek@suse.com,
nik.borisov@suse.com, ptesarik@suse.com, darwi@linutronix.de,
tglx@kernel.org, peterz@infradead.org, jpoimboe@kernel.org,
ak@linux.intel.com, linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH v12 2/4] x86/cpu: Check if feature string is non-zero
Date: Mon, 30 Mar 2026 19:15:42 -0700 [thread overview]
Message-ID: <434e2706-66b9-490b-a379-0c6ee8dfc3e4@zytor.com> (raw)
In-Reply-To: <5dda018c-9d7d-47ca-a414-cf2593813042@zytor.com>
[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]
On 2026-03-30 16:42, H. Peter Anvin wrote:
> On 2026-03-30 15:59, Borislav Petkov wrote:
>> On Mon, Mar 30, 2026 at 02:44:56PM -0700, H. Peter Anvin wrote:
>>> The Right Thing™ would be to have a table in the kernel which includes *all*
>>> the feature bit names, not just the ones exported to /proc/cpuinfo, and use
>>> the unfiltered string table for kernel messages (/proc/cpuinfo being
>>> filtered via a bitmask, list, or a flag in the table.)
>>
>> Meh, not convinced. Not sure it is worth the effort and bloating if we can
>> simply look up the feature from word and bit number.
>>
>
> Bloating? Drop in the bucket compared to other kernel messages. Getting kernel
> messages in cleartext is a good thing.
>
> It's testing a flag... not exactly complicated, just didn't want Maciej to
> complicate this one patchset with it.
>
The main issue is that since we're not allowed to use *sane* scripting
languages in the kernel tree, we have to do everything in the POSIX subset of
awk -- or in C.
Anyway, here is a hacky and mostly untested port of mkcapflags.sh to awk which
also produces an export bitmask. Another alternative would be to simply put a
prefix character like + or - which can simply be skipped for kernel messages
but tested for /proc/cpuinfo generation. Definitely simpler in that there is
no need to haul two pointers around.
-hpa
[-- Attachment #2: mkcapflags.awk --]
[-- Type: application/x-awk, Size: 2315 bytes --]
next prev parent reply other threads:[~2026-03-31 2:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 15:10 [PATCH v12 0/4] x86: Capability bits fix and required bits sanity check Maciej Wieczor-Retman
2026-03-27 15:10 ` [PATCH v12 1/4] x86/cpu: Clear feature bits disabled at compile-time Maciej Wieczor-Retman
2026-03-27 15:10 ` [PATCH v12 2/4] x86/cpu: Check if feature string is non-zero Maciej Wieczor-Retman
2026-03-27 17:50 ` Sohil Mehta
2026-03-27 21:28 ` Maciej Wieczor-Retman
2026-03-30 20:00 ` Borislav Petkov
2026-03-30 20:42 ` Maciej Wieczor-Retman
2026-03-30 21:15 ` Borislav Petkov
2026-03-30 21:44 ` H. Peter Anvin
2026-03-30 22:59 ` Borislav Petkov
2026-03-30 23:42 ` H. Peter Anvin
2026-03-31 2:15 ` H. Peter Anvin [this message]
2026-03-31 13:27 ` Borislav Petkov
2026-03-27 15:10 ` [PATCH v12 3/4] x86/cpu: Do a sanity check on required feature bits Maciej Wieczor-Retman
2026-03-27 17:10 ` Pawan Gupta
2026-03-27 17:22 ` Maciej Wieczor-Retman
2026-03-27 15:11 ` [PATCH v12 4/4] x86/cpu: Clear feature bits whose dependencies were cleared Maciej Wieczor-Retman
2026-03-28 2:22 ` H. Peter Anvin
2026-03-30 10:40 ` Maciej Wieczor-Retman
2026-03-30 21:41 ` Ahmed S. Darwish
2026-03-31 11:41 ` Maciej Wieczor-Retman
2026-04-01 15:16 ` Maciej Wieczor-Retman
2026-04-13 14:42 ` Ahmed S. Darwish
2026-03-30 6:11 ` [PATCH v12 0/4] x86: Capability bits fix and required bits sanity check Andi Kleen
2026-03-30 8:52 ` Maciej Wieczor-Retman
2026-03-30 23:40 ` H. Peter Anvin
2026-03-31 14:02 ` Borislav Petkov
2026-03-31 14:27 ` Maciej Wieczor-Retman
2026-03-31 14:46 ` Borislav Petkov
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=434e2706-66b9-490b-a379-0c6ee8dfc3e4@zytor.com \
--to=hpa@zytor.com \
--cc=ak@linux.intel.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=darwi@linutronix.de \
--cc=dave.hansen@linux.intel.com \
--cc=elena.reshetova@intel.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.wieczorretman@pm.me \
--cc=maciej.wieczor-retman@intel.com \
--cc=mingo@redhat.com \
--cc=nik.borisov@suse.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=ptesarik@suse.com \
--cc=sohil.mehta@intel.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
--cc=xin@zytor.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