From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Gerd von Egidy <lists@egidy.de>, kvm-devel <kvm@vger.kernel.org>
Subject: Re: KVM: IOAPIC: don't clear remote_irr if IRQ is reinjected from EOI
Date: Thu, 05 Jun 2008 10:55:18 +0300 [thread overview]
Message-ID: <48479BE6.4090201@qumranet.com> (raw)
In-Reply-To: <20080605030811.GA10631@dmt.cnet>
Marcelo Tosatti wrote:
> There's a bug in the IOAPIC code for level-triggered interrupts. Its
> relatively easy to trigger by sharing (virtio-blk + usbtablet was the
> testcase, initially reported by Gerd von Egidy).
>
> The "remote_irr" variable is used to indicate accepted but not yet acked
> interrupts. Its cleared from the EOI handler.
>
> Problem is that the EOI handler clears remote_irr unconditionally, even
> if it reinjected another pending interrupt.
>
> In that case, kvm_ioapic_set_irq() proceeds to ioapic_service() which
> sets remote_irr even if it failed to inject (since the IRR was high due
> to EOI reinjection).
>
> Since the TMR bit has been cleared by the first EOI, the second one
> fails to clear remote_irr.
>
> End result is interrupt line dead.
>
> Fix it by setting remote_irr only if a new pending interrupt has been
> generated (and the TMR bit for vector in question set).
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2008-06-05 7:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-05 3:08 KVM: IOAPIC: don't clear remote_irr if IRQ is reinjected from EOI Marcelo Tosatti
2008-06-05 3:13 ` Marcelo Tosatti
2008-06-05 7:55 ` Avi Kivity [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=48479BE6.4090201@qumranet.com \
--to=avi@qumranet.com \
--cc=kvm@vger.kernel.org \
--cc=lists@egidy.de \
--cc=mtosatti@redhat.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 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.