Don't switch from fast interrupt handlers to normal interrupt

handlers if interrupts are nested more than a few (3) deep.  This
only reduces the maximum nesting level by 1 with the standard
drivers unless there is a related bug somewhere, but can't hurt
much (the worst case is returning to hoggish interrupt handler like
wdintr(), but such interrupt handlers hurt anyway).

Fixed a previously harmless race incrementing the interrupt nesting
level.

This should be in 2.1.6 and 2.2.
This commit is contained in:
bde 1996-11-07 03:05:27 +00:00
parent cf8c1bcd54
commit 857450d0ac
3 changed files with 24 additions and 12 deletions

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: vector.s,v 1.21 1996/10/30 22:39:04 asami Exp $
* $Id: vector.s,v 1.22 1996/11/06 17:02:38 bde Exp $
*/
/*
@ -135,7 +135,8 @@ IDTVEC(vec_name) ; \
movl _cpl,%eax ; /* are we unmasking pending HWIs or SWIs? */ \
notl %eax ; \
andl _ipending,%eax ; \
jne 1f ; /* yes, handle them */ \
jne 2f ; /* yes, maybe handle them */ \
1: ; \
MEXITCOUNT ; \
MAYBE_POPL_ES ; \
popl %ds ; \
@ -145,9 +146,13 @@ IDTVEC(vec_name) ; \
iret ; \
; \
ALIGN_TEXT ; \
1: ; \
2: ; \
cmpb $3,_intr_nesting_level ; /* is there enough stack? */ \
jae 1b ; /* no, return */ \
movl _cpl,%eax ; \
/* XXX next line is probably unnecessary now. */ \
movl $HWI_MASK|SWI_MASK,_cpl ; /* limit nesting ... */ \
incb _intr_nesting_level ; /* ... really limit it ... */ \
sti ; /* ... to do this as early as possible */ \
MAYBE_POPL_ES ; /* discard most of thin frame ... */ \
popl %ecx ; /* ... original %ds ... */ \
@ -163,7 +168,6 @@ IDTVEC(vec_name) ; \
movl (2+8+1)*4(%esp),%eax ; /* ... cpl from thin frame */ \
pushl %eax ; \
subl $4,%esp ; /* junk for unit number */ \
incb _intr_nesting_level ; \
MEXITCOUNT ; \
jmp _doreti

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: vector.s,v 1.21 1996/10/30 22:39:04 asami Exp $
* $Id: vector.s,v 1.22 1996/11/06 17:02:38 bde Exp $
*/
/*
@ -135,7 +135,8 @@ IDTVEC(vec_name) ; \
movl _cpl,%eax ; /* are we unmasking pending HWIs or SWIs? */ \
notl %eax ; \
andl _ipending,%eax ; \
jne 1f ; /* yes, handle them */ \
jne 2f ; /* yes, maybe handle them */ \
1: ; \
MEXITCOUNT ; \
MAYBE_POPL_ES ; \
popl %ds ; \
@ -145,9 +146,13 @@ IDTVEC(vec_name) ; \
iret ; \
; \
ALIGN_TEXT ; \
1: ; \
2: ; \
cmpb $3,_intr_nesting_level ; /* is there enough stack? */ \
jae 1b ; /* no, return */ \
movl _cpl,%eax ; \
/* XXX next line is probably unnecessary now. */ \
movl $HWI_MASK|SWI_MASK,_cpl ; /* limit nesting ... */ \
incb _intr_nesting_level ; /* ... really limit it ... */ \
sti ; /* ... to do this as early as possible */ \
MAYBE_POPL_ES ; /* discard most of thin frame ... */ \
popl %ecx ; /* ... original %ds ... */ \
@ -163,7 +168,6 @@ IDTVEC(vec_name) ; \
movl (2+8+1)*4(%esp),%eax ; /* ... cpl from thin frame */ \
pushl %eax ; \
subl $4,%esp ; /* junk for unit number */ \
incb _intr_nesting_level ; \
MEXITCOUNT ; \
jmp _doreti

View File

@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
* $Id: vector.s,v 1.21 1996/10/30 22:39:04 asami Exp $
* $Id: vector.s,v 1.22 1996/11/06 17:02:38 bde Exp $
*/
/*
@ -135,7 +135,8 @@ IDTVEC(vec_name) ; \
movl _cpl,%eax ; /* are we unmasking pending HWIs or SWIs? */ \
notl %eax ; \
andl _ipending,%eax ; \
jne 1f ; /* yes, handle them */ \
jne 2f ; /* yes, maybe handle them */ \
1: ; \
MEXITCOUNT ; \
MAYBE_POPL_ES ; \
popl %ds ; \
@ -145,9 +146,13 @@ IDTVEC(vec_name) ; \
iret ; \
; \
ALIGN_TEXT ; \
1: ; \
2: ; \
cmpb $3,_intr_nesting_level ; /* is there enough stack? */ \
jae 1b ; /* no, return */ \
movl _cpl,%eax ; \
/* XXX next line is probably unnecessary now. */ \
movl $HWI_MASK|SWI_MASK,_cpl ; /* limit nesting ... */ \
incb _intr_nesting_level ; /* ... really limit it ... */ \
sti ; /* ... to do this as early as possible */ \
MAYBE_POPL_ES ; /* discard most of thin frame ... */ \
popl %ecx ; /* ... original %ds ... */ \
@ -163,7 +168,6 @@ IDTVEC(vec_name) ; \
movl (2+8+1)*4(%esp),%eax ; /* ... cpl from thin frame */ \
pushl %eax ; \
subl $4,%esp ; /* junk for unit number */ \
incb _intr_nesting_level ; \
MEXITCOUNT ; \
jmp _doreti