Re: Interrupt level in system call
"Valeriy E. Ushakov" <[email protected]> Sat, 22 Jul 2006 06:53:24 +0400
| Newsgroups | gmane.os.netbsd.ports.sh3 |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jul 21, 2006 at 12:33:15 +0900, Masao Uebayashi wrote: > A co-worker found a problem that system calls in kernel mode are > running in the highest interrupt level (SR:I[3-0] == 1111). Oops. > Can't they safely run in the lowest interrupt level? They should. > Index: arch/sh3/sh3/exception_vector.S > =================================================================== > RCS file: /cvsroot/src/sys/arch/sh3/sh3/exception_vector.S,v > retrieving revision 1.18 > diff -u -r1.18 exception_vector.S > --- arch/sh3/sh3/exception_vector.S 8 Feb 2006 02:19:57 -0000 1.18 > +++ arch/sh3/sh3/exception_vector.S 21 Jul 2006 03:23:31 -0000 > @@ -104,6 +104,7 @@ > mov.l r2, @(TF_UBC, r14) /* clear trapframe->tf_ubc */ > #endif /* DDB */ > __EXCEPTION_UNBLOCK(r0, r1) > + __INTR_UNMASK(r0, r1) > mov.l _L.general, r0 > jsr @r0 > mov r14, r5 /* 2nd arg */ I think that's not a correct fix. We can hit general_excepion() from kernel code, so we cannot set sr.imask to zero in that place. general_excepion() should call spl0() if the trap is coming from the user mode. I'm trying to wrap my head around this code. SY, Uwe -- [email protected] | Zu Grunde kommen http://snark.ptc.spbu.ru/~uwe/ | Ist zu Grunde gehen