xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Simon Graham <simon.graham@virtualcomputer.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Thomas Goetz <tcgoetz@gmail.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: Re: Losing PS/2 Interrupts
Date: Tue, 24 May 2011 16:40:38 +0100	[thread overview]
Message-ID: <4DDBED9602000078000433EA@vpn.id2.novell.com> (raw)
In-Reply-To: <20110524125816.GA10017@dumpdata.com>

>>> On 24.05.11 at 14:58, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Tue, May 24, 2011 at 01:24:24PM +0100, Jan Beulich wrote:
>> >>> On 24.05.11 at 13:04, Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>> wrote:
>> > On Tue, 24 May 2011, Jan Beulich wrote:
>> >> > Relevant code snippets included below:
>> >> > 
>> >> >         if (pirq_needs_eoi(irq)) {
>> >> >                 printk(KERN_ERR "%s: irq %d handle_fasteoi_irq\n", 
>> >> > __FUNCTION__, irq);
>> >> >                 set_irq_chip_and_handler_name(irq, &xen_pirq_chip,
>> >> >                                 handle_fasteoi_irq, name);
>> >> >         } else {
>> >> >                 printk(KERN_ERR "%s: irq %d handle_edge_irq\n", 
>> >> > __FUNCTION__, irq);
>> >> >                 set_irq_chip_and_handler_name(irq, &xen_pirq_chip,
>> >> >                                 handle_edge_irq, name);
>> >> >         }
>> >> 
>> >> Now this, imo, is a very good reason to not use handle_edge_irq()
>> >> at all, and instead use the prior control flow (masking and clearing
>> >> the event channel up front in do_upcall()) with only fasteoi (leaving
>> >> aside per-CPU ones).
>> >> 
>> > 
>> > Actually I think it is a good reason to fix pirq_needs_eoi that shouldn't
>> > return unconditionally yes if dom0 doesn't support pirq_eoi_map.
>> > The comment in Xen 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.
>> >      */
>> > 
>> > Considering that I would rather avoid supporting pirq_eoi_map and we are
>> > talking about edge triggered interrupts, do you think it would be safe
>> > for me to send a patch to xen to change this behaviour?
>> > Shouldn't we set XENIRQSTAT_needs_eoi only for level triggered
>> > interrupts (and maybe maskable MSI sources)?
>> 
>> Only if you can prove that the very first part of that comment is
>> incorrect (in including "edge-triggered" and ignoring whether MSI
>> sources are maskable). And your Linux side code would then still
>> be incorrect for maskable MSIs (you'd continue to handle them
>> as fasteoi with no up front clearing/masking while that is necessary
>> as Thomas' report made clear).
> 
> I believe we handle MSI's as 'handle_edge_chip' (xen_bind_pirq_msi_to_irq)
> irregardless of the above hypercall.

So how do you issue the possibly necessary EOI call then?

> You wouldn't have a nice chart of the right type of events to
> do for different types of interrupts, would you?

No, sorry - all I usually look at are the three more or less different
implementations.

Jan

>> 
>> What's so wrong with pirq_eoi_map that you're trying to avoid it
>> by all means?
> 
> My recollection is that we had a hard time trying to work it in with the
> tglr'x rewrite of the IRQ code and not enough understanding of this (at 
> least
> on my side). Any help here would be appreciated.

  reply	other threads:[~2011-05-24 15:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 21:45 Losing PS/2 Interrupts Thomas Goetz
2011-05-20 15:53 ` Thomas Goetz
2011-05-20 17:50   ` Konrad Rzeszutek Wilk
2011-05-20 18:06     ` Thomas Goetz
2011-05-23  8:26       ` Jan Beulich
2011-05-23 12:09         ` Thomas Goetz
2011-05-23 13:02           ` Jan Beulich
2011-05-23 13:45           ` Stefano Stabellini
2011-05-23 17:16             ` Thomas Goetz
2011-05-23 17:28               ` Thomas Goetz
2011-05-23 18:39                 ` Thomas Goetz
2011-05-24 13:53                   ` Stefano Stabellini
2011-05-24 15:37                     ` Thomas Goetz
2011-05-24 15:58                       ` Stefano Stabellini
2011-05-24  9:07                 ` Jan Beulich
2011-05-24 11:04                   ` Stefano Stabellini
2011-05-24 12:24                     ` Jan Beulich
2011-05-24 12:58                       ` Konrad Rzeszutek Wilk
2011-05-24 15:40                         ` Jan Beulich [this message]
2011-05-24 16:00                           ` Stefano Stabellini
2011-05-24 13:52                       ` Stefano Stabellini
2011-05-24 15:37                         ` Jan Beulich
2011-05-24 16:35                           ` Stefano Stabellini

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=4DDBED9602000078000433EA@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=konrad.wilk@oracle.com \
    --cc=simon.graham@virtualcomputer.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tcgoetz@gmail.com \
    --cc=xen-devel@lists.xensource.com \
    /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).