From yokota@zodiac.mech.utsunomiya-u.ac.jp  Wed May 21 18:25:30 1997
Received: from nasu.utsunomiya-u.ac.jp (nasu.utsunomiya-u.ac.jp [160.12.128.3])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id SAA20301
          for <freebsd-gnats-submit@freebsd.org>; Wed, 21 May 1997 18:20:08 -0700 (PDT)
Received: from outmail.utsunomiya-u.ac.jp (outmail.utsunomiya-u.ac.jp [160.12.196.3]) by nasu.utsunomiya-u.ac.jp (8.8.4+2.7Wbeta4/3.5Wpl3) with ESMTP id KAA15859; Thu, 22 May 1997 10:14:02 +0900 (JST)
Received: from zodiac.mech.utsunomiya-u.ac.jp (5hIFH5qo8S0jvQfJFSTuE8hN2jYSY2O+@zodiac.mech.utsunomiya-u.ac.jp [160.12.33.1]) by outmail.utsunomiya-u.ac.jp (8.8.4+2.7Wbeta4/3.5Wpl3) with ESMTP id KAA31844; Thu, 22 May 1997 10:13:51 +0900 (JST)
Received: from zodiac.mech.utsunomiya-u.ac.jp (zenith.mech.utsunomiya-u.ac.jp [160.12.33.60]) by zodiac.mech.utsunomiya-u.ac.jp (8.7.6+2.6Wbeta7/3.4W/zodiac-May96) with ESMTP
	id KAA19329; Thu, 22 May 1997 10:18:56 +0900 (JST)
Message-Id: <199705220118.KAA19329@zodiac.mech.utsunomiya-u.ac.jp>
Date: Thu, 22 May 1997 10:18:55 +0900
From: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
To: David McNab <mcnab@nas.nasa.gov>
Cc: freebsd-gnats-submit@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp
In-Reply-To: Your message of "Wed, 21 May 1997 10:18:38 MST."
             <199705211718.KAA06269@logos.nas.nasa.gov> 
Subject: Re: PR i386/3462: using a PS/2 mouse causes kernel trap in 2.2.1 
References: <199705190155.KAA13115@zodiac.mech.utsunomiya-u.ac.jp> <199705191735.KAA19865@logos.nas.nasa.gov>
	 <199705210209.LAA23778@zodiac.mech.utsunomiya-u.ac.jp>  <199705211718.KAA06269@logos.nas.nasa.gov> 

>Number:         3660
>Category:       i386
>Synopsis:       Re: PR i386/3462: using a PS/2 mouse causes kernel trap in 2.2.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 21 18:30:01 PDT 1997
>Closed-Date:    Mon Jun 2 16:06:59 PDT 1997
>Last-Modified:  Mon Jun  2 16:10:07 PDT 1997
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: max 
Responsible-Changed-When: Thu May 29 08:16:38 PDT 1997 
Responsible-Changed-Why:  
Misfiled PR.  Apparently, this one was response to another PR. 
State-Changed-From-To: open->closed 
State-Changed-By: yokota 
State-Changed-When: Mon Jun 2 16:06:59 PDT 1997 
State-Changed-Why:  
Misfiled PR. I sent this  as a response to another PR (i386/3462), but 
somehow it was recorded by GNATS as a new PR... 

>Unformatted:
 >|If you are subscribed to freebsd-hackers or freebsd-bugs MLs, you have
 >|already seen our discussion on the trap type 29 on P6.
 >|
 >|What we now know is that APIC on P6 may generate bogus int 15, which
 >|is trap 29 under FreeBSD, under certain circumstances. It may be a
 >|failure of P6 (its APIC, to be more specific) or the MB chip set or
 >|combination of both.
 >
 >Yes, I subscribe to -hackers and followed the thread.
 >
 >|If you could, please report success/failure of the patch, and if
 >|successful, how often you see "stray T_RESERVED trap (ignored)" in
 >|your console.
 >
 >Thanks for the patch; however I have installed NetBSD
 >over my FreeBSD disk at the moment, so I'm afraid I
 >can't test it at the moment.  There are some
 >other people around who are interested in running
 >FreeBSD on the same hardware, so I'll have them apply
 >and I'll let you know what happens.
 >
 >--
 >David McNab
 >work: mcnab@nas.nasa.gov
 >personal: dave@mcnab.org
 
 Here is another patch. This one is cleaner than the previous one.  It
 will modify the following files:
 
 sys/i386/i386/trap.c
 sys/i386/i386/machdep.c
 sys/i386/i386/exception.s
 sys/i386/include/trap.h
 
 (When you try this one, please back out the previous patch first.)
 
 Kazu
 
 --- trap.c-1.93	Sun May  4 18:58:18 1997
 +++ trap.c	Wed May 21 20:08:15 1997
 @@ -310,6 +310,16 @@
  			ucode = T_FPOPFLT;
  			i = SIGILL;
  			break;
 +
 +		case T_RESERVED15:
 +			if (cpu == CPU_686) {
 +				/*
 +				 * APIC on P6 occasionally generates bogus 
 +				 * int 15. Ignore it. XXX
 +				 */
 +				return;
 +			}
 +			break;
  		}
  	} else {
  		/* kernel trap */
 @@ -431,6 +441,7 @@
  		    }
  		  return;
  		}
 +		break;
  #else /* !POWERFAIL_NMI */
  #ifdef DDB
  			/* NMI can be hooked up to a pushbutton for debugging */
 @@ -439,10 +450,20 @@
  				return;
  #endif /* DDB */
  			/* machine/parity/power fail/"kitchen sink" faults */
 -			if (isa_nmi(code) == 0) return;
 -			/* FALL THROUGH */
 +			if (isa_nmi(code) == 0)
 +				return;
 +			break;
  #endif /* POWERFAIL_NMI */
  #endif /* NISA > 0 */
 +		case T_RESERVED15:
 +			if (cpu == CPU_686) {
 +				/*
 +				 * APIC on P6 occasionally generates bogus 
 +				 * int 15. Ignore it. XXX
 +				 */
 +				return;
 +			}
 +			break;
  		}
  
  		trap_fatal(&frame);
 --- exception.s-1.25	Sun May  4 18:58:16 1997
 +++ exception.s	Wed May 21 19:15:08 1997
 @@ -119,6 +119,8 @@
  	pushl $0; TRAP(T_MCHK)
  IDTVEC(rsvd)
  	pushl $0; TRAP(T_RESERVED)
 +IDTVEC(rsvd15)
 +	pushl $0; TRAP(T_RESERVED15)
  IDTVEC(fpu)
  #if NNPX > 0
  	/*
 --- machdep.c-1.239	Sun May  4 18:58:17 1997
 +++ machdep.c	Wed May 21 19:16:09 1997
 @@ -987,7 +987,8 @@
  	IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), IDTVEC(bpt), IDTVEC(ofl),
  	IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm),
  	IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot),
 -	IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align),
 +	IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(rsvd15), 
 +	IDTVEC(fpu), IDTVEC(align),
  	IDTVEC(syscall), IDTVEC(int0x80_syscall);
  
  void
 @@ -1106,7 +1107,7 @@
  	setidt(12, &IDTVEC(stk),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(13, &IDTVEC(prot),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(14, &IDTVEC(page),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 -	setidt(15, &IDTVEC(rsvd),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 +	setidt(15, &IDTVEC(rsvd15),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(16, &IDTVEC(fpu),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(17, &IDTVEC(align), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
  	setidt(18, &IDTVEC(mchk),  SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 --- ../include/trap.h-1.7	Thu Apr 10 23:42:47 1997
 +++ ../include/trap.h	Thu May 22 09:40:30 1997
 @@ -65,7 +65,8 @@
  #define	T_SEGNPFLT	26	/* segment not present fault */
  #define	T_STKFLT	27	/* stack fault */
  #define	T_MCHK		28	/* machine check trap */
 -#define	T_RESERVED	29	/* reserved (unknown) */
 +#define	T_RESERVED15	29	/* stray int 15 */
 +#define	T_RESERVED	30	/* reserved (unknown) */
  
  /* XXX most of the following codes aren't used, but could be. */
  
