From: Sohil Mehta <sohil.mehta@intel.com>
To: <x86@kernel.org>, Dave Hansen <dave.hansen@linux.intel.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "Borislav Petkov" <bp@alien8.de>,
Ard Biesheuvel <ardb@kernel.org>,
"Nikunj A. Dadhania" <nikunj@amd.com>
Cc: "H . Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
"Kirill A . Shutemov" <kas@kernel.org>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Tony Luck <tony.luck@intel.com>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
<linux-kernel@vger.kernel.org>, <linux-efi@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] x86/cpu: Defer LASS enabling until userspace comes up
Date: Thu, 19 Feb 2026 13:02:43 -0800 [thread overview]
Message-ID: <ee807044-42f7-4fe5-9304-588a93a24656@intel.com> (raw)
In-Reply-To: <20260120234730.2215498-2-sohil.mehta@intel.com>
On 1/20/2026 3:47 PM, Sohil Mehta wrote:
> +/*
> + * Finalize features that need to be enabled just before entering
> + * userspace. Note that this only runs on a single CPU. Use appropriate
> + * callbacks if all the CPUs need to reflect the same change.
> + */
> +static int cpu_finalize_pre_userspace(void)
> +{
> + if (!cpu_feature_enabled(X86_FEATURE_LASS))
> + return 0;
> +
> + /* Runs on all online CPUs and future CPUs that come online. */
> + cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/lass:enable", enable_lass, NULL);
> +
> + return 0;
> +}
> +late_initcall(cpu_finalize_pre_userspace);
> +
@Dave, Nikunj,
The current patch
https://lore.kernel.org/lkml/1bc0b798-9cef-4dfd-af06-7674b699af1b@intel.com/
..to defer CR pinning enforcement until CPU online makes sense for the
FRED fix. Eventually, I am thinking we can defer CR pinning even further
until userspace comes up.
setup_cr_pinning(), which enables the static key, can be moved to a
late_initcall() such as above. The cpu_online() check to enforce CR
pinning would still be needed to make it play nice with CPU hotplug.
Do you see an issue with that approach?
> /* These bits should not change their value after CPU init is finished. */
> static const unsigned long cr4_pinned_mask = X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP |
> X86_CR4_FSGSBASE | X86_CR4_CET | X86_CR4_FRED;
next prev parent reply other threads:[~2026-02-19 21:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 23:47 [PATCH v2 0/3] x86: Extend LASS support to EFI configurations Sohil Mehta
2026-01-20 23:47 ` [PATCH v2 1/3] x86/cpu: Defer LASS enabling until userspace comes up Sohil Mehta
2026-02-19 21:02 ` Sohil Mehta [this message]
2026-03-03 17:41 ` Dave Hansen
2026-03-03 23:59 ` [tip: x86/cpu] " tip-bot2 for Sohil Mehta
2026-01-20 23:47 ` [PATCH v2 2/3] x86/efi: Disable LASS while executing runtime services Sohil Mehta
2026-03-03 23:59 ` [tip: x86/cpu] " tip-bot2 for Sohil Mehta
2026-01-20 23:47 ` [PATCH v2 3/3] x86/cpu: Remove LASS restriction on EFI Sohil Mehta
2026-03-03 23:59 ` [tip: x86/cpu] " tip-bot2 for Sohil Mehta
2026-02-04 17:08 ` [PATCH v2 0/3] x86: Extend LASS support to EFI configurations Maciej Wieczor-Retman
2026-02-05 17:47 ` Luck, Tony
2026-02-24 18:45 ` Sohil Mehta
2026-02-24 18:49 ` Ard Biesheuvel
2026-03-03 17:42 ` Dave Hansen
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=ee807044-42f7-4fe5-9304-588a93a24656@intel.com \
--to=sohil.mehta@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kas@kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=nikunj@amd.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--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®