* [PATCH v2] Fix race condition with FPU thread task flag during context switch.
@ 2012-05-11 6:28 Steven J. Hill
2012-05-23 10:00 ` Ralf Baechle
0 siblings, 1 reply; 7+ messages in thread
From: Steven J. Hill @ 2012-05-11 6:28 UTC (permalink / raw)
To: linux-mips, ralf; +Cc: Steven J. Hill, Leonid Yegoshin
From: "Steven J. Hill" <sjhill@mips.com>
Signed-off-by: Leonid Yegoshin <yegoshin@mips.com>
Signed-off-by: Steven J. Hill <sjhill@mips.com>
---
arch/mips/include/asm/switch_to.h | 6 ++++--
arch/mips/kernel/r4k_switch.S | 12 +++---------
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h
index 5d33621..4f8ddba8 100644
--- a/arch/mips/include/asm/switch_to.h
+++ b/arch/mips/include/asm/switch_to.h
@@ -22,7 +22,7 @@ struct task_struct;
* switch_to(n) should switch tasks to task nr n, first
* checking that n isn't the current task, in which case it does nothing.
*/
-extern asmlinkage void *resume(void *last, void *next, void *next_ti);
+extern asmlinkage void *resume(void *last, void *next, void *next_ti, u32 __usedfpu);
extern unsigned int ll_bit;
extern struct task_struct *ll_task;
@@ -66,11 +66,13 @@ do { \
#define switch_to(prev, next, last) \
do { \
+ u32 __usedfpu; \
__mips_mt_fpaff_switch_to(prev); \
if (cpu_has_dsp) \
__save_dsp(prev); \
__clear_software_ll_bit(); \
- (last) = resume(prev, next, task_thread_info(next)); \
+ __usedfpu = test_and_clear_tsk_thread_flag(prev, TIF_USEDFPU); \
+ (last) = resume(prev, next, task_thread_info(next), __usedfpu); \
} while (0)
#define finish_arch_switch(prev) \
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 9414f93..a675752 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -41,7 +41,7 @@
/*
* task_struct *resume(task_struct *prev, task_struct *next,
- * struct thread_info *next_ti)
+ * struct thread_info *next_ti, u32 __usedfpu)
*/
.align 5
LEAF(resume)
@@ -53,16 +53,10 @@
/*
* check if we need to save FPU registers
*/
- PTR_L t3, TASK_THREAD_INFO(a0)
- LONG_L t0, TI_FLAGS(t3)
- li t1, _TIF_USEDFPU
- and t2, t0, t1
- beqz t2, 1f
- nor t1, zero, t1
- and t0, t0, t1
- LONG_S t0, TI_FLAGS(t3)
+ beqz a3, 1f
+ PTR_L t3, TASK_THREAD_INFO(a0)
/*
* clear saved user stack CU1 bit
*/
--
1.7.10
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] Fix race condition with FPU thread task flag during context switch.
2012-05-11 6:28 [PATCH v2] Fix race condition with FPU thread task flag during context switch Steven J. Hill
@ 2012-05-23 10:00 ` Ralf Baechle
2012-05-23 13:34 ` Hill, Steven
0 siblings, 1 reply; 7+ messages in thread
From: Ralf Baechle @ 2012-05-23 10:00 UTC (permalink / raw)
To: Steven J. Hill; +Cc: linux-mips, Leonid Yegoshin
On Fri, May 11, 2012 at 01:28:22AM -0500, Steven J. Hill wrote:
> From: "Steven J. Hill" <sjhill@mips.com>
>
> Signed-off-by: Leonid Yegoshin <yegoshin@mips.com>
> Signed-off-by: Steven J. Hill <sjhill@mips.com>
Good catch - but r2300_switch.S and octeon_switch.S needed the same
modification. Also, who is the author, Leonid or Steven?
Ralf
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH v2] Fix race condition with FPU thread task flag during context switch.
2012-05-23 10:00 ` Ralf Baechle
@ 2012-05-23 13:34 ` Hill, Steven
2012-05-23 13:58 ` Ralf Baechle
2012-05-23 14:53 ` Sergei Shtylyov
0 siblings, 2 replies; 7+ messages in thread
From: Hill, Steven @ 2012-05-23 13:34 UTC (permalink / raw)
To: ralf@linux-mips.org; +Cc: linux-mips@linux-mips.org, Yegoshin, Leonid
Leonid is the author of this patch. The r2300_switch.S is easy enough to fix, but octeon_switch.S is nothing like the others, so someone else will have to fix that.
-Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] Fix race condition with FPU thread task flag during context switch.
2012-05-23 13:34 ` Hill, Steven
@ 2012-05-23 13:58 ` Ralf Baechle
2012-05-23 14:53 ` Sergei Shtylyov
1 sibling, 0 replies; 7+ messages in thread
From: Ralf Baechle @ 2012-05-23 13:58 UTC (permalink / raw)
To: Hill, Steven; +Cc: linux-mips@linux-mips.org, Yegoshin, Leonid
On Wed, May 23, 2012 at 01:34:04PM +0000, Hill, Steven wrote:
> Leonid is the author of this patch. The r2300_switch.S is easy enough to
> fix, but octeon_switch.S is nothing like the others, so someone else will
> have to fix that.
octeon_switch.S thanks to Octeon not featuring an FPU does not require
this fix. I've already patched that up here, was just waiting for
confirmation of authorship to get the commit right.
Thanks!
Ralf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] Fix race condition with FPU thread task flag during context switch.
2012-05-23 13:34 ` Hill, Steven
2012-05-23 13:58 ` Ralf Baechle
@ 2012-05-23 14:53 ` Sergei Shtylyov
2012-05-23 14:56 ` Hill, Steven
1 sibling, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2012-05-23 14:53 UTC (permalink / raw)
To: Hill, Steven
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, Yegoshin, Leonid
Hello.
On 05/23/2012 05:34 PM, Hill, Steven wrote:
> Leonid is the author of this patch.
Then, for the future, you should put the real author in the From: field of
the patch.
> -Steve
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH v2] Fix race condition with FPU thread task flag during context switch.
2012-05-23 14:53 ` Sergei Shtylyov
@ 2012-05-23 14:56 ` Hill, Steven
2012-05-23 15:59 ` Sergei Shtylyov
0 siblings, 1 reply; 7+ messages in thread
From: Hill, Steven @ 2012-05-23 14:56 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, Yegoshin, Leonid
How about in the future you stop using reply all?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] Fix race condition with FPU thread task flag during context switch.
2012-05-23 14:56 ` Hill, Steven
@ 2012-05-23 15:59 ` Sergei Shtylyov
0 siblings, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2012-05-23 15:59 UTC (permalink / raw)
To: Hill, Steven; +Cc: linux-mips@linux-mips.org
Hello.
On 05/23/2012 06:56 PM, Hill, Steven wrote:
> How about in the future you stop using reply all?
Using reply-to-all on the mailing lists is normal default behavior. I don't
quite understand what's your problem with this.
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-05-23 16:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-11 6:28 [PATCH v2] Fix race condition with FPU thread task flag during context switch Steven J. Hill
2012-05-23 10:00 ` Ralf Baechle
2012-05-23 13:34 ` Hill, Steven
2012-05-23 13:58 ` Ralf Baechle
2012-05-23 14:53 ` Sergei Shtylyov
2012-05-23 14:56 ` Hill, Steven
2012-05-23 15:59 ` Sergei Shtylyov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.