WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH][RFC] pv-ops: fix shared irq device passthrough

To: 'Jeremy Fitzhardinge' <jeremy@xxxxxxxx>, 'Konrad Rzeszutek Wilk' <konrad.wilk@xxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH][RFC] pv-ops: fix shared irq device passthrough
From: "Han, Weidong" <weidong.han@xxxxxxxxx>
Date: Thu, 12 Nov 2009 15:15:57 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Kay, Allen M" <allen.m.kay@xxxxxxxxx>, "'keir.fraser@xxxxxxxxxxxxx'" <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Wed, 11 Nov 2009 23:16:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4AF9B4AB.9060302@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <715D42877B251141A38726ABF5CABF2C05509A75F3@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4AE60646.7050307@xxxxxxxx> <715D42877B251141A38726ABF5CABF2C05509A7C3A@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4AEA1D82.8060609@xxxxxxxx> <715D42877B251141A38726ABF5CABF2C0550A02DAD@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4AEB5BF9.20307@xxxxxxxx> <715D42877B251141A38726ABF5CABF2C055064A406@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <715D42877B251141A38726ABF5CABF2C0550A64B6C@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <715D42877B251141A38726ABF5CABF2C05534DC58B@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20091110163058.GB23000@xxxxxxxxxxxxxxxxxxx> <4AF9B4AB.9060302@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcpiNeuwlKUqVfbDS1azI6IX4kbEAABMGUSw
Thread-topic: [Xen-devel] [PATCH][RFC] pv-ops: fix shared irq device passthrough
Jeremy Fitzhardinge wrote:
> On 11/10/09 08:30, Konrad Rzeszutek Wilk wrote:
>> 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? 
>> 

Konrad,

You listed and analysed code path of handle_level_irq in another mail, but you 
miss following lines in note_interrupt:

        if (time_after(jiffies, desc->last_unhandled + HZ/10))
                desc->irqs_unhandled = 1; 
        else
                desc->irqs_unhandled++;

I found time_after will return true when assigned the shared irq device to hvm, 
then it doesn't complain too many unhandled IRQs. So it's no problem when 
passthrough shared IRQ NIC and USB controller, but i'm not sure it can cover 
all cases.

Actually, it's supported in Xen with 2.6.18 dom0 for a long time. We doesn't 
see problem. 

Regards,
Weidong

> 
> It would be easy to add a dummy handler which always returns
> IRQ_HANDLED for every cross-domain shared interrupt to prevent this. 
> Of course that would paper over any real spurious/screaming interrupt
> problem, but we could add some extra logic into the dummy handler if
> necessary. 
> 
> I merged the patch, and had to add the new parameter to
> xen_allocate_pirq() in arch/x86/pci/xen.c.  I just made it 0 which
> should have no functional difference from before, but I'll leave it to
> you to decide what it really should be.
> 
>     J


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel