x86, fpu: Consolidate inline asm routines for saving/restoring fpu state

Consolidate x86, x86_64 inline asm routines saving/restoring fpu state
using config_enabled().

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Link: http://lkml.kernel.org/r/1343171129-2747-3-git-send-email-suresh.b.siddha@intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
Suresh Siddha
2012-07-24 16:05:28 -07:00
committed by H. Peter Anvin
parent 050902c011
commit 0ca5bd0d88
3 changed files with 80 additions and 112 deletions

View File

@@ -176,8 +176,10 @@ int save_i387_xstate(void __user *buf)
else
err = fxsave_user(buf);
if (err)
if (unlikely(err)) {
__clear_user(buf, xstate_size);
return err;
}
user_fpu_end();
} else {
sanitize_i387_state(tsk);