From: Chris Wright Subject: Re: PCI passthrough resource remapping Date: Tue, 30 Mar 2010 16:58:38 -0700 Message-ID: <20100330235838.GU11934@x200.localdomain> References: <3b1f68ef1003251937k52a0faf8t9d2458f7f0f8eaaa@mail.gmail.com> <0BFA936E-BE35-4511-8FD1-B5764FB6EA49@theiggy.com> <3b1f68ef1003291023w533f7000r1ae1fe6a5226c5c3@mail.gmail.com> <3b1f68ef1003291600t1175f794vd3f47cdafca48a8@mail.gmail.com> <20100329234752.GM3204@x200.localdomain> <3b1f68ef1003291721v6fcb01edha4f0424ba0ab24f8@mail.gmail.com> <20100330020805.GS3204@x200.localdomain> <3b1f68ef1003301527p2dd9928alf2f6ead85d678634@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Chris Wright , Alexander Graf , kvm list To: Kenni Lund Return-path: Received: from mx1.redhat.com ([209.132.183.28]:62755 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757513Ab0C3X6s (ORCPT ); Tue, 30 Mar 2010 19:58:48 -0400 Content-Disposition: inline In-Reply-To: <3b1f68ef1003301527p2dd9928alf2f6ead85d678634@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: * Kenni Lund (kenni@kelu.dk) wrote: > 2010/3/30 Chris Wright : > > * Kenni Lund (kenni@kelu.dk) wrote: > >> Client dmesg: http://pastebin.com/uNG4QK5j > >> Host dmesg: http://pastebin.com/jZu3WKZW > >> > >> I just verified it and I do get the call trace in the host (which > >> disables IRQ 19, used by the PCI USB card), exactly at the same se= cond > > > > It looks like IRQ 19 is shared between the ehci controller and the > > ivtv tuner. =A0What do you see in /proc/interrupts on the host (bef= ore > > you unbind and after you bind to pci stub)? >=20 > Ahh, and even if the ivtv module is not loaded, I will still have a > shared IRQ, right? I didn't see ivtv in /proc/interrupts before, as I > unload the ivtv driver on boot in /etc/rc.local, before unbinding the > ivtv tuner and binding it to pci stub. (the ivtv tuner is normally > assigned to the same guest, but not now while testing the PCI USB > card). >=20 > If I don't unload (and unbind/bind) the ivtv driver/tuner on boot in > /etc/local, I get the following in /proc/interrupts on a clean boot: > http://pastebin.com/SFQj58LC >=20 > If I now unbind and bind the PCI USB card to pci stub, I get no > changes in /proc/interrupts. Sorry, I meant bind to pci_stub and launch guest. IOW, you should see kvm_assigned_{msi,msix,intx}_device (from your lspci, I'd expect intx). What's odd is a device is asserting an interrupt to a line w/ no handle= r acking. The IRQ 19, should have kvm handling the interrupt, in which case it'd always return IRQ_HANDLED. And for the case of shared interrupts, we won't let you start the guest with an assigned device that's sharing an interrupt. IOW, we do request_irq() w/out specifying IRQF_SHARED (meaning we want an exclusive irq). > So I suppose I'll need to get rid of this shared IRQ before I can > conclude anything on the patch in git. Hmm, is there some cleaver way > of fixing this in Linux, or do I have to fix it by changing BIOS IRQ > settings, disabling hardware and/or moving the hardware around in > various PCI slots? The way I typically work around this is simply unbinding the driver fro= m the device in the host (and thus freeing the irq). thanks, -chris