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

[Xen-devel] Re: Using handle_fasteoi_irq for pirqs

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: [Xen-devel] Re: Using handle_fasteoi_irq for pirqs
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 07 Sep 2010 18:02:40 +1000
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>, Tom Kopec <tek@xxxxxxx>, Daniel Stodden <daniel.stodden@xxxxxxxxxx>
Delivery-date: Tue, 07 Sep 2010 01:03:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C85FED10200007800014A0C@xxxxxxxxxxxxxxxxxx>
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: <4C743B2C.8070208@xxxxxxxx> <4C74E7C802000078000120C0@xxxxxxxxxxxxxxxxxx> <4C814278.5070904@xxxxxxxx> <4C84BB580200007800014717@xxxxxxxxxxxxxxxxxx> <4C859B27.6000400@xxxxxxxx> <4C85FED10200007800014A0C@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Lightning/1.0b2pre Thunderbird/3.1.2
 On 09/07/2010 04:58 PM, Jan Beulich wrote:
>> Yes, but there's also PHYSDEVOP_irq_status_query call.  Does the "needs
>> EOI" actually change from moment to moment in a way where having a
>> shared page makes sense?
> No, it doesn't - using this function you can of course maintain the
> bitmap on your own (which we also fall back to if PHYSDEVOP_pirq_eoi_gmfn
> is not supported by the hypervisor). The actual advantage of using
> PHYSDEVOP_pirq_eoi_gmfn is that it implies an unmask of the
> corresponding event channel - see
> http://xenbits.xensource.com/xen-unstable.hg?rev/c820bf73a914.

Yes, though it seems like an odd way of implementing it.  The shared
memory region for EOI flags looks like overkill when all it saves is one
hypercall on pirq setup, and making that also have the side-effect of
changing an existing hypercall's behaviour is surprising.  Too late now,
I suppose, but it would seem that just adding a new PHYSDEVOP_eoi_unmask
hypercall would have been a simpler approach.  (But unmask typically
doesn't need a hypercall anyway, unless you've managed to get into a
cross-cpu unmask situation, so it doesn't seem like a big saving?)

Also, in the restore path, the code does a BUG if it fails to call
PHYSDEVOP_pirq_eoi_gmfn again.  Couldn't it just clear
pirq_eoi_does_unmask (and re-initialize all the needs-eoi flags using
PHYSDEVOP_irq_status_query) and carry on the old way?

But the comment in PHYSDEVOP_irq_status_query says:

        /*
         * Even edge-triggered or message-based IRQs can need masking from
         * time to time. If teh guest is not dynamically checking for this
         * via the new pirq_eoi_map mechanism, it must conservatively always
         * execute the EOI hypercall. In practice, this only really makes a
         * difference for maskable MSI sources, and if those are supported
         * then dom0 is probably modern anyway.
         */

which suggests that the "needs EOI" status for each pirq can change
after the pirq has been initialized (or if not, why isn't using
PHYSDEVOP_irq_status_query sufficient?).  OTOH, if it can change
spontaneously, then it all seems a bit racy...

IOW, what does "from time to time" mean?

> Also, regarding your earlier question on .disable - I just ran across
> http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/51b2b0d0921c,
> which makes me think that .enable indeed should remain an alias of
> .startup, but I also think that .disable should nevertheless do the
> masking (i.e. be an alias of .mask)

That particular change has the strange asymmetry of making .enable do a
startup (which only does eoi if the event channel is still valid),
.disable a no-op, and .end shuts the pirq down iff the irq is pending
and disabled.  I see how this works in the context of the old __do_IRQ
stuff in 2.6.18 though.

What's the specific deadlock mentioned in the commit comment?  Is that
still an issue with Xen's auto-EOI-after-timeout behaviour?

Thanks,
    J

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