Re: [PATCH 5/7] x86/cpu: Enable LASS (Linear Address Space Separation)

From: Sohil Mehta
Date: Thu Jan 12 2023 - 20:18:06 EST


On 1/12/2023 10:17 AM, Dave Hansen wrote:

> In the end, want X86_CR4_LASS set when the kernel wants LASS and clear
> in *ALL* other cases. That would be simply:
>
> if (cpu_feature_enabled(X86_FEATURE_LASS)) {
> cr4_set_bits(X86_CR4_LASS);
> } else {
> cr4_clear_bits(X86_CR4_LASS);
> }
>

Thanks for the explanation. This is very helpful.

> I'm also wondering if we even want a Kconfig option. Is anyone
> realistically going to be compiling this support out?

I was initially thinking we should leave the Kconfig option for users
that really *need* vsyscall support. But, thinking about it more, we
don't need an LASS Kconfig option for that.

We can make CONFIG_LEGACY_VSYSCALL_NONE as the default instead of the
current CONFIG_LEGACY_VSYSCALL_XONLY. The kernel can disable LASS at
boot time if a user/admin has shown explicit preference by selecting
CONFIG_LEGACY_VSYSCALL_XONLY or by providing command line parameter
vsyscall=xonly/emulate.

Thoughts?