mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andi Kleen <ak@suse.de>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	mingo@elte.hu, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, nanhai.zou@intel.com,
	asit.k.mallick@intel.com, keith.packard@intel.com
Subject: Re: [patch] x86_64, irq: check remote IRR bit before migrating level triggered irq
Date: Fri, 18 May 2007 08:19:42 -0600	[thread overview]
Message-ID: <m1wsz6jjsx.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <200705181400.12811.ak@suse.de> (Andi Kleen's message of "Fri, 18 May 2007 14:00:12 +0200")

Andi Kleen <ak@suse.de> writes:

> On Friday 18 May 2007 01:03, Siddha, Suresh B wrote:
>
>> Normally, the EOI generated by local APIC for level trigger interrupt
>> contains vector number. The IOAPIC will take this vector number and
>> search the IOAPIC RTE entries for an entry with matching vector number and
>> clear the remote IRR bit (indicate EOI). However, if the vector number is
>> changed (as in step 3) the IOAPIC will not find the RTE entry when the EOI
>> is received later. This will cause the remote IRR to get stuck causing the
>> interrupt hang (no more interrupt from this RTE).
>
> Does this happen often or did you only see it in some extreme or obscure
> case?

It is obscure.  Someone may have a case that makes it easy to
reproduce but it won't happen frequently.

So we should have enough time to review and fix this carefully,
instead of needing to rush a fix out.

>> +	/*
>> +	 * If the EOI still didn't reach the RTE corresponding to the
>> +	 * level triggered irq, postpone the irq migration to the next
>> +	 * irq arrival event.
>> +	 */
>> +	if (pending_eoi(irq)) {
>> +		irq_desc[irq].status |= IRQ_MOVE_PENDING;
>> +		return;
>
> Other code seems to have similar problems, but we don't have any lock
> protecting that bitmap against parallel updates outside the irq itself, don't 
> we? Perhaps it needs to be all set_bit()

Huh?  The irq lock is sufficient for this.

This is not a code software problem, this is a software hardware
interaction problem.  This is a problem in that there is no way to
guarantee that ioapics see a series of manipulations in the same
order that the cpu issues those manipulations.

In particular the ioapic is seeing the ack after we reprogram
the ioapic, which causes the ioapic to not accept the ack (because
it's vector number changed) and then the ioapic waits forever
for an ack that isn't coming.

The other half of the problem is pending_eoi() is testing a bit in the
hardware that in my experience is not sufficient to guarantee that
the hardware is in a state where action may be taken.

This is a very delicate problem because there is little if any guaranteed
ordering between cpu operations and ioapic operations, especially because
there are two channels of communication the ``apic bus'' and the memory
mapped ioapic registers.  So what happens on one channel has no ordering
requirements of any kind with what happens on the other channel.

Eric

  reply	other threads:[~2007-05-18 14:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-17 23:03 Siddha, Suresh B
2007-05-17 23:58 ` Eric W. Biederman
2007-05-18  0:43   ` Siddha, Suresh B
2007-05-18  0:30 ` Eric W. Biederman
2007-05-18  1:01   ` Siddha, Suresh B
2007-05-18 14:40     ` Eric W. Biederman
2007-05-18 17:30       ` Yinghai Lu
2007-05-18 18:01         ` Eric W. Biederman
2007-05-18 18:09           ` Yinghai Lu
2007-05-18 18:20             ` Eric W. Biederman
2007-05-18 18:07       ` Siddha, Suresh B
2007-05-18 18:28         ` Yinghai Lu
2007-05-18 18:39           ` Siddha, Suresh B
2007-05-18 19:02             ` Eric W. Biederman
2007-05-18 19:18               ` Siddha, Suresh B
2007-05-31  2:50         ` Eric W. Biederman
2007-05-18 12:00 ` Andi Kleen
2007-05-18 14:19   ` Eric W. Biederman [this message]
2007-05-31 11:34 ` [PATCH] x86_64 irq: check remote IRR bit before migrating level triggered irq (v2) Eric W. Biederman
2007-05-31 12:01   ` Andi Kleen
2007-05-31 13:29     ` Eric W. Biederman
2007-05-31 20:02       ` Siddha, Suresh B
2007-05-31 13:34   ` Ingo Molnar
2007-05-31 13:50     ` [PATCH] x86_64 irq: check remote IRR bit before migrating level triggered irq (v3) Eric W. Biederman
2007-05-31 13:54       ` Ingo Molnar
2007-05-31 20:00       ` Siddha, Suresh B

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=m1wsz6jjsx.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=asit.k.mallick@intel.com \
    --cc=keith.packard@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nanhai.zou@intel.com \
    --cc=suresh.b.siddha@intel.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

Powered by JetHome