mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xin Li <xin@zytor.com>
To: Brian Gerst <brgerst@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	will@kernel.org, peterz@infradead.org, akpm@linux-foundation.org,
	acme@kernel.org, namhyung@kernel.org
Subject: Re: [PATCH v2 2/3] x86/cpufeatures: Generate a feature mask header based on build config
Date: Tue, 18 Jun 2024 00:33:44 -0700	[thread overview]
Message-ID: <390e41a2-26c1-41da-86bd-6632b39f2706@zytor.com> (raw)
In-Reply-To: <CAMzpN2jQrgaPR2R_=sBRmjGvbpX1ZSCrr9zJ+TM9N1ymg5_OiA@mail.gmail.com>

On 6/17/2024 9:34 AM, Brian Gerst wrote:
> On Sun, Jun 16, 2024 at 4:58 AM Xin Li (Intel) <xin@zytor.com> wrote:
>>
>> From: "H. Peter Anvin (Intel)" <hpa@zytor.com>
>>
>> Introduce an AWK script to auto-generate a header with required and
>> disabled feature masks based on <asm/cpufeatures.h> and current build
>> config. Thus for any CPU feature with a build config, e.g., X86_FRED,
>> simply add

>> +
>> +file == 2 && $1 ~ /^CONFIG_X86_[A-Z]*_FEATURE_/ {
>> +       on = ($2 == "y");
>> +       printf "/* %s = %s (%d) */\n", $1, $2, on;
> 
> This looks like extra debugging output that doesn't need to be in the
> final release.
> 
>> +       if (split($1, fs, "CONFIG_X86_|_FEATURE_") == 3) {
>> +               printf "/* %s %s = %d */\n", fs[2], fs[3], on;
> 
> Same.

Right, they are comments but better remove them.

>> +       printf "#define SSE_MASK\t\\\n";
>> +       printf "\t(REQUIRED_MASK0 & ((1<<(X86_FEATURE_XMM & 31)) | (1<<(X86_FEATURE_XMM2 & 31))))\n\n";
> 
> This could be moved to verify_cpu.S, since that is the only place it is used.

NP.

>> +       printf "#endif /* _ASM_X86_FEATUREMASKS_H */\n";
>> +}
>> --
>> 2.45.1
>>
>>
> 
> You could also generate {REQUIRED|DISABLED}_MASK_BIT_SET() in this
> script, so that they are always in sync with NCAPINTS.

Yeah, just better to make this an add-on patch.

Thanks!
     Xin


  reply	other threads:[~2024-06-18  7:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-16  8:57 [PATCH v2 0/3] x86/cpufeatures: Automatically generate required and disabled feature masks Xin Li (Intel)
2024-06-16  8:57 ` [PATCH v2 1/3] x86/cpufeatures: Add {required,disabled} feature configs Xin Li (Intel)
2024-06-21 17:32   ` Borislav Petkov
2024-06-22 17:16     ` Xin Li
2024-06-16  8:57 ` [PATCH v2 2/3] x86/cpufeatures: Generate a feature mask header based on build config Xin Li (Intel)
2024-06-17 16:34   ` Brian Gerst
2024-06-18  7:33     ` Xin Li [this message]
2024-06-16  8:57 ` [PATCH v2 3/3] x86/cpufeatures: Remove {disabled,required}-features.h Xin Li (Intel)

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=390e41a2-26c1-41da-86bd-6632b39f2706@zytor.com \
    --to=xin@zytor.com \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /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®