[Top] [All Lists]

Problems w/ 2.1.131 on r3k

To: "" <>
Subject: Problems w/ 2.1.131 on r3k
From: "Gleb O. Raiko" <>
Date: Mon, 25 Jan 1999 18:22:08 +0300
Organization: NIISI RAN
Hello folks,

After unsuccessful tries to make Harald's linux-mips-2.1.131 working, I
need a help from the mailing list, especially from someone who knows
what was changed between 2.1.121 and 2.1.131 kernels. The patch has 6MB
size and I'll take a looong time to trace it. So, before I'll actually
deep in the patch, I'd like to hear some suggestions.

The problem I have is that 'make' dies with error 'wait: Bad address"
after Ctrl+Z is pressed. (The test is to compile something, e.g. gdb
from sources.) Children of make (e.g. gcc) die too. The problem affects
other utilities, e.g. man, but doesn't affect small tests I wrote. The
kernel log contains '<process name>: Exception at ...'. Futher
investigation showed that getrusage is called with bad user address.

I had to apply the patch which is attached here. Without this patch,
user process will never leave the kernel mode. (Harald, with the patch
the kernel should be 'more stable').

Index: linux-2.1.131/arch/mips/kernel/process.c
diff -u linux-2.1.131/arch/mips/kernel/process.c: 
--- linux-2.1.131/arch/mips/kernel/process.c:    Mon Jan 11 16:08:21 1999
+++ linux-2.1.131/arch/mips/kernel/process.c    Mon Jan 25 16:37:12 1999
@@ -40,7 +40,7 @@
 void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
        /* New thread looses kernel privileges. */
-       regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KU_USER;
+       regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|KU_MASK)) | KU_USER;
        regs->cp0_epc = pc;
        regs->regs[29] = sp;
        current->tss.current_ds = USER_DS;
Index: linux-2.1.131/arch/mips/kernel/scall_o32.S
diff -u linux-2.1.131/arch/mips/kernel/scall_o32.S: 
--- linux-2.1.131/arch/mips/kernel/scall_o32.S:  Mon Jan 11 16:08:21 1999
+++ linux-2.1.131/arch/mips/kernel/scall_o32.S  Mon Jan 25 16:37:12 1999
@@ -12,6 +12,7 @@
 #include <asm/mipsregs.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
+#include <asm/isadep.h>
 #include <asm/unistd.h>
 /* This duplicates the definition from <linux/sched.h> */
@@ -69,7 +70,7 @@
        bnez    t0,o32_handle_bottom_half
 9:     lw      t0,PT_STATUS(sp)        # returning to kernel mode?
-       andi    t1, t0, 0x10
+       andi    t1, t0, KU_USER
        lw      t2, TASK_NEED_RESCHED($28)
        beqz    t1, o32_return          # -> yes
        bnez    t2, o32_reschedule
<Prev in Thread] Current Thread [Next in Thread>