Added a couple short-term debugs and a fix to the SPIN_MAX variable.

Debugs are an attempt to ferret out the PUSHDOWN_LEVEL_3 deadlock.
This commit is contained in:
Steve Passe 1997-09-28 19:34:48 +00:00
parent 643b3d0cf2
commit c2d4a15648
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29946
2 changed files with 38 additions and 7 deletions

View File

@ -36,7 +36,7 @@
*
* @(#)ipl.s
*
* $Id: ipl.s,v 1.13 1997/09/07 22:02:56 fsmp Exp $
* $Id: ipl.s,v 1.14 1997/09/21 21:41:16 gibbs Exp $
*/
@ -227,8 +227,15 @@ no_cil:
*/
movl ihandlers(,%ecx,4),%edx
testl %edx,%edx
#if 0
/* XXX SMP this would leave cil set: */
je doreti_next /* "can't happen" */
#else
jne ih_ok
int $3 /* _breakpoint */
jmp doreti_next /* "can't happen" */
ih_ok:
#endif
cmpl $NHWI,%ecx
jae doreti_swi
cli
@ -249,6 +256,14 @@ no_cil:
ALIGN_TEXT
doreti_swi:
#if 1
cmpl $0100, _cil
jne 1f
cmpl $0, _inside_intr
jne 1f
int $3
1:
#endif
pushl %eax
/*
* The SWI_AST handler has to run at cpl = SWI_AST_MASK and the
@ -262,7 +277,7 @@ doreti_swi:
#ifdef SMP
orl imasks(,%ecx,4), %eax
cli /* prevent INT deadlock */
pushl %eax /* save cpl|cmpl */
pushl %eax /* save cpl|cml */
ICPL_LOCK
#ifdef CPL_AND_CML
popl _cml /* restore cml */

View File

@ -166,14 +166,27 @@ softclockpending(void)
#ifdef SPL_DEBUG
#define MAXZ 100000000
#define SPIN_COUNT unsigned z = 0;
#define SPIN_VAR unsigned z;
#define SPIN_RESET z = 0;
#if 0
#define SPIN_SPL \
if (++z >= MAXZ) { \
/* XXX allow lock-free panic */ \
bsp_apic_ready = 0; \
panic("\ncil: 0x%08x", cil); \
}
#else
#define SPIN_SPL \
if (++z >= MAXZ) { \
/* XXX allow lock-free panic */ \
bsp_apic_ready = 0; \
printf("\ncil: 0x%08x", cil); \
breakpoint(); \
}
#endif /* 0/1 */
#else /* SPL_DEBUG */
#define SPIN_COUNT
#define SPIN_VAR
#define SPIN_RESET
#define SPIN_SPL
#endif /* SPL_DEBUG */
@ -185,7 +198,7 @@ softclockpending(void)
unsigned NAME(void) \
{ \
unsigned x, y; \
SPIN_COUNT; \
SPIN_VAR; \
\
if (!bsp_apic_ready) { \
x = cpl; \
@ -202,6 +215,7 @@ unsigned NAME(void) \
y OP MODIFIER; /* desired value */ \
if (cil & y) { /* not now */ \
IFCPL_UNLOCK(); /* allow cil to change */ \
SPIN_RESET; \
while (cil & y) \
SPIN_SPL \
continue; /* try again */ \
@ -274,13 +288,14 @@ spl0(void)
{
int unpend;
#ifdef INTR_SPL
SPIN_COUNT;
SPIN_VAR;
for (;;) {
IFCPL_LOCK();
POSTCODE_HI(0xc);
if (cil & SWI_AST_MASK) { /* not now */
IFCPL_UNLOCK(); /* allow cil to change */
SPIN_RESET;
while (cil & SWI_AST_MASK)
SPIN_SPL
continue; /* try again */
@ -304,7 +319,7 @@ splx(unsigned ipl)
{
int unpend;
#ifdef INTR_SPL
SPIN_COUNT;
SPIN_VAR;
#endif
if (!bsp_apic_ready) {
@ -323,6 +338,7 @@ splx(unsigned ipl)
POSTCODE_HI(0xf);
if (cil & ipl) { /* not now */
IFCPL_UNLOCK(); /* allow cil to change */
SPIN_RESET;
while (cil & ipl)
SPIN_SPL
continue; /* try again */