[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99208d95-d3de-44d0-8b08-f508759aabca@zytor.com>
Date: Sun, 16 Jun 2024 00:26:48 -0700
From: Xin Li <xin@...or.com>
To: linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org
Cc: 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: [RESEND v1 2/3] x86/cpufeatures: Generate a feature mask header
based on build config
On 5/9/2024 1:53 PM, Xin Li (Intel) 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
...
> +
> + printf "\n#define %s_MASKS ", s;
> + pfx = "{";
> + for (i = 0; i < ncapints; i++) {
> + printf "%s \\\n\t%s_MASK_%d", pfx, s, i;
> + pfx = ",";
> + }
> + printf " \\\n}\n\n";
> +
> + printf "#define %s_FEATURE(x) \\\n", s;
> + printf "\t((( ";
> + for (i = 0; i < ncapints; i++) {
> + if (masks[i]) {
> + printf "\\\n\t\t((x) >> 5) == %2d ? %s_MASK%-3d : ", i, s, i;
> + }
> + }
> + printf "0 \\\n";
> + printf "\t) >> ((x) & 31)) & 1)\n\n";
This code generates macros {REQUIRED,DISABLED}_FEATURE(x) to tell if a
CPU feature, e.g., X86_FEATURE_FRED, is a required or disabled feature
for this particular compile-time configuration.
But they are NOT currently used, so I prefer to remove them for now.
Thanks!
Xin
Powered by blists - more mailing lists