public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] Deferred interrupt handling.
@ 2007-07-18  9:53 Or Sagi
  2007-07-18 11:30 ` Alan Cox
  2007-07-18 15:57 ` Lennart Sorensen
  0 siblings, 2 replies; 21+ messages in thread
From: Or Sagi @ 2007-07-18  9:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: kvm-devel

Gentlepeople,

We're currently working on PCI device pass-through support for KVM. In this
model all physical hardware access to specific devices will be performed by
the VM, and not by the host.

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.

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 believe that this requires changing the current interrupt path in several
fashions:

0. Adding an IRQ_DEFERRED mechanism to the interrupt handling path. ISRs
returning IRQ_DEFERRED will keep the interrupt masked until future
acknowledge.
1. Deferred acknowledge mechanism which would acknowledge the APIC and
unmask
the interrupt.

An alternative idea was suggested at
http://lists.xensource.com/archives/html/xen-devel/2007-05/msg01148.html ---
which is based on reversing the polarity of the received interrupt. Once
the guest acknowledges the interrupt at the device level, the polarity is
reversed again by the host.

This may not be the best choice performance wise -- twice the interrupt
count.

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.

We wouldn't like to assume VT-d availability right now.

Any ideas ? Thoughts ?

-- Ors



^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: [RFC] Deferred interrupt handling.
@ 2007-07-19  0:15 Peter Chubb
  0 siblings, 0 replies; 21+ messages in thread
From: Peter Chubb @ 2007-07-19  0:15 UTC (permalink / raw)
  To: Or Sagi; +Cc: linux-kernel, calebm


The problem you're having is essentially the same as the user-level
interrupt handler problem I've been dealing with for ages.

The basic rule is: don't share interrupts between devices on the host
and devices in the guest.  But you *can* share interrupts between
devices in a single guest.

If you want the code, see
http://www.gelato.unsw.edu.au/cgi-bin/viewvc.cgi/cvs/kernel/usrdrivers/latest/
and look at generic-irq.patch and fasync (which adds asynchronous notifications)

For the KVM work it'll need modifying a little, but the basic
infrastructure is there.

We've currently got this working to pass interrupts to a type-II (hosted)
virtual machine monitor running a guest kernel with native drivers.

--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au           ERTOS within National ICT Australia

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2007-07-25 18:30 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-18  9:53 [RFC] Deferred interrupt handling Or Sagi
2007-07-18 11:30 ` Alan Cox
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
  -- strict thread matches above, loose matches on Subject: below --
2007-07-19  0:15 Peter Chubb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox