Linux MIPS Architecture development
 help / color / mirror / Atom feed
* kernel_thread creation bug?
@ 2004-10-22  8:07 Atsushi Nemoto
  2004-10-22 12:16 ` Ralf Baechle
  0 siblings, 1 reply; 6+ messages in thread
From: Atsushi Nemoto @ 2004-10-22  8:07 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

I'm encountering strange kernel lockup recently.  I noticed that
sometimes an interrupt happend in middle of RESTORE_SOME code.

RESTORE_SOME restores CP0_STATUS from stack.  But the value in the
stack did not contains EXL bit when the problem happens.

With recent change in kernel_thread(), initial cp0_status value comes
from current C0_STATUS (which does not include EXL bit).  Is this
correct?  The initial value should contain EXL bit to start the thread
up safely, shouldn't it?

Now I'm testing this patch and it seems to fix the problem.

diff -u linux-mips/arch/mips/kernel/process.c linux/arch/mips/kernel/
--- linux-mips/arch/mips/kernel/process.c	Wed Sep 22 13:27:59 2004
+++ linux/arch/mips/kernel/process.c	Fri Oct 22 16:49:39 2004
@@ -171,6 +171,9 @@
 	regs.regs[5] = (unsigned long) fn;
 	regs.cp0_epc = (unsigned long) kernel_thread_helper;
 	regs.cp0_status = read_c0_status();
+#if !(defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX))
+	regs.cp0_status |= ST0_EXL;
+#endif
 
 	/* Ok, create the new process.. */
 	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);

---
Atsushi Nemoto

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

end of thread, other threads:[~2004-10-23 11:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-22  8:07 kernel_thread creation bug? Atsushi Nemoto
2004-10-22 12:16 ` Ralf Baechle
2004-10-22 12:25   ` Atsushi Nemoto
2004-10-23  4:08     ` Maciej W. Rozycki
2004-10-23  5:15       ` Maciej W. Rozycki
2004-10-23 11:28         ` Ralf Baechle

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