Re: [PATCH 1/1] KVM: Fix potentially recursively get kvm lock

Alex Williamson
2009-05-22T15:34:31Z

On Fri, 2009-05-22 at 08:06 -0700, Chris Wright wrote:
> * Alex Williamson (alex.williamson@hp.com) wrote:
> > On Tue, 2009-05-12 at 19:09 -0300, Marcelo Tosatti wrote:
> > > KVM: workaround workqueue / deassign_host_irq deadlock
> > >
> > > I think I'm running into the following deadlock in the kvm kernel module
> > > when trying to use device assignment:
> > >
> > > CPU A CPU B
> > > kvm_vm_ioctl_deassign_dev_irq()
> > > mutex_lock(&kvm->lock); worker_thread()
> > > -> kvm_deassign_irq() ->
> > > kvm_assigned_dev_interrupt_work_handler()
> > > -> deassign_host_irq() mutex_lock(&kvm->lock);
> > > -> cancel_work_sync() [blocked]
> > >
> > > Workaround the issue by dropping kvm->lock for cancel_work_sync().
>
> Is this still pending?

I haven't seen this particular workaround make it into a tree, however
Marcelo has been working on a set of patches to properly fix this. Most
recent version was sent on 5/20.

Alex