All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: IO-APIC interrupts getting stuck
Date: Mon, 22 Dec 2014 19:43:44 +0100	[thread overview]
Message-ID: <54986660.5080703@citrix.com> (raw)
In-Reply-To: <5492BD4C0200007800050873@mail.emea.novell.com>

El 18/12/14 a les 11.41, Jan Beulich ha escrit:
>>>> On 17.12.14 at 13:51, <roger.pau@citrix.com> wrote:
>> I've also added the following patch to Xen, and it reliably triggers on 
>> FreeBSD, while it seems to work fine on Linux:
>>
>> --- a/xen/arch/x86/io_apic.c
>> +++ b/xen/arch/x86/io_apic.c
>> @@ -1729,6 +1729,8 @@ static void end_level_ioapic_irq_new(struct irq_desc *desc, u8 vector)
>>   * The idea is from Manfred Spraul.  --macro
>>   */
>>      unsigned int v, i = desc->arch.vector;
>> +    struct IO_APIC_route_entry rte;
>> +    struct irq_pin_list *entry = irq_2_pin + desc->irq;
>>  
>>      /* Manually EOI the old vector if we are moving to the new */
>>      if ( vector && i != vector )
>> @@ -1751,6 +1753,9 @@ static void end_level_ioapic_irq_new(struct irq_desc *desc, u8 vector)
>>              __unmask_IO_APIC_irq(desc->irq);
>>          spin_unlock(&ioapic_lock);
>>      }
>> +
>> +    rte = ioapic_read_entry(entry->apic, entry->pin, 0);
>> +    ASSERT(rte.irr == 0 || rte.mask != 0);
> 
> Could you arrange for you to be able to determine which code
> paths were taken in the routine when the ASSERT() triggers? I.e.
> minimally make sure vector, i, and v can be determined from the
> printed registers and stack contents. Plus maybe also read the
> applicable APIC_I[RS]R bits.

OK, this was misleading. The ASSERT I've added triggers on Linux also
but it doesn't lead to the irr=1 mask=0 blocked state, so I think
returning from end_level_ioapic_irq_new with irr=1 and mask=0 is a valid
state, is this right?

I've also tested with the following patch applied:

http://lists.xenproject.org/archives/html/xen-devel/2014-12/msg01816.html

To make sure FreeBSD was not playing tricks behind Xen's back, and
AFAICT FreeBSD is not touching the IO APIC at all. Also Xen doesn't show
any pending EOI timers ('a' debug key).

> And you're also apparently not seeing this on a system where
> Linux'es IO-APIC re-route workaround might come into play (see
> drivers/pci/quirks.c:quirk_reroute_to_boot_interrupts_intel()),
> which then I would have suspected FreeBSD to not have such a
> workaround...

No, the same box I have with Linux doesn't use the IO-APIC re-route
quirk. I've also tested this on different hardware and when using
FreeBSD with the new IO APIC Ack method I always end up in this stuck
state, so I don't think it's a hardware errata/issue.

Roger.

  reply	other threads:[~2014-12-22 18:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16 17:34 IO-APIC interrupts getting stuck Roger Pau Monné
2014-12-16 17:59 ` Andrew Cooper
2014-12-17 11:40   ` Roger Pau Monné
2014-12-17 12:51   ` Roger Pau Monné
2014-12-18 10:41     ` Jan Beulich
2014-12-22 18:43       ` Roger Pau Monné [this message]
2015-01-02 16:20         ` Jan Beulich
2015-01-15 10:28           ` Roger Pau Monné
2015-01-05  8:50         ` Jan Beulich
2015-01-05 10:14           ` Roger Pau Monné

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=54986660.5080703@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.