From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] KVM: Fix possible circular locking in kvm_vm_ioctl_assign_device() Date: Mon, 14 Dec 2009 17:12:33 -0200 Message-ID: <20091214191233.GA6065@amt.cnet> References: <1260176284-4858-1-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:20051 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932420AbZLNTMl (ORCPT ); Mon, 14 Dec 2009 14:12:41 -0500 Content-Disposition: inline In-Reply-To: <1260176284-4858-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 07, 2009 at 04:58:04PM +0800, Sheng Yang wrote: > One possible order is: > > KVM_CREATE_IRQCHIP ioctl(took kvm->lock) -> kvm_iobus_register_dev() -> > down_write(kvm->slots_lock). > > The other one is in kvm_vm_ioctl_assign_device(), which take kvm->slots_lock > first, then kvm->lock. > > Observe it due to kernel locking debug warnings. Sheng, Looks good. Can you also update the comment on top of kvm_main.c?