qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Ogilvie <mmogilvi_qemu@miniinfo.net>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 6/6] i8259: add -no-spurious-interrupt-hack option
Date: Fri, 24 Aug 2012 02:05:04 -0600	[thread overview]
Message-ID: <20120824080504.GA7077@comcast.net> (raw)
In-Reply-To: <503713D4.6000002@web.de>

On Fri, Aug 24, 2012 at 07:40:36AM +0200, Jan Kiszka wrote:
> On 2012-08-23 08:24, Matthew Ogilvie wrote:
> > This patch provides a way to optionally suppress spurious interrupts,

[snip]

> > I'm not sure why it only sporadically hits this sequence of events.
> > There doesn't seem to be other IRQs asserted or serviced anywhere
> > in the near past; the last several were all IRQ14's.  But I can't
> > help feeling I'm not reading the log output correctly or something,
> > because that doesn't make sense.  Maybe there is there some kind
> > of a-few-instructions delay before a CPU interrupt is actually
> > deliviered after interrupts are enabled, or some delay in raising
> > IRQ14 after a hard drive operation is requested, and such delays
> > need to fall into a narrow window of opportunity left by UNIX?
> > 
> > I can get a disassembly of the UNIX kernel using a "coff"-enabled
> > build of GNU objdump, giving function names but not much else.
> > But I haven't studied it in enough detail to actually find the
> > relevant code path that is manipulating imr as described above.
> > However, this old post outlines some of the high level theory
> > of UNIX spl*() functions:
> > http://www.linuxmisc.com/29-unix-internals/4e6c1f6fa2e41670.htm
> > 
> > If anyone wants to look into this further, I can provide access to the
> > initial boot install floppy, at least.  Email me.  (Without the rest
> > of the install disks, it isn't much use for anything except testing
> > virtual machines like qemu against rare corner cases...)
> > 
> > ============
> > Alternative Approaches:
> > 
> > An alternative to this patch that might work (I haven't tried) would
> > be to have BIOS set the master's elcr register 0x04 bit, making IRQ2
> > level triggered instead of edge triggered.  I'm not sure what other
> > effects this might have.  Maybe it would actually be a more accurate
> > model (I haven't checked documentation; maybe "slave mode" of a
> > IRQ line into the master is supposed to be level triggered?)
> > 
> > Or perhaps find a way to model the minimum timescale that a interrupt
> > request needs to be active to be recognized?
> > 
> > Or maybe my analysis isn't correct; I wasn't able to find the
> > relevant code path in the UNIX kernel.

[snip]

> 
> Has to mention or even actively warn that it doesn't work with KVM and
> its in-kernel irqchip (as that PIC model lacks your hack).

I'll make an incremental patch to the documentation soon.

> 
> However, I strongly suspect you are nastily papering over an issue in
> some device model. So I would prefer to dig deeper before installing
> this in upstream (also due to its dependency on the userspace PIC model).

This is certainly possible.  I'm not an expert on the whole interrupt
subsystem design in a PC.  But other than the wild speculation above
(making IRQ2 level triggered via elcr, or some kind of timing preventing the
edge triggering from catching a very short blip), I'm not sure what
to look for.

- Matthew Ogilvie

  reply	other threads:[~2012-08-24  8:06 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23  6:24 [Qemu-devel] [PATCH v2 0/6] Running Microport UNIX (ca 1987) Matthew Ogilvie
2012-08-23  6:24 ` [Qemu-devel] [PATCH v2 1/6] fix some debug printf format strings Matthew Ogilvie
2012-08-23 11:50   ` Andreas Färber
2012-08-23  6:24 ` [Qemu-devel] [PATCH v2 2/6] target-i386/translate.c: mov to/from crN/drN: ignore mod bits Matthew Ogilvie
2012-08-23  6:24 ` [Qemu-devel] [PATCH v2 3/6] vl: fix -hdachs/-hda argument order parsing issues Matthew Ogilvie
2012-08-23  6:24 ` [Qemu-devel] [PATCH v2 4/6] qemu-options.hx: mention retrace= VGA option Matthew Ogilvie
2012-08-23  6:24 ` [Qemu-devel] [PATCH v2 5/6] vga: add some optional CGA compatibility hacks Matthew Ogilvie
2012-08-23  6:24 ` [Qemu-devel] [PATCH v2 6/6] i8259: add -no-spurious-interrupt-hack option Matthew Ogilvie
2012-08-24  5:40   ` Jan Kiszka
2012-08-24  8:05     ` Matthew Ogilvie [this message]
2012-08-24  8:16       ` Jan Kiszka
2012-08-27 13:55   ` Anthony Liguori
2012-08-27 14:23     ` Paolo Bonzini
2012-08-27 15:50       ` Anthony Liguori
2012-08-24  3:58 ` [Qemu-devel] [PATCH v2 0/6] Running Microport UNIX (ca 1987) malc
2012-08-24  5:44   ` Jan Kiszka
2012-08-24  7:19     ` Peter Maydell
2012-08-24 13:39       ` Paolo Bonzini
2012-08-24 13:46         ` Peter Maydell
2012-08-24  9:13     ` [Qemu-devel] [PATCH v3 0/3] Microport UNIX series (was: [PATCH v2 0/6] ...) Matthew Ogilvie
2012-08-24  9:13       ` [Qemu-devel] [PATCH 1/3] debug printf (cirrus_vga): fixup unintended format change Matthew Ogilvie
2012-08-24  9:13       ` [Qemu-devel] [PATCH 2/3] vga cga_hack=palette_blanking: narrower conditions for hack Matthew Ogilvie
2012-08-24  9:13       ` [Qemu-devel] [PATCH 3/3] doc: mention that -no-spurious-interrupt-hack doesn't work with KVM Matthew Ogilvie
2012-08-24 12:02     ` [Qemu-devel] [PATCH v2 0/6] Running Microport UNIX (ca 1987) malc
2012-08-24 12:10       ` Jan Kiszka
2012-08-24 12:18         ` malc
2012-08-27 13:50   ` Anthony Liguori
2012-08-27 14:09     ` malc
2012-08-27 14:17       ` Anthony Liguori
2012-08-27 14:38         ` malc
2012-08-27 15:11           ` Anthony Liguori

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=20120824080504.GA7077@comcast.net \
    --to=mmogilvi_qemu@miniinfo.net \
    --cc=jan.kiszka@web.de \
    --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).