Skip to content

Commit

Permalink
x86, xsave: Disable xsave in i387 emulation mode
Browse files Browse the repository at this point in the history
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: Robert Richter <robert.richter@amd.com>
LKML-Reference: <1279731838-1522-7-git-send-email-robert.richter@amd.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Robert Richter authored and H. Peter Anvin committed Aug 12, 2010
1 parent ad41a1e commit 1f999ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/x86/kernel/i387.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ static void __cpuinit init_thread_xstate(void)
*/

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);
return;
}
Expand Down

0 comments on commit 1f999ab

Please sign in to comment.