Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-15 Thread Avi Kivity
On 08/15/2012 02:26 AM, Alex Williamson wrote: Yes, I understand. It's simple, it's also very specific to this problem, and doesn't address generic ack notification. All of which I've noted before and I continue to note that v8 offers simplifications while retaining flexibility. Least

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Michael S. Tsirkin
On Mon, Aug 13, 2012 at 09:09:43PM -0600, Alex Williamson wrote: On Tue, 2012-08-14 at 02:00 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 04:41:05PM -0600, Alex Williamson wrote: On Tue, 2012-08-14 at 01:06 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 03:34:01PM

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Gleb Natapov
On Tue, Aug 14, 2012 at 01:52:13AM +0300, Michael S. Tsirkin wrote: Using the EOI as a trigger to de-assert and potentially re-assert may be a hack, but it's about as close as we can come to following the behavior of hardware. It's actually quite similar to an apic re-sampling inputs

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Gleb Natapov
On Tue, Aug 14, 2012 at 01:10:15PM +0300, Gleb Natapov wrote: On Tue, Aug 14, 2012 at 01:52:13AM +0300, Michael S. Tsirkin wrote: Using the EOI as a trigger to de-assert and potentially re-assert may be a hack, but it's about as close as we can come to following the behavior of hardware.

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Avi Kivity
On 08/12/2012 12:33 PM, Michael S. Tsirkin wrote: Michael, would the interface be more acceptable to you if we added separate ioctls to allocate and free some representation of an irq source ID, gsi pair? For instance, an ioctl might return an idr entry for an irq source ID/gsi object which

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 03:35:54PM +0300, Avi Kivity wrote: On 08/12/2012 12:33 PM, Michael S. Tsirkin wrote: Michael, would the interface be more acceptable to you if we added separate ioctls to allocate and free some representation of an irq source ID, gsi pair? For instance, an ioctl

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Alex Williamson
On Tue, 2012-08-14 at 11:35 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 09:09:43PM -0600, Alex Williamson wrote: On Tue, 2012-08-14 at 02:00 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 04:41:05PM -0600, Alex Williamson wrote: On Tue, 2012-08-14 at 01:06 +0300,

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Alex Williamson
On Tue, 2012-08-14 at 15:35 +0300, Avi Kivity wrote: On 08/12/2012 12:33 PM, Michael S. Tsirkin wrote: Michael, would the interface be more acceptable to you if we added separate ioctls to allocate and free some representation of an irq source ID, gsi pair? For instance, an ioctl might

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Michael S. Tsirkin
On Tue, Aug 14, 2012 at 04:01:15PM -0600, Alex Williamson wrote: On Tue, 2012-08-14 at 15:35 +0300, Avi Kivity wrote: On 08/12/2012 12:33 PM, Michael S. Tsirkin wrote: Michael, would the interface be more acceptable to you if we added separate ioctls to allocate and free some

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-14 Thread Alex Williamson
On Wed, 2012-08-15 at 02:04 +0300, Michael S. Tsirkin wrote: On Tue, Aug 14, 2012 at 04:01:15PM -0600, Alex Williamson wrote: On Tue, 2012-08-14 at 15:35 +0300, Avi Kivity wrote: On 08/12/2012 12:33 PM, Michael S. Tsirkin wrote: Michael, would the interface be more acceptable to you

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Alex Williamson
On Sun, 2012-08-12 at 10:49 +0300, Michael S. Tsirkin wrote: On Wed, Aug 01, 2012 at 01:06:42PM -0600, Alex Williamson wrote: On Mon, 2012-07-30 at 19:12 -0600, Alex Williamson wrote: On Tue, 2012-07-31 at 03:36 +0300, Michael S. Tsirkin wrote: On Mon, Jul 30, 2012 at 06:26:31PM -0600,

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Michael S. Tsirkin
On Mon, Aug 13, 2012 at 10:48:15AM -0600, Alex Williamson wrote: On Sun, 2012-08-12 at 10:49 +0300, Michael S. Tsirkin wrote: On Wed, Aug 01, 2012 at 01:06:42PM -0600, Alex Williamson wrote: On Mon, 2012-07-30 at 19:12 -0600, Alex Williamson wrote: On Tue, 2012-07-31 at 03:36 +0300,

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Alex Williamson
On Mon, 2012-08-13 at 19:59 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 10:48:15AM -0600, Alex Williamson wrote: On Sun, 2012-08-12 at 10:49 +0300, Michael S. Tsirkin wrote: On Wed, Aug 01, 2012 at 01:06:42PM -0600, Alex Williamson wrote: On Mon, 2012-07-30 at 19:12 -0600,

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Michael S. Tsirkin
On Mon, Aug 13, 2012 at 12:17:25PM -0600, Alex Williamson wrote: On Mon, 2012-08-13 at 19:59 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 10:48:15AM -0600, Alex Williamson wrote: On Sun, 2012-08-12 at 10:49 +0300, Michael S. Tsirkin wrote: On Wed, Aug 01, 2012 at 01:06:42PM

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Alex Williamson
On Mon, 2012-08-13 at 22:50 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 12:17:25PM -0600, Alex Williamson wrote: On Mon, 2012-08-13 at 19:59 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 10:48:15AM -0600, Alex Williamson wrote: On Sun, 2012-08-12 at 10:49 +0300,

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Alex Williamson
On Sun, 2012-08-12 at 12:33 +0300, Michael S. Tsirkin wrote: On Thu, Aug 09, 2012 at 01:26:15PM -0600, Alex Williamson wrote: On Mon, 2012-08-06 at 13:40 +0300, Avi Kivity wrote: On 08/06/2012 01:38 PM, Avi Kivity wrote: Regarding the implementation, instead of a linked list, would

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Alex Williamson
On Sun, 2012-08-12 at 11:36 +0300, Avi Kivity wrote: On 08/09/2012 10:26 PM, Alex Williamson wrote: On Mon, 2012-08-06 at 13:40 +0300, Avi Kivity wrote: On 08/06/2012 01:38 PM, Avi Kivity wrote: Regarding the implementation, instead of a linked list, would an array of counters

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Michael S. Tsirkin
On Mon, Aug 13, 2012 at 02:48:25PM -0600, Alex Williamson wrote: On Mon, 2012-08-13 at 22:50 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 12:17:25PM -0600, Alex Williamson wrote: On Mon, 2012-08-13 at 19:59 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 10:48:15AM

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Michael S. Tsirkin
On Mon, Aug 13, 2012 at 03:23:24PM -0600, Alex Williamson wrote: On Sun, 2012-08-12 at 12:33 +0300, Michael S. Tsirkin wrote: On Thu, Aug 09, 2012 at 01:26:15PM -0600, Alex Williamson wrote: On Mon, 2012-08-06 at 13:40 +0300, Avi Kivity wrote: On 08/06/2012 01:38 PM, Avi Kivity wrote:

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Michael S. Tsirkin
On Mon, Aug 13, 2012 at 03:34:01PM -0600, Alex Williamson wrote: On Sun, 2012-08-12 at 11:36 +0300, Avi Kivity wrote: On 08/09/2012 10:26 PM, Alex Williamson wrote: On Mon, 2012-08-06 at 13:40 +0300, Avi Kivity wrote: On 08/06/2012 01:38 PM, Avi Kivity wrote: Regarding the

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Alex Williamson
On Tue, 2012-08-14 at 00:50 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 02:48:25PM -0600, Alex Williamson wrote: On Mon, 2012-08-13 at 22:50 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 12:17:25PM -0600, Alex Williamson wrote: On Mon, 2012-08-13 at 19:59 +0300,

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Alex Williamson
On Tue, 2012-08-14 at 01:06 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 03:34:01PM -0600, Alex Williamson wrote: On Sun, 2012-08-12 at 11:36 +0300, Avi Kivity wrote: On 08/09/2012 10:26 PM, Alex Williamson wrote: On Mon, 2012-08-06 at 13:40 +0300, Avi Kivity wrote: On

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Michael S. Tsirkin
On Mon, Aug 13, 2012 at 04:22:12PM -0600, Alex Williamson wrote: On Tue, 2012-08-14 at 00:50 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 02:48:25PM -0600, Alex Williamson wrote: On Mon, 2012-08-13 at 22:50 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 12:17:25PM

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Michael S. Tsirkin
On Mon, Aug 13, 2012 at 04:41:05PM -0600, Alex Williamson wrote: On Tue, 2012-08-14 at 01:06 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 03:34:01PM -0600, Alex Williamson wrote: On Sun, 2012-08-12 at 11:36 +0300, Avi Kivity wrote: On 08/09/2012 10:26 PM, Alex Williamson

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-13 Thread Alex Williamson
On Tue, 2012-08-14 at 02:00 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 04:41:05PM -0600, Alex Williamson wrote: On Tue, 2012-08-14 at 01:06 +0300, Michael S. Tsirkin wrote: On Mon, Aug 13, 2012 at 03:34:01PM -0600, Alex Williamson wrote: On Sun, 2012-08-12 at 11:36 +0300,

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-12 Thread Michael S. Tsirkin
On Wed, Aug 01, 2012 at 01:06:42PM -0600, Alex Williamson wrote: On Mon, 2012-07-30 at 19:12 -0600, Alex Williamson wrote: On Tue, 2012-07-31 at 03:36 +0300, Michael S. Tsirkin wrote: On Mon, Jul 30, 2012 at 06:26:31PM -0600, Alex Williamson wrote: On Tue, 2012-07-31 at 03:01 +0300,

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-12 Thread Michael S. Tsirkin
On Mon, Aug 06, 2012 at 01:17:12PM +0300, Avi Kivity wrote: On 07/24/2012 11:43 PM, Alex Williamson wrote: This new ioctl enables an eventfd to be triggered when an EOI is written for a specified irqchip pin. The first user of this will be external device assignment through VFIO, using a

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-12 Thread Avi Kivity
On 08/09/2012 10:26 PM, Alex Williamson wrote: On Mon, 2012-08-06 at 13:40 +0300, Avi Kivity wrote: On 08/06/2012 01:38 PM, Avi Kivity wrote: Regarding the implementation, instead of a linked list, would an array of counters parallel to the bitmap make it simpler? Or even, replace the

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-12 Thread Michael S. Tsirkin
On Thu, Aug 09, 2012 at 01:26:15PM -0600, Alex Williamson wrote: On Mon, 2012-08-06 at 13:40 +0300, Avi Kivity wrote: On 08/06/2012 01:38 PM, Avi Kivity wrote: Regarding the implementation, instead of a linked list, would an array of counters parallel to the bitmap make it simpler?

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-09 Thread Alex Williamson
On Mon, 2012-08-06 at 13:40 +0300, Avi Kivity wrote: On 08/06/2012 01:38 PM, Avi Kivity wrote: Regarding the implementation, instead of a linked list, would an array of counters parallel to the bitmap make it simpler? Or even, replace the bitmap with an array of counters. I'm not sure a

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-06 Thread Avi Kivity
On 07/24/2012 11:43 PM, Alex Williamson wrote: This new ioctl enables an eventfd to be triggered when an EOI is written for a specified irqchip pin. The first user of this will be external device assignment through VFIO, using a level irqfd for asserting a PCI INTx interrupt and this

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-06 Thread Avi Kivity
On 08/06/2012 01:17 PM, Avi Kivity wrote: +4.77 KVM_EOIFD + +Capability: KVM_CAP_EOIFD +Architectures: x86 +Type: vm ioctl +Parameters: struct kvm_eoifd (in) +Returns: 0 on success, 0 on error + +KVM_EOIFD allows userspace to receive interrupt EOI notification +through an eventfd.

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-06 Thread Avi Kivity
On 08/06/2012 01:38 PM, Avi Kivity wrote: Regarding the implementation, instead of a linked list, would an array of counters parallel to the bitmap make it simpler? Or even, replace the bitmap with an array of counters. -- error compiling committee.c: too many arguments to function -- To

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-02 Thread Michael S. Tsirkin
On Mon, Jul 30, 2012 at 07:12:15PM -0600, Alex Williamson wrote: kvm_eoifd.fd specifies the eventfd used for +notification. KVM_EOIFD_FLAG_DEASSIGN is used to de-assign an eoifd +once assigned. KVM_EOIFD also requires additional bits set in +kvm_eoifd.flags

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-08-01 Thread Alex Williamson
On Mon, 2012-07-30 at 19:12 -0600, Alex Williamson wrote: On Tue, 2012-07-31 at 03:36 +0300, Michael S. Tsirkin wrote: On Mon, Jul 30, 2012 at 06:26:31PM -0600, Alex Williamson wrote: On Tue, 2012-07-31 at 03:01 +0300, Michael S. Tsirkin wrote: You keep saying this but it is still true:

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-07-30 Thread Alex Williamson
On Sun, 2012-07-29 at 17:54 +0300, Michael S. Tsirkin wrote: On Tue, Jul 24, 2012 at 02:43:22PM -0600, Alex Williamson wrote: This new ioctl enables an eventfd to be triggered when an EOI is written for a specified irqchip pin. The first user of this will be external device assignment

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-07-30 Thread Michael S. Tsirkin
On Mon, Jul 30, 2012 at 10:22:10AM -0600, Alex Williamson wrote: On Sun, 2012-07-29 at 17:54 +0300, Michael S. Tsirkin wrote: On Tue, Jul 24, 2012 at 02:43:22PM -0600, Alex Williamson wrote: This new ioctl enables an eventfd to be triggered when an EOI is written for a specified irqchip

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-07-30 Thread Alex Williamson
On Tue, 2012-07-31 at 03:01 +0300, Michael S. Tsirkin wrote: On Mon, Jul 30, 2012 at 10:22:10AM -0600, Alex Williamson wrote: On Sun, 2012-07-29 at 17:54 +0300, Michael S. Tsirkin wrote: On Tue, Jul 24, 2012 at 02:43:22PM -0600, Alex Williamson wrote: This new ioctl enables an eventfd to

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-07-30 Thread Michael S. Tsirkin
On Mon, Jul 30, 2012 at 06:26:31PM -0600, Alex Williamson wrote: On Tue, 2012-07-31 at 03:01 +0300, Michael S. Tsirkin wrote: On Mon, Jul 30, 2012 at 10:22:10AM -0600, Alex Williamson wrote: On Sun, 2012-07-29 at 17:54 +0300, Michael S. Tsirkin wrote: On Tue, Jul 24, 2012 at 02:43:22PM

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-07-30 Thread Alex Williamson
On Tue, 2012-07-31 at 03:36 +0300, Michael S. Tsirkin wrote: On Mon, Jul 30, 2012 at 06:26:31PM -0600, Alex Williamson wrote: On Tue, 2012-07-31 at 03:01 +0300, Michael S. Tsirkin wrote: On Mon, Jul 30, 2012 at 10:22:10AM -0600, Alex Williamson wrote: On Sun, 2012-07-29 at 17:54 +0300,

Re: [PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-07-29 Thread Michael S. Tsirkin
On Tue, Jul 24, 2012 at 02:43:22PM -0600, Alex Williamson wrote: This new ioctl enables an eventfd to be triggered when an EOI is written for a specified irqchip pin. The first user of this will be external device assignment through VFIO, using a level irqfd for asserting a PCI INTx interrupt

[PATCH v7 2/2] kvm: KVM_EOIFD, an eventfd for EOIs

2012-07-24 Thread Alex Williamson
This new ioctl enables an eventfd to be triggered when an EOI is written for a specified irqchip pin. The first user of this will be external device assignment through VFIO, using a level irqfd for asserting a PCI INTx interrupt and this interface for de-assert and notification once the interrupt