Don't try to resolve pagefaults from interrupt mode; it can result in a

LOCKDEBUG panic, or the machine getting really confused. Instead, panic
at the earliest oppertunity.
This commit is contained in:
ad 2008-05-30 10:36:20 +00:00
parent f608e44ab1
commit c51560fae0
2 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.47 2008/04/28 20:23:12 martin Exp $ */
/* $NetBSD: trap.c,v 1.48 2008/05/30 10:36:20 ad Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.47 2008/04/28 20:23:12 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.48 2008/05/30 10:36:20 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -95,7 +95,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.47 2008/04/28 20:23:12 martin Exp $");
#include <sys/ras.h>
#include <sys/reboot.h>
#include <sys/pool.h>
#include <sys/cpu.h>
#include <uvm/uvm_extern.h>
@ -103,7 +103,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.47 2008/04/28 20:23:12 martin Exp $");
#include <x86/tprof.h>
#endif /* NTPROF > 0 */
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/fpu.h>
#include <machine/psl.h>
@ -429,8 +428,12 @@ copyfault:
* fusuintrfailure is used by [fs]uswintr() to prevent
* page faulting from inside the profiling interrupt.
*/
if (pcb->pcb_onfault == fusuintrfailure)
if (pcb->pcb_onfault == fusuintrfailure) {
goto copyefault;
}
if (cpu_intr_p() || (l->l_pflag & LP_INTR) != 0) {
goto we_re_toast;
}
cr2 = rcr2();
goto faultcommon;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.237 2008/04/28 20:23:24 martin Exp $ */
/* $NetBSD: trap.c,v 1.238 2008/05/30 10:36:20 ad Exp $ */
/*-
* Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.237 2008/04/28 20:23:24 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.238 2008/05/30 10:36:20 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -95,15 +95,15 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.237 2008/04/28 20:23:24 martin Exp $");
#include <sys/signal.h>
#include <sys/syscall.h>
#include <sys/kauth.h>
#include <sys/cpu.h>
#include <sys/ucontext.h>
#include <uvm/uvm_extern.h>
#if NTPROF > 0
#include <x86/tprof.h>
#endif /* NTPROF > 0 */
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/psl.h>
#include <machine/reg.h>
@ -589,12 +589,9 @@ copyfault:
if ((onfault = 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)
if (cpu_intr_p() || (l->l_pflag & LP_INTR) != 0) {
goto we_re_toast;
#endif
}
/*
* XXXhack: xen2 hypervisor pushes cr2 onto guest's stack