mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sohil Mehta <sohil.mehta@intel.com>
To: Maciej Wieczor-Retman <m.wieczorretman@pm.me>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>
Cc: Farrah Chen <farrah.chen@intel.com>,
	Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	<stable@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 1/3] x86/cpu: Clear feature bits disabled at compile-time
Date: Mon, 9 Mar 2026 16:47:49 -0700	[thread overview]
Message-ID: <eb26dda1-f0bf-498f-b4c6-874a6c2878e3@intel.com> (raw)
In-Reply-To: <cb4c2a6a0e67320b24244658b724acc1bf9686ef.1772453012.git.m.wieczorretman@pm.me>

On 3/2/2026 7:25 AM, Maciej Wieczor-Retman wrote:

>  /* Aligned to unsigned long to avoid split lock in atomic bitmap ops */
> -__u32 cpu_caps_cleared[NCAPINTS + NBUGINTS] __aligned(sizeof(unsigned long));
> +__u32 cpu_caps_cleared[NCAPINTS + NBUGINTS] __aligned(sizeof(unsigned long)) =
> +	DISABLED_MASK_INITIALIZER;

IIUC, DISABLED_MASK_INITIALIZER only contains the X86_FEATURE_* bits.
So, the NBUGINTS bits in cpu_caps_cleared[] are implicitly set to 0.

Should that be mentioned in the comment above? It wasn't obvious to me
when I first looked at it.

>  __u32 cpu_caps_set[NCAPINTS + NBUGINTS] __aligned(sizeof(unsigned long));
>  
>  #ifdef CONFIG_X86_32
> diff --git a/arch/x86/tools/cpufeaturemasks.awk b/arch/x86/tools/cpufeaturemasks.awk
> index 173d5bf2d999..b7f4e775a365 100755
> --- a/arch/x86/tools/cpufeaturemasks.awk
> +++ b/arch/x86/tools/cpufeaturemasks.awk
> @@ -82,6 +82,12 @@ END {
>  		}
>  		printf " 0\t\\\n";
>  		printf "\t) & (1U << ((x) & 31)))\n\n";
> +
> +		printf "\n#define %s_MASK_INITIALIZER\t\t\t\\", s;
> +		printf "\n\t{\t\t\t\t\t\t\\";
> +		for (i = 0; i < ncapints; i++)
> +			printf "\n\t\t%s_MASK%d,\t\t\t\\", s, i;
> +		printf "\n\t}\n\n";
>  	}
>  
>  	printf "#endif /* _ASM_X86_CPUFEATUREMASKS_H */\n";


  parent reply	other threads:[~2026-03-09 23:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 15:24 [PATCH v8 0/3] x86: Capability bits fix and required bits sanity check Maciej Wieczor-Retman
2026-03-02 15:25 ` [PATCH v8 1/3] x86/cpu: Clear feature bits disabled at compile-time Maciej Wieczor-Retman
2026-03-02 19:31   ` Borislav Petkov
2026-03-02 19:48     ` Maciej Wieczor-Retman
2026-03-02 20:25       ` Borislav Petkov
2026-03-02 20:38         ` Maciej Wieczor-Retman
2026-03-02 20:59           ` Borislav Petkov
2026-03-02 21:22             ` Maciej Wieczor-Retman
2026-03-03  5:59               ` Borislav Petkov
2026-03-09 23:47   ` Sohil Mehta [this message]
2026-03-10 10:49     ` Maciej Wieczor-Retman
2026-03-02 15:25 ` [PATCH v8 2/3] x86/cpu: Check if feature string is non-zero Maciej Wieczor-Retman
2026-03-10  6:23   ` Sohil Mehta
2026-03-10 12:29     ` Maciej Wieczor-Retman
2026-03-02 15:25 ` [PATCH v8 3/3] x86/cpu: Do a sanity check on required feature bits Maciej Wieczor-Retman
2026-03-10  7:05   ` Sohil Mehta
2026-03-10 13:06     ` Maciej Wieczor-Retman

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=eb26dda1-f0bf-498f-b4c6-874a6c2878e3@intel.com \
    --to=sohil.mehta@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=farrah.chen@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.wieczorretman@pm.me \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mingo@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@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®