mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Or Sagi" <ors@tutis.com>
Cc: <linux-kernel@vger.kernel.org>, <kvm-devel@lists.sourceforge.net>
Subject: Re: [RFC] Deferred interrupt handling.
Date: Wed, 18 Jul 2007 12:30:40 +0100	[thread overview]
Message-ID: <20070718123040.615795b7@the-village.bc.nu> (raw)
In-Reply-To: <005901c7c921$79c006c0$6d401440$@com>

> In particular, this requires interrupt handling to be done by the guest --
> The host shouldn't load the corresponding device driver or otherwise access
> the device. Since the host kernel is not aware of the device semantics it
> cannot acknowledge the interrupt at the device level.

Tricky indeed.

> As far as the host kernel is concerned the VM is a user level process. We
> require the ability to forward interrupt handling to such entities. The
> current kernel interrupt handling path doesn't allow deferring interrupt
> handling _and_ acknowledgement.

We don't support this model at all, and it doesn't appear to work anyway.

> 0. Adding an IRQ_DEFERRED mechanism to the interrupt handling path. ISRs
> returning IRQ_DEFERRED will keep the interrupt masked until future
> acknowledge.

Deadlock. If you get an IRQ for a guest and you block the IRQ until the
guest handles it you may (eg if the IRQ is shared) get priority inversion
with another interrupt source on the same line the guest requires first
(eg disks and other I/O)

> Another issue we are aware of is the effect deferred handling will have on
> other devices sharing the interrupt. This seems to be a problem regardless
> of the solution.

Yes. This is the big reason Linux has never supported this kind of model
for anything but old ISA IRQ handling in vm86.
> 
> We wouldn't like to assume VT-d availability right now.
> 
> Any ideas ? Thoughts ?

Mask the interrupt in the main kernel, pass an event of some kind to the
guest. You can describe most devices from guest to kernel in a safe form
as

device, bar, offset, register size, mask, bits to set, bits to clear

(or bits to test when deciding if it is the irq source)


  reply	other threads:[~2007-07-18 11:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18  9:53 Or Sagi
2007-07-18 11:30 ` Alan Cox [this message]
2007-07-18 16:36   ` [kvm-devel] " Dor Laor
2007-07-18 16:47     ` Alan Cox
2007-07-18 16:46       ` Avi Kivity
2007-07-18 16:57         ` Alan Cox
2007-07-18 16:57           ` Avi Kivity
2007-07-18 17:14             ` Alan Cox
2007-07-18 17:09         ` Dor Laor
2007-07-18 17:33           ` Alan Cox
2007-07-18 21:29             ` Dor Laor
2007-07-18 21:46               ` Alan Cox
2007-07-25 14:18                 ` Pavel Machek
2007-07-18 22:23               ` Or Sagi
2007-07-18 19:14         ` Lennart Sorensen
2007-07-19  9:23           ` Avi Kivity
2007-07-19 13:17             ` Lennart Sorensen
2007-07-19 13:38               ` Avi Kivity
2007-07-19 16:23                 ` Lennart Sorensen
2007-07-18 15:57 ` Lennart Sorensen
2007-07-19  0:15 Peter Chubb

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=20070718123040.615795b7@the-village.bc.nu \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ors@tutis.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

all inboxes | Powered by JetHome®