From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Subject: Re: xenstored unsafe lock order detected, xlate_proc_name, evtchn_ioctl, port_user_lock Date: Sun, 6 Jun 2010 21:54:01 +0300 Message-ID: <20100606185401.GT17817@reaktio.net> References: <20100606173355.GS17817@reaktio.net> <4C0BDDB0.3000501@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <4C0BDDB0.3000501@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Sun, Jun 06, 2010 at 10:41:04AM -0700, Jeremy Fitzhardinge wrote: > On 06/06/2010 10:33 AM, Pasi K=E4rkk=E4inen wrote: > > Hello, > > > > I just tried the latest xen/stable-2.6.32.x kernel, ie. 2.6.32.15, wi= th Xen 4.0.0, > > and I got this: > > > > http://pasik.reaktio.net/xen/pv_ops-dom0-debug/log-2.6.32.15-pvops-do= m0-xen-stable-x86_64.txt > > =20 >=20 > Does this help? >=20 It gave failing hunks so I had to manually apply it to 2.6.32.15,=20 but it seems to fix that issue. No "unsafe lock order" messages anymore. Thanks! -- Pasi > From 3f5e554f669098c84c82ce75e7577f7e0f3fccde Mon Sep 17 00:00:00 2001 > From: Jeremy Fitzhardinge > Date: Fri, 28 May 2010 15:28:27 -0700 > Subject: [PATCH] xen/evtchn: don't do unbind_from_irqhandler under spin= lock >=20 > unbind_from_irqhandler can end up doing /proc operations, which can't > happen under a spinlock. So before removing the IRQ handler, > disable the irq under the port_user lock (masking the underlying event > channel and making sure the irq handler isn't running concurrently and > won't start running), then remove the handler without the lock. >=20 > Signed-off-by: Jeremy Fitzhardinge >=20 > diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c > index f79ac5c..6a3a129 100644 > --- a/drivers/xen/evtchn.c > +++ b/drivers/xen/evtchn.c > @@ -375,10 +375,12 @@ static long evtchn_ioctl(struct file *file, > break; > } > =20 > - evtchn_unbind_from_user(u, unbind.port); > + disable_irq(irq_from_evtchn(unbind.port)); > =20 > spin_unlock_irq(&port_user_lock); > =20 > + evtchn_unbind_from_user(u, unbind.port); > + > rc =3D 0; > break; > } > @@ -484,11 +486,18 @@ static int evtchn_release(struct inode *inode, st= ruct file *filp) > if (get_port_user(i) !=3D u) > continue; > =20 > - evtchn_unbind_from_user(get_port_user(i), i); > + disable_irq(irq_from_evtchn(i)); > } > =20 > spin_unlock_irq(&port_user_lock); > =20 > + for (i =3D 0; i < NR_EVENT_CHANNELS; i++) { > + if (get_port_user(i) !=3D u) > + continue; > + > + evtchn_unbind_from_user(get_port_user(i), i); > + } > + > kfree(u->name); > kfree(u); > =20 >=20 >=20