Linux MIPS Architecture development
 help / color / mirror / Atom feed
* sdc1 $f0 in r4k_switch.S
@ 2004-10-07  4:05 Atsushi Nemoto
  2004-10-19 17:36 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2004-10-07  4:05 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

I found a bug in resume() in 2.6 kernel.  $f0 register may not be
saved on context switch in 64bit kernel.  Here is a quick fix.

Or moving "sdc1 $f0" to fpu_save_16even might be better fix.

diff -u linux-mips/arch/mips/kernel/r4k_switch.S linux/arch/mips/kernel/r4k_switch.S
--- linux-mips/arch/mips/kernel/r4k_switch.S	1 Sep 2004 08:03:31 -0000	1.11
+++ linux/arch/mips/kernel/r4k_switch.S	7 Oct 2004 03:27:56 -0000
@@ -81,10 +81,10 @@
 #ifdef CONFIG_MIPS64
 	sll	t2, t0, 5
 	bgez	t2, 2f
-	sdc1	$f0, (THREAD_FPU + 0x00)(a0)
         fpu_save_16odd a0
 2:
         fpu_save_16even a0 t1                   # clobbers t1
+	sdc1	$f0, (THREAD_FPU + 0x00)(a0)
 #endif
 1:
 

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sdc1 $f0 in r4k_switch.S
  2004-10-07  4:05 sdc1 $f0 in r4k_switch.S Atsushi Nemoto
@ 2004-10-19 17:36 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2004-10-19 17:36 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: linux-mips

On Thu, Oct 07, 2004 at 01:05:38PM +0900, Atsushi Nemoto wrote:

> I found a bug in resume() in 2.6 kernel.  $f0 register may not be
> saved on context switch in 64bit kernel.  Here is a quick fix.

But we compensate for not storing $f0 by restoring it twice ;-)

> Or moving "sdc1 $f0" to fpu_save_16even might be better fix.

And while we're at it eleminating the special handling for
CONFIG_MIPS32 / CONFIG_MIPS64.


  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-19 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-07  4:05 sdc1 $f0 in r4k_switch.S Atsushi Nemoto
2004-10-19 17:36 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox