Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Nov 1996 15:56:31 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, smp@csn.net
Cc:        dg@root.com, hackers@freefall.freebsd.org, smp@freefall.freebsd.org
Subject:   Re: ed0 timeouts
Message-ID:  <199611050456.PAA10694@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I added these changes to the SMP kernel (#define APIC_LAZY in smptests.h,
>should be commited later today) and it seems to fix the problem!
>
>However system IO seemed to get hosed when I entered ddb to check
>the values of a few checkpoints I keep for debug.
>I went in/out of ddb several times (I think) but then going out the system
>"semi-hung":  I could not get back to my virtual term, nor could I loggin
>anywhere else.  I could ping the system so at least part of it lived...
>
>Have you ever seen similar problems with this code on your system?

ISTR remember that the non-masking of interrupts in ddb became critical
when I implemented lazy masking.  It was at least difficult to debug.

>I would think a "properly" designed card would not be prone to noise.
>I could make 2 versions of the INTR macro (edge & level), and plug the 
>appropriate one in as necessary in the XintXXX table.

It would be good to generate more-specialized versions of the interrupt
handlers, without generation more versions :-).  (I spent a lot of time
debugging a syscall performance bug that turned out to be that _Xsyscall
was almost an exact multiple of PAGE_SIZE away from _syscall.  This caused
lots of cache collisions.  The Pentium I-cache is only 2-way interleaved,
so the next code access to another axact multiple of PAGE_SIZE away busts
the cache.  It was noticeably (40% slowdown) busted even on a 486DX/2.  I
fixed this by reordering the object files, but then the bloated interrupt
code happened to push `doreti' to almost an exact multiple of PAGE_SIZE
away from _Xsyscall :-].)

Bruce

This keeps interrupts disabled in debuggers.  Its main disadvantage is
that the clock no longer ever works while you're sitting at the debugger
prompt.  Previously the clock (and other interrupts) worked iff they
happened not to be masked.

TODO: The clock (and perhaps other devices) should be adjusted when the
debugger gives up control.  The debugger should not (except optionally)
permit interrupts while single stepping.

diff -c2 exception.s~ exception.s
*** exception.s~	Mon Aug 12 09:36:45 1996
--- exception.s	Mon Oct 28 20:55:30 1996
***************
*** 59,66 ****
  #define	TRAP(a)		pushl $(a) ; jmp _alltraps
  
- /*
-  * XXX - debugger traps are now interrupt gates so at least bdb doesn't lose
-  * control.  The sti's give the standard losing behaviour for ddb and kgdb.
-  */
  #ifdef BDE_DEBUGGER
  #define	BDBTRAP(name) \
--- 116,119 ----
***************
*** 79,84 ****
  #endif
  
- #define BPTTRAP(a)	testl $PSL_I,4+8(%esp) ; je 1f ; sti ; 1: ; TRAP(a)
- 
  MCOUNT_LABEL(user)
  MCOUNT_LABEL(btrap)
--- 132,135 ----
***************
*** 88,97 ****
  IDTVEC(dbg)
  	BDBTRAP(dbg)
! 	pushl $0; BPTTRAP(T_TRCTRAP)
  IDTVEC(nmi)
  	pushl $0; TRAP(T_NMI)
  IDTVEC(bpt)
  	BDBTRAP(bpt)
! 	pushl $0; BPTTRAP(T_BPTFLT)
  IDTVEC(ofl)
  	pushl $0; TRAP(T_OFLOW)
--- 139,148 ----
  IDTVEC(dbg)
  	BDBTRAP(dbg)
! 	pushl $0; TRAP(T_TRCTRAP)
  IDTVEC(nmi)
  	pushl $0; TRAP(T_NMI)
  IDTVEC(bpt)
  	BDBTRAP(bpt)
! 	pushl $0; TRAP(T_BPTFLT)
  IDTVEC(ofl)
  	pushl $0; TRAP(T_OFLOW)
diff -c2 machdep.c~ machdep.c
*** machdep.c~	Thu Oct 31 22:03:44 1996
--- machdep.c	Sat Nov  2 12:52:14 1996
***************
*** 1041,1047 ****
  		setidt(x, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(0, &IDTVEC(div),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
! 	setidt(1, &IDTVEC(dbg),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(2, &IDTVEC(nmi),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
!  	setidt(3, &IDTVEC(bpt),  SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(4, &IDTVEC(ofl),  SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(5, &IDTVEC(bnd),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
--- 1063,1069 ----
  		setidt(x, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(0, &IDTVEC(div),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
! 	setidt(1, &IDTVEC(dbg),  SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(2, &IDTVEC(nmi),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
!  	setidt(3, &IDTVEC(bpt),  SDT_SYS386IGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(4, &IDTVEC(ofl),  SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(5, &IDTVEC(bnd),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611050456.PAA10694>