Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/arch/usermode/usermode Pull up following revision(s) ...



details:   https://anonhg.NetBSD.org/src/rev/905d5524d83e
branches:  netbsd-6
changeset: 774388:905d5524d83e
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Aug 08 15:32:25 2012 +0000

description:
Pull up following revision(s) (requested by reinoud in ticket #463):
        sys/arch/usermode/usermode/trap.c: revision 1.66
Fix IO lockups in NetBSD/usermode.
1) Don't block IO signals since the return path is not garanteed to enable the
signal again.
2) Since signals can get dropped, do a 2nd pass over the routines.

diffstat:

 sys/arch/usermode/usermode/trap.c |  20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diffs (50 lines):

diff -r ad36319a2df4 -r 905d5524d83e sys/arch/usermode/usermode/trap.c
--- a/sys/arch/usermode/usermode/trap.c Wed Aug 08 14:50:55 2012 +0000
+++ b/sys/arch/usermode/usermode/trap.c Wed Aug 08 15:32:25 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.63.2.2 2012/03/08 17:21:20 riz Exp $ */
+/* $NetBSD: trap.c,v 1.63.2.3 2012/08/08 15:32:25 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <reinoud%netbsd.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.63.2.2 2012/03/08 17:21:20 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.63.2.3 2012/08/08 15:32:25 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -364,10 +364,6 @@
        thunk_sigemptyset(&jump_ucp.uc_sigmask);
        jump_ucp.uc_flags = _UC_STACK | _UC_CPU | _UC_SIGMASK;
 
-       /* prevent recursive IO signals */
-       if (sig == SIGIO)
-               thunk_sigaddset(&jump_ucp.uc_sigmask, SIGIO);
-
        thunk_makecontext(&jump_ucp,
                        (void (*)(void)) f,
                4, info, (void *) from_userland, (void *) pc, (void *) va);
@@ -612,13 +608,15 @@
        struct lwp *l = curlwp;
        struct pcb *pcb = lwp_getpcb(l); KASSERT(pcb);
        struct intr_handler *sih;
-       unsigned int n;
+       unsigned int n, pass;
 
 //     thunk_printf("%s: l %p, pcb %p\n", __func__, l, pcb);
-       for (n = 0; n < SIGIO_MAX_HANDLERS; n++) {
-               sih = &sigio_intr_handler[n];
-               if (sih->func)
-                       sih->func(sih->arg);
+       for (pass = 0; pass < 2; pass++) {
+               for (n = 0; n < SIGIO_MAX_HANDLERS; n++) {
+                       sih = &sigio_intr_handler[n];
+                       if (sih->func)
+                               sih->func(sih->arg);
+               }
        }
 
        KASSERT(l == curlwp);



Home | Main Index | Thread Index | Old Index