Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 Check for an error in {f, s}uwintr before ...



details:   https://anonhg.NetBSD.org/src/rev/025659106847
branches:  trunk
changeset: 539215:025659106847
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Mon Nov 11 13:54:28 2002 +0000

description:
Check for an error in {f,s}uwintr before checking (if MULTIPROCESSOR)
if the kernel lock is held, otherwise a fatal trap will be erronerously
signaled for cases like profile calls from statclock().

diffstat:

 sys/arch/i386/i386/trap.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (44 lines):

diff -r 4101f2872f56 -r 025659106847 sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Mon Nov 11 12:51:38 2002 +0000
+++ b/sys/arch/i386/i386/trap.c Mon Nov 11 13:54:28 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.173 2002/10/31 22:32:40 jdolecek Exp $      */
+/*     $NetBSD: trap.c,v 1.174 2002/11/11 13:54:28 fvdl Exp $  */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.173 2002/10/31 22:32:40 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.174 2002/11/11 13:54:28 fvdl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -461,6 +461,12 @@
                if (simple_lock_held(&sched_lock))
                        goto we_re_toast;
 #endif
+               /*
+                * fusubail is used by [fs]uswintr() to prevent page faulting
+                * from inside the profiling interrupt.
+                */
+               if (pcb->pcb_onfault == fusubail)
+                       goto copyefault;
 #ifdef MULTIPROCESSOR
                /*
                 * process doing kernel-mode page fault must have
@@ -470,12 +476,6 @@
                        goto we_re_toast;
 #endif
 
-               /*
-                * fusubail is used by [fs]uswintr() to prevent page faulting
-                * from inside the profiling interrupt.
-                */
-               if (pcb->pcb_onfault == fusubail)
-                       goto copyefault;
 #if 0
                /* XXX - check only applies to 386's and 486's with WP off */
                if (frame.tf_err & PGEX_P)



Home | Main Index | Thread Index | Old Index