From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: KVM host kernel hang Date: Wed, 07 Jan 2009 15:53:41 +0200 Message-ID: <4964B3E5.7010400@redhat.com> References: <4964693A.3010107@suse.de> <496480B8.3070608@redhat.com> <6504B602-6B3F-4095-A86D-9246423015E0@suse.de> <4964AA26.2070406@redhat.com> <4964B0F5.1030500@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" , Joerg Roedel To: Alexander Graf Return-path: Received: from mx2.redhat.com ([66.187.237.31]:57455 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbZAGNxr (ORCPT ); Wed, 7 Jan 2009 08:53:47 -0500 In-Reply-To: <4964B0F5.1030500@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Alexander Graf wrote: > Avi Kivity wrote: > >> Alexander Graf wrote: >> >>> I have CONFIG_LOCKDEP_SUPPORT=y. How do I make it detect that it's >>> actually locking itself up? >>> Btw: The issue seems to be easily reproducible :-) >>> >> Perhaps CONFIG_PROVE_LOCKING and CONFIG_LOCKDEP. _SUPPORT just >> indicates the arch can do it if you want, IIUC. >> > > I just added some debug #define's to show me where exactly things break. > > > Jan 7 14:34:46 linux-dp8n kernel: 2149: Grabbing lock { > Jan 7 14:34:46 linux-dp8n kernel: 1908: Grabbing lock { > > 2145 mmio: > 2146 /* > 2147 * Is this MMIO handled locally? > 2148 */ > 2149 mutex_lock(&vcpu->kvm->lock); > 2150 mmio_dev = vcpu_find_mmio_dev(vcpu, gpa, bytes, 0); > 2151 if (mmio_dev) { > 2152 kvm_iodevice_read(mmio_dev, gpa, bytes, val); > 2153 mutex_unlock(&vcpu->kvm->lock); > 2154 return X86EMUL_CONTINUE; > 2155 } > 2156 mutex_unlock(&vcpu->kvm->lock); > > The lock was lost here. But how? > 1901 case KVM_IRQ_LINE: { > 1902 struct kvm_irq_level irq_event; > 1903 > 1904 r = -EFAULT; > 1905 if (copy_from_user(&irq_event, argp, sizeof > irq_event)) > 1906 goto out; > 1907 if (irqchip_in_kernel(kvm)) { > 1908 mutex_lock(&kvm->lock); > 1909 kvm_set_irq(kvm, > KVM_USERSPACE_IRQ_SOURCE_ID, > 1910 irq_event.irq, irq_event.level); > 1911 mutex_unlock(&kvm->lock); > 1912 r = 0; > 1913 } > 1914 break; > 1915 } > > This is your hung iothread trying to inject an interrupt. It's waiting for the lost lock. I suggest enabling all the lock debug magic you can find in kconfig. -- error compiling committee.c: too many arguments to function