NetBSD Problem Report #45160

From jakllsch@trantor.kollasch.net  Wed Jul 20 01:48:21 2011
Return-Path: <jakllsch@trantor.kollasch.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 0F59763BA8C
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 20 Jul 2011 01:48:21 +0000 (UTC)
Message-Id: <20110720014818.DF80C90A2A@trantor.kollasch.net>
Date: Wed, 20 Jul 2011 01:48:18 +0000 (UTC)
From: jakllsch@kollasch.net
Reply-To: jakllsch@kollasch.net
To: gnats-bugs@gnats.NetBSD.org
Subject: 8259 PIC masking in IOAPIC mode
X-Send-Pr-Version: 3.95

>Number:         45160
>Category:       port-i386
>Synopsis:       8259 PICs need to be masked when switching to IOAPIC
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 20 01:50:00 +0000 2011
>Closed-Date:    
>Last-Modified:  Fri Sep 14 21:00:03 +0000 2012
>Originator:     Jonathan A. Kollasch
>Release:        NetBSD 5.99.54
>Organization:

>Environment:


System: NetBSD trantor.kollasch.net 5.99.54 NetBSD 5.99.54 (TRANTOR) #0: Fri Jul 8 21:51:39 CDT 2011 jakllsch@trantor.kollasch.net:/local/jakllsch/nbsd-head/build-amd64/objdir/sys/arch/amd64/compile/TRANTOR amd64
Architecture: x86_64
Machine: amd64
>Description:
Leaving the 8259 PIC interrupts unmasked while using the IOAPIC causes spurious interrupts that somehow lead to hardware deadlock.
>How-To-Repeat:
Run NetBSD on a recent ASUS AMD board/box.
>Fix:
Mask the 8259 PIC interrupts when switching to the IOAPIC.

>Release-Note:

>Audit-Trail:

From: Jukka Ruohonen <jruohonen@iki.fi>
To: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
Cc: gnats-bugs@NetBSD.org
Subject: Re: port-i386/45160: 8259 PICs need to be masked when switching to IOAPIC
Date: Wed, 20 Jul 2011 07:37:35 +0300

 On Wed, Jul 20, 2011 at 01:59:00AM +0000, Jonathan A. Kollasch wrote:
 > Leaving the 8259 PIC interrupts unmasked while using the IOAPIC causes
 > spurious interrupts that somehow lead to hardware deadlock.

 Aren't these already masked by default in the current implementation?

From: "Jonathan A. Kollasch" <jakllsch@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45160 CVS commit: src/sys/arch/x86/x86
Date: Mon, 30 Jan 2012 16:44:23 +0000

 Module Name:	src
 Committed By:	jakllsch
 Date:		Mon Jan 30 16:44:23 UTC 2012

 Modified Files:
 	src/sys/arch/x86/x86: ioapic.c

 Log Message:
 Mask all i8259 interrupts in ioapic_enable().
 Should fix PR kern/45160.


 To generate a diff of this commit:
 cvs rdiff -u -r1.45 -r1.46 src/sys/arch/x86/x86/ioapic.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/45160 CVS commit: src/sys/arch/x86/x86
Date: Thu, 2 Feb 2012 20:03:43 -0500

 On Mon, 30 Jan 2012 16:45:02 +0000 (UTC)
 "Jonathan A. Kollasch" <jakllsch@netbsd.org> wrote:

 >  Modified Files:
 >  	src/sys/arch/x86/x86: ioapic.c
 >  
 >  Log Message:
 >  Mask all i8259 interrupts in ioapic_enable().
 >  Should fix PR kern/45160.

 I confirm that my netbsd-5 and -current systems are more stable on
 amd64 after this fix.  It probably also deserves a pullup?

 Thanks,
 -- 
 Matt

From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/45160 CVS commit: src/sys/arch/x86/x86
Date: Mon, 26 Mar 2012 17:33:21 -0400

 On Fri,  3 Feb 2012 01:05:03 +0000 (UTC)
 Matthew Mondor <mm_lists@pulsar-zone.net> wrote:

 >  I confirm that my netbsd-5 and -current systems are more stable on
 >  amd64 after this fix.  It probably also deserves a pullup?

 I checked and netbsd-6 already has this fix as well, but not netbsd-5
 -- 
 Matt

State-Changed-From-To: open->pending-pullups
State-Changed-By: jakllsch@NetBSD.org
State-Changed-When: Sun, 01 Apr 2012 14:26:49 +0000
State-Changed-Why:
pullup-5 #1747


From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45160 CVS commit: [netbsd-5] src/sys/arch/x86/x86
Date: Sat, 21 Apr 2012 16:00:47 +0000

 Module Name:	src
 Committed By:	riz
 Date:		Sat Apr 21 16:00:47 UTC 2012

 Modified Files:
 	src/sys/arch/x86/x86 [netbsd-5]: ioapic.c

 Log Message:
 Pull up following revision(s) (requested by jakllsch in ticket #1747):
 	sys/arch/x86/x86/ioapic.c: revision 1.46
 	sys/arch/x86/x86/ioapic.c: revision 1.47
 Mask all i8259 interrupts in ioapic_enable().
 Should fix PR kern/45160.
 Need i8259.h for previous.


 To generate a diff of this commit:
 cvs rdiff -u -r1.38.6.1 -r1.38.6.2 src/sys/arch/x86/x86/ioapic.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 22 Apr 2012 17:44:54 +0000
State-Changed-Why:
pulled up.


From: steve@mctavish.co.uk
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: Fix for kern/45160 breaks interrupts under Qemu
Date: Fri, 14 Sep 2012 21:29:40 +0100 (BST)

 >Submitter-Id:	net
 >Originator:	Steve Woodford
 >Organization:
 >Confidential:	no
 >Synopsis:	Fix for kern/45160 breaks interrupts under Qemu
 >Severity:	serious
 >Priority:	medium
 >Category:	port-amd64
 >Class:		sw-bug
 >Release:	NetBSD 5.1_STABLE
 >Environment:
 System: NetBSD horace.mctavish.co.uk 5.1_STABLE NetBSD 5.1_STABLE (SCW_HORACE) #0: Mon Mar 7 08:02:28 GMT 2011 steve@horace.mctavish.co.uk:/export/netbsd/local/netbsd/sys/arch/amd64/compile/SCW_HORACE amd64
 Architecture: x86_64
 Machine: amd64
 >Description:
 It is no longer possible to boot a kernel (from -current back to netbsd-5)
 under Qemu (and that includes Virtual Private Servers offered by various
 hosting companies) due to the change introduced by kern/45160.
 >How-To-Repeat:
 Boot any recent kernel (including NetBSD/amd64 5.1_STABLE) under Qemu.
 Observe the following when the system attempts to read the MBR of wd0:

 wd0 at atabus0 drive 0wdc0:0:0: lost interrupt
 	type: ata tc_bcount: 512 tc_skip: 0
 : <QEMU HARDDISK>
 wd0: 51200 MB, 104025 cyl, 16 head, 63 sec, 512 bytes/sect x 104857600 sectors
 wdc0:0:0: lost interrupt
 	type: ata tc_bcount: 512 tc_skip: 0
 wdc0:0:0: lost interrupt
 ...

 The above is repeated pretty much ad-nausea; the system fails to boot.
 >Fix:
 The naive fix is to delete the "i8259_setmask(0xffff);" call in
 ioapic_reenable() introduced in sys/arch/x86/x86/ioapic.c:1.46.

 This will obviously undo the fix for kern/45160, so someone more familiar
 with x86 interrupt controllers will have to determine the best course
 of action.

State-Changed-From-To: closed->open
State-Changed-By: scw@NetBSD.org
State-Changed-When: Fri, 14 Sep 2012 21:49:56 +0100
State-Changed-Why:
Changed state to open, because Gnats filed my report back into this
bug rather than create a new bug. (Serves me right for mentioning
kern/45160 in the Subject field.).


From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-i386/45160 (8259 PICs need to be masked when switching to IOAPIC)
Date: Fri, 14 Sep 2012 21:49:23 +0100

 On Fri, Sep 14, 2012 at 08:49:58PM +0000, scw@NetBSD.org wrote:
 > Synopsis: 8259 PICs need to be masked when switching to IOAPIC

 I think the same change stops netbsd-5 (but not current) running
 under bochs.

 The problem arises when the disks 'fall back' onto the old
 'ISA' interrupts even though the IOAPIC is defined.

 	David

 -- 
 David Laight: david@l8s.co.uk

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.