From: Gleb Natapov <gleb@redhat.com>
To: Matthew Ogilvie <mmogilvi_qemu@miniinfo.net>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
Jan Kiszka <jan.kiszka@web.de>,
"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: [PATCH KVM v2 0/4] fix KVM i8259 IRQ trailing-edge logic
Date: Sun, 6 Jan 2013 17:54:15 +0200 [thread overview]
Message-ID: <20130106155415.GQ3440@redhat.com> (raw)
In-Reply-To: <1356586796-7631-1-git-send-email-mmogilvi_qemu@miniinfo.net>
On Wed, Dec 26, 2012 at 10:39:52PM -0700, Matthew Ogilvie wrote:
> 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.
>
$ git grep qemu_irq_pulse | wc -l
34
Files are:
hw/bonito.c
hw/dma.c
hw/grlib_apbuart.c
hw/grlib_gptimer.c
hw/hpet.c
hw/irq.h
hw/milkymist-ac97.c
hw/milkymist-minimac2.c
hw/milkymist-pfpu.c
hw/milkymist-softusb.c
hw/milkymist-sysctl.c
hw/milkymist-tmu2.c
hw/omap1.c
hw/omap_gptimer.c
hw/onenand.c
hw/spapr_events.c
hw/spapr_llan.c
hw/spapr_pci.c
hw/spapr_vio.c
hw/spapr_vty.c
hw/stellaris.c
hw/xilinx_ethlite.c
Looks like only two of those are relevant to PC platform hw/dma.c and
hw/hpet.c. In hw/dma.c it is used for internal qemu communication, not
real device. In hw/hpet.c from a quick glance it looks like _pulse is
only used when HPET in not in legacy emulation mode which means that
pulse should be directed to APIC.
> 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
--
Gleb.
WARNING: multiple messages have this Message-ID (diff)
From: Gleb Natapov <gleb@redhat.com>
To: Matthew Ogilvie <mmogilvi_qemu@miniinfo.net>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>,
Jan Kiszka <jan.kiszka@web.de>,
qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH KVM v2 0/4] fix KVM i8259 IRQ trailing-edge logic
Date: Sun, 6 Jan 2013 17:54:15 +0200 [thread overview]
Message-ID: <20130106155415.GQ3440@redhat.com> (raw)
In-Reply-To: <1356586796-7631-1-git-send-email-mmogilvi_qemu@miniinfo.net>
On Wed, Dec 26, 2012 at 10:39:52PM -0700, Matthew Ogilvie wrote:
> 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.
>
$ git grep qemu_irq_pulse | wc -l
34
Files are:
hw/bonito.c
hw/dma.c
hw/grlib_apbuart.c
hw/grlib_gptimer.c
hw/hpet.c
hw/irq.h
hw/milkymist-ac97.c
hw/milkymist-minimac2.c
hw/milkymist-pfpu.c
hw/milkymist-softusb.c
hw/milkymist-sysctl.c
hw/milkymist-tmu2.c
hw/omap1.c
hw/omap_gptimer.c
hw/onenand.c
hw/spapr_events.c
hw/spapr_llan.c
hw/spapr_pci.c
hw/spapr_vio.c
hw/spapr_vty.c
hw/stellaris.c
hw/xilinx_ethlite.c
Looks like only two of those are relevant to PC platform hw/dma.c and
hw/hpet.c. In hw/dma.c it is used for internal qemu communication, not
real device. In hw/hpet.c from a quick glance it looks like _pulse is
only used when HPET in not in legacy emulation mode which means that
pulse should be directed to APIC.
> 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
--
Gleb.
next prev parent reply other threads:[~2013-01-06 15:54 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-27 5:39 [PATCH KVM v2 0/4] fix KVM i8259 IRQ trailing-edge logic Matthew Ogilvie
2012-12-27 5:39 ` [Qemu-devel] " Matthew Ogilvie
2012-12-27 5:39 ` [PATCH KVM v2 1/4] KVM: fix i8254 IRQ0 to be normally high Matthew Ogilvie
2012-12-27 5:39 ` [Qemu-devel] " Matthew Ogilvie
2013-01-07 9:39 ` Gleb Natapov
2013-01-07 9:39 ` [Qemu-devel] " Gleb Natapov
2013-01-07 12:48 ` Gleb Natapov
2013-01-07 12:48 ` Gleb Natapov
2013-01-08 0:17 ` mmogilvi
2013-01-08 0:17 ` [Qemu-devel] " mmogilvi
2013-01-08 7:31 ` Gleb Natapov
2013-01-08 7:31 ` [Qemu-devel] " Gleb Natapov
2013-01-11 6:40 ` Matthew Ogilvie
2013-01-11 6:40 ` [Qemu-devel] " Matthew Ogilvie
2013-01-11 15:45 ` Gleb Natapov
2013-01-11 15:45 ` [Qemu-devel] " Gleb Natapov
2013-01-15 9:49 ` Matthew Ogilvie
2013-01-15 9:49 ` [Qemu-devel] " Matthew Ogilvie
2012-12-27 5:39 ` [PATCH KVM v2 2/4] KVM: additional i8254 output fixes Matthew Ogilvie
2012-12-27 5:39 ` [Qemu-devel] " Matthew Ogilvie
2013-01-07 12:04 ` Gleb Natapov
2013-01-07 12:04 ` [Qemu-devel] " Gleb Natapov
2013-01-08 0:35 ` mmogilvi
2013-01-08 0:35 ` [Qemu-devel] " mmogilvi
2013-01-08 7:41 ` Gleb Natapov
2013-01-08 7:41 ` [Qemu-devel] " Gleb Natapov
2013-01-11 6:33 ` Matthew Ogilvie
2013-01-11 6:33 ` [Qemu-devel] " Matthew Ogilvie
2012-12-27 5:39 ` [PATCH KVM v2 3/4] KVM: fix i8259 interrupt high to low transition logic Matthew Ogilvie
2012-12-27 5:39 ` [Qemu-devel] " Matthew Ogilvie
2012-12-27 5:39 ` [PATCH KVM v2 4/4] KVM: i8259: refactor pic_set_irq level logic Matthew Ogilvie
2012-12-27 5:39 ` [Qemu-devel] " Matthew Ogilvie
2013-01-06 15:54 ` Gleb Natapov [this message]
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=20130106155415.GQ3440@redhat.com \
--to=gleb@redhat.com \
--cc=jan.kiszka@web.de \
--cc=kvm@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=mmogilvi_qemu@miniinfo.net \
--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 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.