Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2011 14:19:29 +0000 (UTC)
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r217055 - stable/8/sys/xen/evtchn
Message-ID:  <201101061419.p06EJTc4017439@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cperciva
Date: Thu Jan  6 14:19:29 2011
New Revision: 217055
URL: http://svn.freebsd.org/changeset/base/217055

Log:
  MFC r216812: Implement xenpic_dynirq_disable_intr and thereby avoid a
  kernel panic when a disk is detached from a XEN system.

Modified:
  stable/8/sys/xen/evtchn/evtchn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/xen/evtchn/evtchn.c
==============================================================================
--- stable/8/sys/xen/evtchn/evtchn.c	Thu Jan  6 14:12:24 2011	(r217054)
+++ stable/8/sys/xen/evtchn/evtchn.c	Thu Jan  6 14:19:29 2011	(r217055)
@@ -628,6 +628,7 @@ static void     xenpic_dynirq_enable_sou
 static void     xenpic_dynirq_disable_source(struct intsrc *isrc, int); 
 static void     xenpic_dynirq_eoi_source(struct intsrc *isrc); 
 static void     xenpic_dynirq_enable_intr(struct intsrc *isrc); 
+static void     xenpic_dynirq_disable_intr(struct intsrc *isrc); 
 
 static void     xenpic_pirq_enable_source(struct intsrc *isrc); 
 static void     xenpic_pirq_disable_source(struct intsrc *isrc, int); 
@@ -647,6 +648,7 @@ struct pic xenpic_dynirq_template  =  { 
 	.pic_disable_source	=	xenpic_dynirq_disable_source,
 	.pic_eoi_source		=	xenpic_dynirq_eoi_source, 
 	.pic_enable_intr	=	xenpic_dynirq_enable_intr, 
+	.pic_disable_intr	=	xenpic_dynirq_disable_intr,
 	.pic_vector		=	xenpic_vector, 
 	.pic_source_pending	=	xenpic_source_pending,
 	.pic_suspend		=	xenpic_suspend, 
@@ -716,6 +718,20 @@ xenpic_dynirq_enable_intr(struct intsrc 
 }
 
 static void 
+xenpic_dynirq_disable_intr(struct intsrc *isrc)
+{
+	unsigned int irq;
+	struct xenpic_intsrc *xp;
+	
+	xp = (struct xenpic_intsrc *)isrc;	
+	mtx_lock_spin(&irq_mapping_update_lock);
+	irq = xenpic_vector(isrc);
+	mask_evtchn(evtchn_from_irq(irq));
+	xp->xp_masked = 1;
+	mtx_unlock_spin(&irq_mapping_update_lock);
+}
+
+static void 
 xenpic_dynirq_eoi_source(struct intsrc *isrc)
 {
 	unsigned int irq;



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