From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH][RFC] pv-ops: fix shared irq device passthrough Date: Tue, 10 Nov 2009 11:30:58 -0500 Message-ID: <20091110163058.GB23000@phenom.dumpdata.com> References: <715D42877B251141A38726ABF5CABF2C05509A75F3@pdsmsx503.ccr.corp.intel.com> <4AE60646.7050307@goop.org> <715D42877B251141A38726ABF5CABF2C05509A7C3A@pdsmsx503.ccr.corp.intel.com> <4AEA1D82.8060609@goop.org> <715D42877B251141A38726ABF5CABF2C0550A02DAD@pdsmsx503.ccr.corp.intel.com> <4AEB5BF9.20307@goop.org> <715D42877B251141A38726ABF5CABF2C055064A406@pdsmsx503.ccr.corp.intel.com> <715D42877B251141A38726ABF5CABF2C0550A64B6C@pdsmsx503.ccr.corp.intel.com> <715D42877B251141A38726ABF5CABF2C05534DC58B@pdsmsx503.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <715D42877B251141A38726ABF5CABF2C05534DC58B@pdsmsx503.ccr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Han, Weidong" Cc: 'Jeremy Fitzhardinge' , "'xen-devel@lists.xensource.com'" , "Kay, Allen M" , "'keir.fraser@eu.citrix.com'" List-Id: xen-devel@lists.xenproject.org On Tue, Nov 10, 2009 at 02:12:03PM +0800, Han, Weidong wrote: > Jeremy, > > Any comments? With this patch you can share the PCI devices on the same IRQ, correct? Will this mean that you can assign to a guest a USB controller, while Dom0 has controller of the PCI NIC (and assuming that both of those share the same interrupt line)? If so, won't the Dom0 start throwing a fit b/c there are unhandled IRQs and eventually disable the IRQ line? Or even the guest decide that there are too many IRQs and decided to disable the IRQ line? > Instead of changing kernel __setup_irq and use probing_irq to determine if pirq is shareable or not, I changed to set shareable flag in irq_info according to trigger mode in xen_allocate_pirq. Set level triggered interrupts shareable. This patch doesn't touch kernel IRQ code, it only changes xen related code. Do you think it is reasonable? Attached the patch. > > Jeremy Fitzhardinge wrote: .. snip .. > >>> All devices will call probing_irq in startup_pirq, which bind pirq > >>> to event channel. But now probing_irq always returns false, then all > >>> pirqs are not shareable. In my system, a PCI NIC, an USB controller > >>> and an IDE interface device share the same IRQ 18. Because above > >>> reason, pirq 18 is set not shareable. So when I hide the PCI NIC, > >>> and assign it to guest, it fails in guest_bind_pirq, therefore the > >>> PCI NIC in guest cannot work, even impact the devices who share the > >>> IRQ 18. > >>> > >>> If don't want to change __setup_irq code like my patch does, current > >>> probing_irq is useless (always return false). The problem is there > >>> is almost no information in desc can be used in probing_irq if > >>> desc->action is NULL. Keir, do you have any ideas?