aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-08-28 22:15:53 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-08-28 22:15:53 -0400
commit0ee6c15e7ba7b36a217cdadb292eeaf32a057a59 (patch)
tree7ce7ee5413086758ebdea9a00f4d5b7d7a8f45ba /arch
parentb07d68b5ca4d55a16fab223d63d5fb36f89ff42f (diff)
[POWERPC] Flush registers to proper task context
When we flush register state for FP, Altivec, or SPE in flush_*_to_thread we need to respect the task_struct that the caller has passed to us. Most cases we are called with current, however sometimes (ptrace) we may be passed a different task_struct. This showed up when using gdbserver debugging a simple program that used floating point. When gdb tried to show the FP regs they all showed up as 0, because the child's FP registers were never properly flushed to memory. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/process.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index a83727b308a0..e477c9d0498b 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -83,7 +83,7 @@ void flush_fp_to_thread(struct task_struct *tsk)
83 */ 83 */
84 BUG_ON(tsk != current); 84 BUG_ON(tsk != current);
85#endif 85#endif
86 giveup_fpu(current); 86 giveup_fpu(tsk);
87 } 87 }
88 preempt_enable(); 88 preempt_enable();
89 } 89 }
@@ -143,7 +143,7 @@ void flush_altivec_to_thread(struct task_struct *tsk)
143#ifdef CONFIG_SMP 143#ifdef CONFIG_SMP
144 BUG_ON(tsk != current); 144 BUG_ON(tsk != current);
145#endif 145#endif
146 giveup_altivec(current); 146 giveup_altivec(tsk);
147 } 147 }
148 preempt_enable(); 148 preempt_enable();
149 } 149 }
@@ -182,7 +182,7 @@ void flush_spe_to_thread(struct task_struct *tsk)
182#ifdef CONFIG_SMP 182#ifdef CONFIG_SMP
183 BUG_ON(tsk != current); 183 BUG_ON(tsk != current);
184#endif 184#endif
185 giveup_spe(current); 185 giveup_spe(tsk);
186 } 186 }
187 preempt_enable(); 187 preempt_enable();
188 } 188 }