Commit 584d752b authored by Sohil Mehta's avatar Sohil Mehta Committed by Dave Hansen
Browse files

x86/cpu: Remove LASS restriction on vsyscall emulation



Vsyscall emulation has two modes of operation: XONLY and EMULATE. The
default XONLY mode is now supported with a LASS-triggered #GP. OTOH,
LASS is disabled if someone requests the deprecated EMULATE mode via the
vsyscall=emulate command line option. So, remove the restriction on LASS
when the overall vsyscall emulation support is compiled in.

As a result, there is no need for setup_lass() anymore. LASS is enabled
by default through a late_initcall().

Signed-off-by: default avatarSohil Mehta <sohil.mehta@intel.com>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: default avatarH. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by:
Tested-by: default avatarMaciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Link: https://patch.msgid.link/20260309181029.398498-6-sohil.mehta@intel.com
parent b36d1f53
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -406,20 +406,6 @@ static __always_inline void setup_umip(struct cpuinfo_x86 *c)
	cr4_clear_bits(X86_CR4_UMIP);
}

static __always_inline void setup_lass(struct cpuinfo_x86 *c)
{
	if (!cpu_feature_enabled(X86_FEATURE_LASS))
		return;

	/*
	 * Legacy vsyscall page access causes a #GP when LASS is active.
	 * Disable LASS because the #GP handler doesn't support vsyscall
	 * emulation.
	 */
	if (IS_ENABLED(CONFIG_X86_VSYSCALL_EMULATION))
		setup_clear_cpu_cap(X86_FEATURE_LASS);
}

static int enable_lass(unsigned int cpu)
{
	cr4_set_bits(X86_CR4_LASS);
@@ -2061,7 +2047,6 @@ static void identify_cpu(struct cpuinfo_x86 *c)
	setup_smep(c);
	setup_smap(c);
	setup_umip(c);
	setup_lass(c);

	/* Enable FSGSBASE instructions if available. */
	if (cpu_has(c, X86_FEATURE_FSGSBASE)) {