lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 18 Jun 2024 00:33:44 -0700
From: Xin Li <xin@...or.com>
To: Brian Gerst <brgerst@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
        will@...nel.org, peterz@...radead.org, akpm@...ux-foundation.org,
        acme@...nel.org, namhyung@...nel.org
Subject: Re: [PATCH v2 2/3] x86/cpufeatures: Generate a feature mask header
 based on build config

On 6/17/2024 9:34 AM, Brian Gerst wrote:
> On Sun, Jun 16, 2024 at 4:58 AM Xin Li (Intel) <xin@...or.com> wrote:
>>
>> From: "H. Peter Anvin (Intel)" <hpa@...or.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ