Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-07-01 Thread Gleb Natapov
On Fri, Jun 29, 2012 at 04:27:57PM -0600, Alex Williamson wrote: > On Thu, 2012-06-28 at 11:46 +0300, Gleb Natapov wrote: > > On Thu, Jun 28, 2012 at 11:41:05AM +0300, Michael S. Tsirkin wrote: > > > On Thu, Jun 28, 2012 at 11:35:41AM +0300, Gleb Natapov wrote: > > > > On Thu, Jun 28, 2012 at 11:34

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-29 Thread Alex Williamson
On Thu, 2012-06-28 at 11:46 +0300, Gleb Natapov wrote: > On Thu, Jun 28, 2012 at 11:41:05AM +0300, Michael S. Tsirkin wrote: > > On Thu, Jun 28, 2012 at 11:35:41AM +0300, Gleb Natapov wrote: > > > On Thu, Jun 28, 2012 at 11:34:35AM +0300, Michael S. Tsirkin wrote: > > > > On Thu, Jun 28, 2012 at 09

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-29 Thread Alex Williamson
On Thu, 2012-06-28 at 11:29 +0300, Michael S. Tsirkin wrote: > On Wed, Jun 27, 2012 at 09:52:52PM -0600, Alex Williamson wrote: > > On Thu, 2012-06-28 at 01:28 +0300, Michael S. Tsirkin wrote: > > > On Wed, Jun 27, 2012 at 03:28:19PM -0600, Alex Williamson wrote: > > > > On Thu, 2012-06-28 at 00:14

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-28 Thread Avi Kivity
On 06/28/2012 12:19 AM, Alex Williamson wrote: >> > @@ -302,6 +385,7 @@ kvm_irqfd_deassign(struct kvm *kvm, struct kvm_irqfd >> > *args) >> > { >> >struct _irqfd *irqfd, *tmp; >> >struct eventfd_ctx *eventfd; >> > + bool is_level = (args->flags & KVM_IRQFD_FLAG_LEVEL) != 0; >> >> != 0 i

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-28 Thread Gleb Natapov
On Thu, Jun 28, 2012 at 11:48:40AM +0300, Michael S. Tsirkin wrote: > On Thu, Jun 28, 2012 at 11:46:11AM +0300, Gleb Natapov wrote: > > On Thu, Jun 28, 2012 at 11:41:05AM +0300, Michael S. Tsirkin wrote: > > > On Thu, Jun 28, 2012 at 11:35:41AM +0300, Gleb Natapov wrote: > > > > On Thu, Jun 28, 201

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-28 Thread Michael S. Tsirkin
On Thu, Jun 28, 2012 at 11:46:11AM +0300, Gleb Natapov wrote: > On Thu, Jun 28, 2012 at 11:41:05AM +0300, Michael S. Tsirkin wrote: > > On Thu, Jun 28, 2012 at 11:35:41AM +0300, Gleb Natapov wrote: > > > On Thu, Jun 28, 2012 at 11:34:35AM +0300, Michael S. Tsirkin wrote: > > > > On Thu, Jun 28, 201

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-28 Thread Gleb Natapov
On Thu, Jun 28, 2012 at 11:41:05AM +0300, Michael S. Tsirkin wrote: > On Thu, Jun 28, 2012 at 11:35:41AM +0300, Gleb Natapov wrote: > > On Thu, Jun 28, 2012 at 11:34:35AM +0300, Michael S. Tsirkin wrote: > > > On Thu, Jun 28, 2012 at 09:34:31AM +0300, Gleb Natapov wrote: > > > > On Thu, Jun 28, 201

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-28 Thread Michael S. Tsirkin
On Thu, Jun 28, 2012 at 11:35:41AM +0300, Gleb Natapov wrote: > On Thu, Jun 28, 2012 at 11:34:35AM +0300, Michael S. Tsirkin wrote: > > On Thu, Jun 28, 2012 at 09:34:31AM +0300, Gleb Natapov wrote: > > > On Thu, Jun 28, 2012 at 01:31:29AM +0300, Michael S. Tsirkin wrote: > > > > On Wed, Jun 27, 201

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-28 Thread Gleb Natapov
On Thu, Jun 28, 2012 at 11:34:35AM +0300, Michael S. Tsirkin wrote: > On Thu, Jun 28, 2012 at 09:34:31AM +0300, Gleb Natapov wrote: > > On Thu, Jun 28, 2012 at 01:31:29AM +0300, Michael S. Tsirkin wrote: > > > On Wed, Jun 27, 2012 at 04:04:18PM -0600, Alex Williamson wrote: > > > > On Wed, 2012-06-

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-28 Thread Michael S. Tsirkin
On Thu, Jun 28, 2012 at 09:34:31AM +0300, Gleb Natapov wrote: > On Thu, Jun 28, 2012 at 01:31:29AM +0300, Michael S. Tsirkin wrote: > > On Wed, Jun 27, 2012 at 04:04:18PM -0600, Alex Williamson wrote: > > > On Wed, 2012-06-27 at 18:26 +0300, Michael S. Tsirkin wrote: > > > > On Tue, Jun 26, 2012 at

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-28 Thread Michael S. Tsirkin
On Wed, Jun 27, 2012 at 09:52:52PM -0600, Alex Williamson wrote: > On Thu, 2012-06-28 at 01:28 +0300, Michael S. Tsirkin wrote: > > On Wed, Jun 27, 2012 at 03:28:19PM -0600, Alex Williamson wrote: > > > On Thu, 2012-06-28 at 00:14 +0300, Michael S. Tsirkin wrote: > > > > On Wed, Jun 27, 2012 at 02:

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Gleb Natapov
On Thu, Jun 28, 2012 at 01:31:29AM +0300, Michael S. Tsirkin wrote: > On Wed, Jun 27, 2012 at 04:04:18PM -0600, Alex Williamson wrote: > > On Wed, 2012-06-27 at 18:26 +0300, Michael S. Tsirkin wrote: > > > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > > > > @@ -71,6 +130,14 @@

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Alex Williamson
On Thu, 2012-06-28 at 01:28 +0300, Michael S. Tsirkin wrote: > On Wed, Jun 27, 2012 at 03:28:19PM -0600, Alex Williamson wrote: > > On Thu, 2012-06-28 at 00:14 +0300, Michael S. Tsirkin wrote: > > > On Wed, Jun 27, 2012 at 02:59:09PM -0600, Alex Williamson wrote: > > > > On Wed, 2012-06-27 at 12:51

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Michael S. Tsirkin
On Wed, Jun 27, 2012 at 04:04:18PM -0600, Alex Williamson wrote: > On Wed, 2012-06-27 at 18:26 +0300, Michael S. Tsirkin wrote: > > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > > > @@ -71,6 +130,14 @@ irqfd_inject(struct work_struct *work) > > > kvm_set_irq(kvm, KVM_USERSPAC

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Michael S. Tsirkin
On Wed, Jun 27, 2012 at 03:28:19PM -0600, Alex Williamson wrote: > On Thu, 2012-06-28 at 00:14 +0300, Michael S. Tsirkin wrote: > > On Wed, Jun 27, 2012 at 02:59:09PM -0600, Alex Williamson wrote: > > > On Wed, 2012-06-27 at 12:51 +0300, Michael S. Tsirkin wrote: > > > > On Tue, Jun 26, 2012 at 11:

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Michael S. Tsirkin
On Wed, Jun 27, 2012 at 02:59:09PM -0600, Alex Williamson wrote: > On Wed, 2012-06-27 at 12:51 +0300, Michael S. Tsirkin wrote: > > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > > > In order to inject an interrupt from an external source using an > > > irqfd, we need to allocat

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Alex Williamson
On Wed, 2012-06-27 at 18:26 +0300, Michael S. Tsirkin wrote: > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > > @@ -71,6 +130,14 @@ irqfd_inject(struct work_struct *work) > > kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, irqfd->gsi, 0); > > } > > > > +static void > > +irq

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Alex Williamson
On Thu, 2012-06-28 at 00:14 +0300, Michael S. Tsirkin wrote: > On Wed, Jun 27, 2012 at 02:59:09PM -0600, Alex Williamson wrote: > > On Wed, 2012-06-27 at 12:51 +0300, Michael S. Tsirkin wrote: > > > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > > > > In order to inject an inter

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Alex Williamson
On Wed, 2012-06-27 at 12:34 +0300, Michael S. Tsirkin wrote: > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > > In order to inject an interrupt from an external source using an > > irqfd, we need to allocate a new irq_source_id. This allows us to > > assert and (later) de-asser

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Alex Williamson
On Wed, 2012-06-27 at 12:51 +0300, Michael S. Tsirkin wrote: > On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > > In order to inject an interrupt from an external source using an > > irqfd, we need to allocate a new irq_source_id. This allows us to > > assert and (later) de-asser

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Michael S. Tsirkin
On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > @@ -71,6 +130,14 @@ irqfd_inject(struct work_struct *work) > kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, irqfd->gsi, 0); > } > > +static void > +irqfd_inject_level(struct work_struct *work) > +{ > + struct _irqfd *irq

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Michael S. Tsirkin
On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > In order to inject an interrupt from an external source using an > irqfd, we need to allocate a new irq_source_id. This allows us to > assert and (later) de-assert an interrupt line independently from > users of KVM_IRQ_LINE and av

Re: [PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-27 Thread Michael S. Tsirkin
On Tue, Jun 26, 2012 at 11:09:46PM -0600, Alex Williamson wrote: > In order to inject an interrupt from an external source using an > irqfd, we need to allocate a new irq_source_id. This allows us to > assert and (later) de-assert an interrupt line independently from > users of KVM_IRQ_LINE and av

[PATCH v2 4/6] kvm: Extend irqfd to support level interrupts

2012-06-26 Thread Alex Williamson
In order to inject an interrupt from an external source using an irqfd, we need to allocate a new irq_source_id. This allows us to assert and (later) de-assert an interrupt line independently from users of KVM_IRQ_LINE and avoid lost interrupts. We also add what may appear like a bit of excessive