[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50a8d23c-8c91-467c-9ee4-5894dc31d2f7@intel.com>
Date: Fri, 31 Oct 2025 10:21:30 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Sohil Mehta <sohil.mehta@...el.com>, x86@...nel.org,
Dave Hansen <dave.hansen@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>
Cc: Jonathan Corbet <corbet@....net>, "H . Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>, Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, Ard Biesheuvel <ardb@...nel.org>,
"Kirill A . Shutemov" <kas@...nel.org>, Xin Li <xin@...or.com>,
David Woodhouse <dwmw@...zon.co.uk>, Sean Christopherson
<seanjc@...gle.com>, Rick Edgecombe <rick.p.edgecombe@...el.com>,
Vegard Nossum <vegard.nossum@...cle.com>,
Andrew Cooper <andrew.cooper3@...rix.com>,
Randy Dunlap <rdunlap@...radead.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>, Kees Cook <kees@...nel.org>,
Tony Luck <tony.luck@...el.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-efi@...r.kernel.org
Subject: Re: [PATCH v11 9/9] x86/cpu: Enable LASS by default during CPU
initialization
On 10/29/25 14:03, Sohil Mehta wrote:
...
> +static __always_inline void setup_lass(struct cpuinfo_x86 *c)
> +{
> + if (cpu_feature_enabled(X86_FEATURE_LASS)) {
> + /*
> + * Legacy vsyscall page access causes a #GP when LASS is
> + * active. However, vsyscall emulation isn't supported
> + * with #GP. To avoid breaking userspace, disable LASS
> + * if the emulation code is compiled in.
> + */
> + if (IS_ENABLED(CONFIG_X86_VSYSCALL_EMULATION)) {
> + pr_info_once("x86/cpu: Disabling LASS due to CONFIG_X86_VSYSCALL_EMULATION=y\n");
> + setup_clear_cpu_cap(X86_FEATURE_LASS);
> + return;
> + }
> +
> + cr4_set_bits(X86_CR4_LASS);
> + }
> +}
This breaks two rules I have:
1. Indent as little as practical
2. Keep the main code flow at the lowest indentation level
IOW, this should be.
static __always_inline void setup_lass(struct cpuinfo_x86 *c)
{
if (!cpu_feature_enabled(X86_FEATURE_LASS))
return;
...
But I can fix that up when I apply this. I think it's mostly ready.
Reviewed-by: Dave Hansen <dave.hansen@...ux.intel.com>
Powered by blists - more mailing lists