[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ad2da884-c8c8-bc57-e21f-452a08cb10cc@intel.com>
Date: Wed, 11 Jan 2023 16:27:49 -0800
From: "Chen, Yian" <yian.chen@...el.com>
To: Sohil Mehta <sohil.mehta@...el.com>,
<linux-kernel@...r.kernel.org>, <x86@...nel.org>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ravi Shankar <ravi.v.shankar@...el.com>,
"Tony Luck" <tony.luck@...el.com>, Paul Lai <paul.c.lai@...el.com>
Subject: Re: [PATCH 3/7] x86/cpu: Disable kernel LASS when patching kernel
alternatives
On 1/10/2023 2:41 PM, Sohil Mehta wrote:
> On 1/9/2023 9:52 PM, Yian Chen wrote:
>
>> LASS stops access to a lower half address in kernel,
>> and this can be deactivated if AC bit in EFLAGS
>> register is set. Hence use stac and clac instructions
>> around access to the address to avoid triggering a
>> LASS #GP fault.
>>
>
> It seems we are implicitly relying on the on stac() and clac() calls
> that are added for SMAP. Have you tried running with SMAP disabled i.e
> "clearcpuid=smap"?
>
Yes, I tested with clearcpuid=smap.
> I believe there needs to be a dependency between LASS and SMAP.
>
Yes, In kernel mode, LASS depends on SMAP to work. And in user mode, it
doesn't, so the dependency description in following may miss user space
effect.
> diff --git a/arch/x86/kernel/cpu/cpuid-deps.c
> b/arch/x86/kernel/cpu/cpuid-deps.c
> index d95221117129..00bc7e4a65d2 100644
> --- a/arch/x86/kernel/cpu/cpuid-deps.c
> +++ b/arch/x86/kernel/cpu/cpuid-deps.c
> @@ -79,6 +79,7 @@ static const struct cpuid_dep cpuid_deps[] = {
> { X86_FEATURE_XFD, X86_FEATURE_XSAVES },
> { X86_FEATURE_XFD, X86_FEATURE_XGETBV1 },
> { X86_FEATURE_AMX_TILE, X86_FEATURE_XFD },
> + { X86_FEATURE_LASS, X86_FEATURE_SMAP },
> {}
> };
Thanks,
Yian
Powered by blists - more mailing lists