Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 2010 15:17:28 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216679 - head/sys/x86/x86
Message-ID:  <201012231517.oBNFHS5t061337@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Dec 23 15:17:28 2010
New Revision: 216679
URL: http://svn.freebsd.org/changeset/base/216679

Log:
  Drop the icu_lock spinlock while pausing briefly after masking the
  interrupt in the I/O APIC before moving it to a different CPU.  If the
  interrupt had been triggered by the I/O APIC after locking icu_lock but
  before we masked the pin in the I/O APIC, then this could cause the
  interrupt to be pending on the "old" CPU and it would finally trigger
  after we had moved the interrupt to the new CPU.  This could cause us to
  panic as there was no interrupt source associated with the old IDT vector
  on the old CPU.  Dropping the lock after the interrupt is masked but
  before it is moved allows the interrupt to fire and be handled in this
  case before it is moved.
  
  Tested by:	Daniel Braniss  danny of cs huji ac il
  MFC after:	1 week

Modified:
  head/sys/x86/x86/io_apic.c

Modified: head/sys/x86/x86/io_apic.c
==============================================================================
--- head/sys/x86/x86/io_apic.c	Thu Dec 23 03:12:03 2010	(r216678)
+++ head/sys/x86/x86/io_apic.c	Thu Dec 23 15:17:28 2010	(r216679)
@@ -359,7 +359,9 @@ ioapic_assign_cpu(struct intsrc *isrc, u
 	if (!intpin->io_masked && !intpin->io_edgetrigger) {
 		ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
 		    intpin->io_lowreg | IOART_INTMSET);
+		mtx_unlock_spin(&icu_lock);
 		DELAY(100);
+		mtx_lock_spin(&icu_lock);
 	}
 
 	intpin->io_cpu = apic_id;



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