qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Ogilvie <mmogilvi_qemu@miniinfo.net>
To: qemu-devel@nongnu.org
Cc: Gleb Natapov <gleb@redhat.com>, Jan Kiszka <jan.kiszka@web.de>,
	Matthew Ogilvie <mmogilvi_qemu@miniinfo.net>,
	kvm@vger.kernel.org, "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: [Qemu-devel] [PATCH KVM v2 0/4] fix KVM i8259 IRQ trailing-edge logic
Date: Wed, 26 Dec 2012 22:39:52 -0700	[thread overview]
Message-ID: <1356586796-7631-1-git-send-email-mmogilvi_qemu@miniinfo.net> (raw)

Changes since version 1 (from Sep 9):
   * Split off patch 1; this is the critical prerequisite to
     make the i8254 work with the fixed i8259.
   * Add patch 2, to make additional changes to the i8254
     to make it consistent with the spec and with proposed changes
     to qemu's i8254 model.

Background:

According to the spec, the i8259 will cancel an interrupt if
the line goes low before it starts servicing it, even when
it is considered edge-triggered.  This is a problem
with an old Microport UNIX guest (ca 1987), where the
guest masks off IRQ14 in the slave i8259, but the host's
master i8259 model will still try to deliver an interrupt even after
IRQ2 has been brought low, resulting in a spurious interrupt (IRQ15).

Before the i8259 can be fixed, the i8254 model needs to be fixed
so it doesn't depend on the broken i8259.

Alternative: This could be narrowly fixed for IRQ2 only with no
risk at all (and no need to touch the i8254), but if possible it
seems reasonable to fix it for all lines at the same time.

But there may be some risk:

First, I think I've convinced myself that between the i8254 and i8259,
the only substantial migration breakage should be when a
whole series of conditions are met, and the combination
should be rare enough not to worry about it.  See writeup
in my qemu patch series (version 8; Dec 16).

Second, there is also the possibility that other devices are relying
on the broken model.  I'm especially concerned with various users
of a function called

        qemu_irq_pulse()

in the qemu source tree, which immediately lowers IRQ line after
raising it.  If any of those calls are routed straight into
the i8259 (as opposed to an APIC or some other chip), then it
probably won't behave as desired.

I'll probably dig into qemu_irq_pulse() callers more carefully
eventually, but there are lot of them, and any high-level incite
anyone can provide into them would be helpful.

See the Dec 16 patch series I sent to the qemu mailing list for
more information.
http://search.gmane.org/?query=ogilvie&group=gmane.comp.emulators.qemu

Matthew Ogilvie (4):
  KVM: fix i8254 IRQ0 to be normally high
  KVM: additional i8254 output fixes
  KVM: fix i8259 interrupt high to low transition logic
  KVM: i8259: refactor pic_set_irq level logic

 arch/x86/kvm/i8254.c | 50 +++++++++++++++++++++++++++++++++++++++-----------
 arch/x86/kvm/i8259.c | 36 ++++++++++++++----------------------
 2 files changed, 53 insertions(+), 33 deletions(-)

-- 
1.7.10.2.484.gcd07cc5

             reply	other threads:[~2012-12-27  5:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-27  5:39 Matthew Ogilvie [this message]
2012-12-27  5:39 ` [Qemu-devel] [PATCH KVM v2 1/4] KVM: fix i8254 IRQ0 to be normally high Matthew Ogilvie
2013-01-07  9:39   ` Gleb Natapov
2013-01-07 12:48     ` Gleb Natapov
2013-01-08  0:17     ` mmogilvi
2013-01-08  7:31       ` Gleb Natapov
2013-01-11  6:40         ` Matthew Ogilvie
2013-01-11 15:45           ` Gleb Natapov
2013-01-15  9:49             ` Matthew Ogilvie
2012-12-27  5:39 ` [Qemu-devel] [PATCH KVM v2 2/4] KVM: additional i8254 output fixes Matthew Ogilvie
2013-01-07 12:04   ` Gleb Natapov
2013-01-08  0:35     ` mmogilvi
2013-01-08  7:41       ` Gleb Natapov
2013-01-11  6:33         ` Matthew Ogilvie
2012-12-27  5:39 ` [Qemu-devel] [PATCH KVM v2 3/4] KVM: fix i8259 interrupt high to low transition logic Matthew Ogilvie
2012-12-27  5:39 ` [Qemu-devel] [PATCH KVM v2 4/4] KVM: i8259: refactor pic_set_irq level logic Matthew Ogilvie
2013-01-06 15:54 ` [Qemu-devel] [PATCH KVM v2 0/4] fix KVM i8259 IRQ trailing-edge logic Gleb Natapov

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=1356586796-7631-1-git-send-email-mmogilvi_qemu@miniinfo.net \
    --to=mmogilvi_qemu@miniinfo.net \
    --cc=gleb@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=qemu-devel@nongnu.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).