Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Al Viro
On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: + /* We re-use eventfd for irqfd */ + fd = sys_eventfd2(0, 0); + if (fd 0) { + ret = fd; + goto fail; + } + + /* We maintain a reference to eventfd for the irqfd lifetime */ +

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Avi Kivity
Michael S. Tsirkin wrote: On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: This allows an eventfd to be registered as an irq source with a guest. Any signaling operation on the eventfd (via userspace or kernel) will inject the registered GSI at the next available window.

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Davide Libenzi
On Sun, 3 May 2009, Al Viro wrote: On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: + /* We re-use eventfd for irqfd */ + fd = sys_eventfd2(0, 0); + if (fd 0) { + ret = fd; + goto fail; + } + + /* We maintain a reference to eventfd

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Al Viro
On Sun, May 03, 2009 at 11:07:26AM -0700, Davide Libenzi wrote: On Sun, 3 May 2009, Al Viro wrote: On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: + /* We re-use eventfd for irqfd */ + fd = sys_eventfd2(0, 0); + if (fd 0) { + ret = fd; + goto

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Michael S. Tsirkin
On Sun, May 03, 2009 at 07:59:40PM +0300, Avi Kivity wrote: Michael S. Tsirkin wrote: On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: This allows an eventfd to be registered as an irq source with a guest. Any signaling operation on the eventfd (via userspace or kernel)

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Avi Kivity
Michael S. Tsirkin wrote: On Sun, May 03, 2009 at 07:59:40PM +0300, Avi Kivity wrote: Michael S. Tsirkin wrote: On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: This allows an eventfd to be registered as an irq source with a guest. Any signaling operation on

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Michael S. Tsirkin
On Sun, May 03, 2009 at 10:17:16PM +0300, Avi Kivity wrote: Actually there's a third option: add KVM_MASK_IRQ, KVM_UNMASK_IRQ ioctls which will block/unblock guest from getting interrupt on this irq, whatever the source. Interrupts are queued in kernel while masked. A third ioctl

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-03 Thread Davide Libenzi
On Sun, 3 May 2009, Al Viro wrote: IOW, the sane solution would be to export something that returns your struct file *. And stop playing with fd completely. This builds but it's not tested at all. - Make all the work of the old anon_inode_getfd(), done by a new anon_inode_getfile(), with

Re: [KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-04-30 Thread Michael S. Tsirkin
On Mon, Apr 27, 2009 at 02:33:34PM -0400, Gregory Haskins wrote: This allows an eventfd to be registered as an irq source with a guest. Any signaling operation on the eventfd (via userspace or kernel) will inject the registered GSI at the next available window. Signed-off-by: Gregory

[KVM PATCH v3 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-04-27 Thread Gregory Haskins
This allows an eventfd to be registered as an irq source with a guest. Any signaling operation on the eventfd (via userspace or kernel) will inject the registered GSI at the next available window. Signed-off-by: Gregory Haskins ghask...@novell.com --- arch/x86/kvm/Makefile|2 -