This is a note to let you know that I've just added the patch titled
i387: move TS_USEDFPU clearing out of __save_init_fpu and into callers
to the 3.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
i387-move-ts_usedfpu-clearing-out-of-__save_init_fpu-and-into-callers.patch
and it can be found in the queue-3.2 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From b6c66418dcad0fcf83cd1d0a39482db37bf4fc41 Mon Sep 17 00:00:00 2001
From: Linus Torvalds <[email protected]>
Date: Thu, 16 Feb 2012 12:22:48 -0800
Subject: i387: move TS_USEDFPU clearing out of __save_init_fpu and into callers
From: Linus Torvalds <[email protected]>
commit b6c66418dcad0fcf83cd1d0a39482db37bf4fc41 upstream.
Touching TS_USEDFPU without touching CR0.TS is confusing, so don't do
it. By moving it into the callers, we always do the TS_USEDFPU next to
the CR0.TS accesses in the source code, and it's much easier to see how
the two go hand in hand.
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
arch/x86/include/asm/i387.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -259,7 +259,6 @@ static inline void fpu_save_init(struct
static inline void __save_init_fpu(struct task_struct *tsk)
{
fpu_save_init(&tsk->thread.fpu);
- task_thread_info(tsk)->status &= ~TS_USEDFPU;
}
static inline int fpu_fxrstor_checking(struct fpu *fpu)
@@ -290,6 +289,7 @@ static inline void __unlazy_fpu(struct t
{
if (task_thread_info(tsk)->status & TS_USEDFPU) {
__save_init_fpu(tsk);
+ task_thread_info(tsk)->status &= ~TS_USEDFPU;
stts();
} else
tsk->fpu_counter = 0;
@@ -356,9 +356,11 @@ static inline void kernel_fpu_begin(void
WARN_ON_ONCE(!irq_fpu_usable());
preempt_disable();
- if (me->status & TS_USEDFPU)
+ if (me->status & TS_USEDFPU) {
__save_init_fpu(me->task);
- else
+ me->status &= ~TS_USEDFPU;
+ /* We do 'stts()' in kernel_fpu_end() */
+ } else
clts();
}
@@ -449,6 +451,7 @@ static inline void save_init_fpu(struct
WARN_ON_ONCE(!(task_thread_info(tsk)->status & TS_USEDFPU));
preempt_disable();
__save_init_fpu(tsk);
+ task_thread_info(tsk)->status &= ~TS_USEDFPU;
stts();
preempt_enable();
}
Patches currently in stable-queue which might be from
[email protected] are
queue-3.2/i387-fix-sense-of-sanity-check.patch
queue-3.2/i387-move-ts_usedfpu-clearing-out-of-__save_init_fpu-and-into-callers.patch
queue-3.2/i387-math_state_restore-isn-t-called-from-asm.patch
queue-3.2/i387-fix-x86-64-preemption-unsafe-user-stack-save-restore.patch
queue-3.2/i387-do-not-preload-fpu-state-at-task-switch-time.patch
queue-3.2/i387-make-irq_fpu_usable-tests-more-robust.patch
queue-3.2/i387-don-t-ever-touch-ts_usedfpu-directly-use-helper-functions.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html