aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/r4k_switch.S
diff options
context:
space:
mode:
authorLeonid Yegoshin <yegoshin@mips.com>2012-07-19 03:11:14 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-07-19 05:23:43 -0400
commit2dd17030c940ef1199a07b095ec79c4660fa8734 (patch)
tree34261c3c27f418a785ef127afe6a1f0109310a53 /arch/mips/kernel/r4k_switch.S
parentdc34b05fea0cc9a869863b929f37f1e8ce30edf4 (diff)
MIPS: Fix race condition with FPU thread task flag during context switch.
[ralf@linux-mips.org: Cosmetic changes; also fixed up r2300_switch.S and octeon_switch.S which needed similar modifications.] Signed-off-by: Leonid Yegoshin <yegoshin@mips.com> Signed-off-by: Steven J. Hill <sjhill@mips.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3784/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/r4k_switch.S')
-rw-r--r--arch/mips/kernel/r4k_switch.S12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 9414f9354469..42d2a3938420 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -41,7 +41,7 @@
41 41
42/* 42/*
43 * task_struct *resume(task_struct *prev, task_struct *next, 43 * task_struct *resume(task_struct *prev, task_struct *next,
44 * struct thread_info *next_ti) 44 * struct thread_info *next_ti, int usedfpu)
45 */ 45 */
46 .align 5 46 .align 5
47 LEAF(resume) 47 LEAF(resume)
@@ -53,16 +53,10 @@
53 /* 53 /*
54 * check if we need to save FPU registers 54 * check if we need to save FPU registers
55 */ 55 */
56 PTR_L t3, TASK_THREAD_INFO(a0)
57 LONG_L t0, TI_FLAGS(t3)
58 li t1, _TIF_USEDFPU
59 and t2, t0, t1
60 beqz t2, 1f
61 nor t1, zero, t1
62 56
63 and t0, t0, t1 57 beqz a3, 1f
64 LONG_S t0, TI_FLAGS(t3)
65 58
59 PTR_L t3, TASK_THREAD_INFO(a0)
66 /* 60 /*
67 * clear saved user stack CU1 bit 61 * clear saved user stack CU1 bit
68 */ 62 */