Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f999ab5 authored by Robert Richter's avatar Robert Richter Committed by H. Peter Anvin
Browse files

x86, xsave: Disable xsave in i387 emulation mode



xsave is broken for (!HAVE_HWFP). This is the case if config
MATH_EMULATION is enabled, 'no387' kernel parameter is set and xsave
exists. xsave will not work because x86/math-emu and xsave share the
same memory. As this case can be treated as corner case we simply
disable xsave then.

Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
LKML-Reference: <1279731838-1522-7-git-send-email-robert.richter@amd.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent ad41a1e0
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -67,6 +67,12 @@ static void __cpuinit init_thread_xstate(void)
	 */
	 */


	if (!HAVE_HWFP) {
	if (!HAVE_HWFP) {
		/*
		 * Disable xsave as we do not support it if i387
		 * emulation is enabled.
		 */
		setup_clear_cpu_cap(X86_FEATURE_XSAVE);
		setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
		xstate_size = sizeof(struct i387_soft_struct);
		xstate_size = sizeof(struct i387_soft_struct);
		return;
		return;
	}
	}