Re: [PATCHv0 RFC] kvm: irqfd support for level interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 27, 2009 at 11:21:39AM +0300, Michael S. Tsirkin wrote:
> On Mon, Jul 27, 2009 at 11:13:50AM +0300, Gleb Natapov wrote:
> > On Mon, Jul 27, 2009 at 11:02:06AM +0300, Michael S. Tsirkin wrote:
> > > On Mon, Jul 27, 2009 at 10:31:38AM +0300, Gleb Natapov wrote:
> > > > On Mon, Jul 27, 2009 at 09:28:34AM +0300, Michael S. Tsirkin wrote:
> > > > > On Mon, Jul 27, 2009 at 08:33:12AM +0300, Gleb Natapov wrote:
> > > > > > On Sun, Jul 26, 2009 at 07:22:25PM +0300, Michael S. Tsirkin wrote:
> > > > > > > Here's an untested patch with partial support for level triggered
> > > > > > > interrupts in irqfd. What this patch has: support for clearing interrupt
> > > > > > > on ack. What this patch does not have: support signalling eventfd on ack
> > > > > > > so that userspace can take action and e.g. reenable interrupt.
> > > > > > > 
> > > > > > Do we want level triggered irqfd to be used only for device assignment?
> > > > > 
> > > > > generally level triggered-not only.
> > > > > But irqfd is promarily for device assignment and emulated devices.
> > > > > 
> > > > If it is for emulated device zeroing irq level on ack is not acceptable.
> > > 
> > > OK, forget about emulated devices for now. Let's focus on assigned
> > > devices.
> > > 
> > Can't. We should design interface that works for everything.
> 
> We can always add the KVM_MAKE_COFFEE ioctl later.
> 
Assigned devices are non interesting case, so we can hack something
afterwards to make it work. Emulated devices is a normal case that
should work when interface is introduced. Why assigning devices through
the kernel is not good enough? What is the reason to push it to
userspace?

> > > > > > Because if not it is not appropriate to zero irq level on ack.
> > > > > 
> > > > > The bit that is missing in this patch, is that we'll signal eventfd
> > > > > after we zero irq. Userspace polls that and re-asserts irq.
> > > > That is not needed for device emulation. Emulated device should lower
> > > > irq line by itself. It know exactly when to do it. Please don't push
> > > > broken device assignment model to emulated devices.
> > > > 
> > > > > 
> > > > > > And you
> > > > > > have no other way to zero irq level?!
> > > > > 
> > > > > The reason is interrupt sharing: device can assert interrupt
> > > > > but can not clear it by itself.
> > > > For interrupt sharing to work you need to allocate source id for each
> > > > irqfd.
> > > 
> > > BTW, current SET_IRQ_LINE interface uses a common source id for all
> > > irqs. Does this mean that interrupt sharing in guest is broken now?
> > No. It means that sharing in handled in userspace by chipset emulation.
> 
> Aha. Where's that code in qemu-kvm? I only see it forwarding to the
AFAIR in hw/pci.c and/or hw/piix_pci.c.

> ioctl call directly. And what about assigned devices? These bypass qemu.
> 
Each assigned device allocates its own source id. This is the reason
source id exists at all.

--
			Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux