From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Jakub Kicinski <kuba@kernel.org>
Cc: Michael Kelley <mhklinux@outlook.com>,
"Xin Li (Intel)" <xin@zytor.com>,
"Borislav Petkov (AMD)" <bp@alien8.de>,
Ingo Molnar <mingo@kernel.org>,
Nikolay Borisov <nik.borisov@suse.com>,
"x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [tip: x86/core] x86/cpufeatures: Generate the <asm/cpufeaturemasks.h> header based on build config
Date: Fri, 28 Mar 2025 17:56:48 -0700 [thread overview]
Message-ID: <69F3FAF7-7F30-4740-A536-672DB6A2372D@zytor.com> (raw)
In-Reply-To: <CAHk-=wjn1m+j1NYN6CKXvozOp-mmhXNFJLCub7Tr9JEz6Su5Lw@mail.gmail.com>
On March 28, 2025 5:14:25 PM PDT, Linus Torvalds <torvalds@linux-foundation.org> wrote:
>On Fri, 28 Mar 2025 at 16:23, Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> FWIW this also makes netdev CI melt down. Combination of allmodconfig
>> insisting on WERROR, us insisting on W=1, and this change insisting on
>> full kernel rebuild every time .config is touched :( IOW we do:
>>
>> make allmodconfig
>> ./scripts/config -d werror
>> make -j W=1
>>
>> Could a hack like this fly? I don't see an easy way out ..
>
>Ok, clearly we need something like this.
>
>That said, your patch makes my skin crawl a bit. Not because it's
>wrong, but because it really makes me think "why don't we have this as
>part of our normal "cmd_gen_" infrastructure?
>
>In fact, we *do* have something like that for our infrastructure: it's
>the 'filechk' macro.
>
>So I think the real fix is something like this ENTIRELY UNTESTED
>patch. Whitespace-damaged again to make sure people don't apply this
>mindlessly, it needs more thought:
>
> arch/x86/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 0fc7e8fd1a2e..769b29bf26ba 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -278,11 +278,11 @@ cpufeaturemasks.awk :=
>$(srctree)/arch/x86/tools/cpufeaturemasks.awk
> cpufeatures_hdr := $(srctree)/arch/x86/include/asm/cpufeatures.h
> targets += $(cpufeaturemasks.hdr)
> quiet_cmd_gen_featuremasks = GEN $@
> - cmd_gen_featuremasks = $(AWK) -f $(cpufeaturemasks.awk)
>$(cpufeatures_hdr) $(KCONFIG_CONFIG) > $@
> + filechk_featuremasks = $(AWK) -f $(cpufeaturemasks.awk)
>$(cpufeatures_hdr) $(KCONFIG_CONFIG)
>
> $(cpufeaturemasks.hdr): $(cpufeaturemasks.awk) $(cpufeatures_hdr)
>$(KCONFIG_CONFIG) FORCE
> $(shell mkdir -p $(dir $@))
> - $(call if_changed,gen_featuremasks)
> + $(call filechk,featuremasks)
> archprepare: $(cpufeaturemasks.hdr)
>
> ###
>
>does something like that work? (And really: note the "something like
>that" part, this may be *entirely* broken)
>
> Linus
This also points out a need here: the header generator output probably should suffer replace-if-changed. Too bad we have to use such primitive tools :(
next prev parent reply other threads:[~2025-03-29 0:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 18:47 [PATCH v7 0/4] x86/cpufeatures: Automatically generate required and disabled feature masks Xin Li (Intel)
2025-03-05 18:47 ` [PATCH v7 1/4] x86/cpufeatures: Add {required,disabled} feature configs Xin Li (Intel)
2025-03-05 18:47 ` [PATCH v7 2/4] x86/cpufeatures: Generate a feature mask header based on build config Xin Li (Intel)
2025-03-10 8:18 ` [tip: x86/cpu] x86/cpufeatures: Generate the <asm/cpufeaturemasks.h> " tip-bot2 for H. Peter Anvin (Intel)
2025-03-19 11:03 ` [tip: x86/core] " tip-bot2 for H. Peter Anvin (Intel)
2025-03-20 16:23 ` Michael Kelley
2025-03-20 16:56 ` Linus Torvalds
2025-03-23 18:06 ` Michael Kelley
2025-03-28 23:23 ` Jakub Kicinski
2025-03-29 0:14 ` Linus Torvalds
2025-03-29 0:22 ` Linus Torvalds
2025-03-29 0:56 ` Jakub Kicinski
2025-04-01 7:00 ` [PATCH] x86: don't re-generate cpufeaturemasks.h so eagerly Ingo Molnar
2025-03-29 0:56 ` H. Peter Anvin [this message]
2025-03-05 18:47 ` [PATCH v7 3/4] x86/cpufeatures: Remove {disabled,required}-features.h Xin Li (Intel)
2025-03-10 8:18 ` [tip: x86/cpu] " tip-bot2 for Xin Li (Intel)
2025-03-19 11:03 ` [tip: x86/core] " tip-bot2 for Xin Li (Intel)
2025-03-05 18:47 ` [PATCH v7 4/4] x86/cpufeatures: Use AWK to generate {REQUIRED|DISABLED}_MASK_BIT_SET Xin Li (Intel)
2025-03-07 18:28 ` [PATCH v7 0/4] x86/cpufeatures: Automatically generate required and disabled feature masks Xin Li
2025-03-07 19:18 ` 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=69F3FAF7-7F30-4740-A536-672DB6A2372D@zytor.com \
--to=hpa@zytor.com \
--cc=bp@alien8.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhklinux@outlook.com \
--cc=mingo@kernel.org \
--cc=nik.borisov@suse.com \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®