diff options
author | bde <bde@FreeBSD.org> | 1997-11-21 18:27:15 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-11-21 18:27:15 +0000 |
commit | a1c70f26adaa133dc69cc67f43d6e76b81e3a2c2 (patch) | |
tree | 08c84e6e659a4d143fc5820f13a25c9f23b2ba64 | |
parent | 63e63c0d0019d60593eb0edbfaff536899cc11e0 (diff) | |
download | FreeBSD-src-a1c70f26adaa133dc69cc67f43d6e76b81e3a2c2.zip FreeBSD-src-a1c70f26adaa133dc69cc67f43d6e76b81e3a2c2.tar.gz |
Fixed setting of `safepri'. It should be SWI_AST_MASK most of the
time, but was left at 0. This caused the "can't happen" case in
splz_swi to happen for panics when tsleep() calls splx(safepri)
and there is a SWI_AST pending. This was harmless because the
the error handling happens to be right. Debugging this was tricky
because debugger traps force SWI_AST_MASK on in `cpl'.
-rw-r--r-- | sys/amd64/amd64/autoconf.c | 11 | ||||
-rw-r--r-- | sys/amd64/amd64/machdep.c | 8 | ||||
-rw-r--r-- | sys/i386/i386/autoconf.c | 11 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 8 | ||||
-rw-r--r-- | sys/sys/systm.h | 3 |
5 files changed, 36 insertions, 5 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index c1990ed..5e71aeb 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.80 1997/11/21 05:44:07 peter Exp $ + * $Id: autoconf.c,v 1.81 1997/11/21 18:14:02 bde Exp $ */ /* @@ -58,6 +58,7 @@ #include <machine/bootinfo.h> #include <machine/cons.h> +#include <machine/ipl.h> #include <machine/md_var.h> #ifdef APIC_IO #include <machine/smp.h> @@ -236,6 +237,14 @@ configure(dummy) */ spl0(); + /* + * Allow lowering of the ipl to the lowest kernel level if we + * panic (or call tsleep() before clearing `cold'). No level is + * completely safe (since a panic may occur in a critical region + * at splhigh()), but we want at least bio interrupts to work. + */ + safepri = cpl; + #if NCARD > 0 /* After everyone else has a chance at grabbing resources */ pccard_configure(); diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 4d106e3..295484d 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.271 1997/11/07 09:20:15 phk Exp $ + * $Id: machdep.c,v 1.272 1997/11/20 19:30:29 bde Exp $ */ #include "apm.h" @@ -105,6 +105,7 @@ #include <machine/specialreg.h> #include <machine/cons.h> #include <machine/bootinfo.h> +#include <machine/ipl.h> #include <machine/md_var.h> #include <machine/pcb_ext.h> /* pcb.h included via sys/user.h */ #ifdef SMP @@ -1089,6 +1090,11 @@ init386(first) int off; int speculative_mprobe; + /* + * Prevent lowering of the ipl if we call tsleep() early. + */ + safepri = cpl; + proc0.p_addr = proc0paddr; atdevbase = ISA_HOLE_START + KERNBASE; diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index c1990ed..5e71aeb 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.80 1997/11/21 05:44:07 peter Exp $ + * $Id: autoconf.c,v 1.81 1997/11/21 18:14:02 bde Exp $ */ /* @@ -58,6 +58,7 @@ #include <machine/bootinfo.h> #include <machine/cons.h> +#include <machine/ipl.h> #include <machine/md_var.h> #ifdef APIC_IO #include <machine/smp.h> @@ -236,6 +237,14 @@ configure(dummy) */ spl0(); + /* + * Allow lowering of the ipl to the lowest kernel level if we + * panic (or call tsleep() before clearing `cold'). No level is + * completely safe (since a panic may occur in a critical region + * at splhigh()), but we want at least bio interrupts to work. + */ + safepri = cpl; + #if NCARD > 0 /* After everyone else has a chance at grabbing resources */ pccard_configure(); diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 4d106e3..295484d 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.271 1997/11/07 09:20:15 phk Exp $ + * $Id: machdep.c,v 1.272 1997/11/20 19:30:29 bde Exp $ */ #include "apm.h" @@ -105,6 +105,7 @@ #include <machine/specialreg.h> #include <machine/cons.h> #include <machine/bootinfo.h> +#include <machine/ipl.h> #include <machine/md_var.h> #include <machine/pcb_ext.h> /* pcb.h included via sys/user.h */ #ifdef SMP @@ -1089,6 +1090,11 @@ init386(first) int off; int speculative_mprobe; + /* + * Prevent lowering of the ipl if we call tsleep() early. + */ + safepri = cpl; + proc0.p_addr = proc0paddr; atdevbase = ISA_HOLE_START + KERNBASE; diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 474f945..c155660 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)systm.h 8.7 (Berkeley) 3/29/95 - * $Id: systm.h,v 1.62 1997/11/18 15:16:54 bde Exp $ + * $Id: systm.h,v 1.63 1997/11/21 11:37:03 bde Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -49,6 +49,7 @@ extern int securelevel; /* system security level (see init(8)) */ extern int cold; /* nonzero if we are doing a cold boot */ extern const char *panicstr; /* panic message */ +extern int safepri; /* safe ipl when cold or panicing */ extern char version[]; /* system version */ extern char copyright[]; /* system copyright */ |