xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>, Tom Kopec <tek@acm.org>,
	Daniel Stodden <daniel.stodden@citrix.com>
Subject: Re: Using handle_fasteoi_irq for pirqs
Date: Tue, 07 Sep 2010 09:58:40 +0100	[thread overview]
Message-ID: <4C861AE00200007800014A67@vpn.id2.novell.com> (raw)
In-Reply-To: <4C85F1A0.5090308@goop.org>

 >>> On 07.09.10 at 10:02, Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> On 09/07/2010 04:58 PM, Jan Beulich wrote:
> 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?

That would seem possible, yes.

> 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?

Just look at the places where set_pirq_eoi() gets called in
xen/arch/x86/irq.c: The flag (obviously) always gets set for IRQs
that aren't ACKTYPE_NONE, but there is an additional case in
__do_IRQ_guest() where Xen wants the notification to re-enable
the interrupt after disabling it due to all possible handler domains
having it pending already.

And you see that Xen would force you to always execute the EOI
notification hypercall without the shared page
(PHYSDEVOP_irq_status_query setting XENIRQSTAT_needs_eoi
unconditionally), so using it you save a hypercall on each interrupt
that doesn't need an EOI (namely MSI-X and maskable MSI; I don't
think edge triggered ones are very important), and if you (as usual)
don't need to unmask via hypercall, you don't need any hypercall
at all in the IRQ exit path in these cases.

>> 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.

And it should similarly be fine with handle_fasteoi_irq() afaict,
provided .end and .eoi reference the same function.

The asymmetry was part of what made me change .disable to
alias .shutdown.

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

Honestly, I don't know. Keir?

Jan

      reply	other threads:[~2010-09-07  8:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 21:35 [GIT PULL] Fix lost interrupt race in Xen event channels Jeremy Fitzhardinge
2010-08-25  7:52 ` [Xen-devel] " Jan Beulich
2010-08-25 10:04   ` Daniel Stodden
2010-08-25 11:24     ` Jan Beulich
2010-08-25 17:54   ` Jeremy Fitzhardinge
2010-08-26  6:46     ` Jan Beulich
2010-08-26 16:32       ` Jeremy Fitzhardinge
2010-08-27  8:56         ` Jan Beulich
2010-08-27 20:43           ` Daniel Stodden
2010-08-27 21:49             ` Daniel Stodden
2010-08-27 23:43             ` Jeremy Fitzhardinge
2010-08-30  8:03             ` Jan Beulich
2010-08-30  8:43               ` Jan Beulich
2010-08-30  8:48                 ` Keir Fraser
2010-08-30  9:06                   ` Jan Beulich
2010-08-30  9:15                     ` Keir Fraser
2010-08-30  9:22                       ` Jan Beulich
2010-08-30 16:36               ` Jeremy Fitzhardinge
2010-08-31  6:38                 ` Jan Beulich
2010-09-03 18:46   ` Using handle_fasteoi_irq for pirqs Jeremy Fitzhardinge
2010-09-06  7:58     ` Jan Beulich
2010-09-07  1:53       ` Jeremy Fitzhardinge
2010-09-07  6:58         ` Jan Beulich
2010-09-07  8:02           ` Jeremy Fitzhardinge
2010-09-07  8:58             ` Jan Beulich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C861AE00200007800014A67@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=daniel.stodden@citrix.com \
    --cc=jeremy@goop.org \
    --cc=keir.fraser@eu.citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=tek@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).