Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-19 Thread Michael S. Tsirkin
On Wed, Sep 19, 2012 at 01:23:35PM -0600, Alex Williamson wrote: > On Wed, 2012-09-19 at 21:48 +0300, Michael S. Tsirkin wrote: > > On Wed, Sep 19, 2012 at 12:23:13PM -0600, Alex Williamson wrote: > > > On Wed, 2012-09-19 at 11:59 +0300, Avi Kivity wrote: > > > > On 09/18/2012 06:16 AM, Alex Willia

Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-19 Thread Alex Williamson
On Wed, 2012-09-19 at 21:48 +0300, Michael S. Tsirkin wrote: > On Wed, Sep 19, 2012 at 12:23:13PM -0600, Alex Williamson wrote: > > On Wed, 2012-09-19 at 11:59 +0300, Avi Kivity wrote: > > > On 09/18/2012 06:16 AM, Alex Williamson wrote: > > > > @@ -92,6 +156,43 @@ irqfd_shutdown(struct work_struct

Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-19 Thread Michael S. Tsirkin
On Wed, Sep 19, 2012 at 12:23:13PM -0600, Alex Williamson wrote: > On Wed, 2012-09-19 at 11:59 +0300, Avi Kivity wrote: > > On 09/18/2012 06:16 AM, Alex Williamson wrote: > > > @@ -92,6 +156,43 @@ irqfd_shutdown(struct work_struct *work) > > >*/ > > > flush_work_sync(&irqfd->inject); > > >

Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-19 Thread Alex Williamson
On Wed, 2012-09-19 at 11:59 +0300, Avi Kivity wrote: > On 09/18/2012 06:16 AM, Alex Williamson wrote: > > @@ -92,6 +156,43 @@ irqfd_shutdown(struct work_struct *work) > > */ > > flush_work_sync(&irqfd->inject); > > > > + if (irqfd->resampler) { > > + struct _irqfd_resampler *

Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-19 Thread Avi Kivity
On 09/19/2012 04:54 PM, Alex Williamson wrote: > On Wed, 2012-09-19 at 12:10 +0300, Avi Kivity wrote: >> On 09/19/2012 12:08 PM, Michael S. Tsirkin wrote: >> >> >> Whoa. Can't we put the resampler entry somewhere we don't need to >> >> search for it? Like a kvm_kernel_irq_routing_entry, that's i

Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-19 Thread Alex Williamson
On Wed, 2012-09-19 at 12:10 +0300, Avi Kivity wrote: > On 09/19/2012 12:08 PM, Michael S. Tsirkin wrote: > > >> Whoa. Can't we put the resampler entry somewhere we don't need to > >> search for it? Like a kvm_kernel_irq_routing_entry, that's indexed by > >> gsi already (kvm_irq_routing_table::rt

Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-19 Thread Avi Kivity
On 09/19/2012 12:08 PM, Michael S. Tsirkin wrote: >> Whoa. Can't we put the resampler entry somewhere we don't need to >> search for it? Like a kvm_kernel_irq_routing_entry, that's indexed by >> gsi already (kvm_irq_routing_table::rt_entries[gsi]). > > I'm not sure why would we bother optimizin

Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-19 Thread Michael S. Tsirkin
On Wed, Sep 19, 2012 at 11:59:33AM +0300, Avi Kivity wrote: > > @@ -247,9 +383,36 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd > > *args) > > /* This fd is used for another irq already. */ > > ret = -EBUSY; > > spin_unlock_irq(&kvm->irqfds.lock); > > +

Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-19 Thread Avi Kivity
On 09/18/2012 06:16 AM, Alex Williamson wrote: > To emulate level triggered interrupts, add a resample option to > KVM_IRQFD. When specified, a new resamplefd is provided that notifies > the user when the irqchip has been resampled by the VM. This may, for > instance, indicate an EOI. Also in th

Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-18 Thread Michael S. Tsirkin
On Mon, Sep 17, 2012 at 09:16:28PM -0600, Alex Williamson wrote: > To emulate level triggered interrupts, add a resample option to > KVM_IRQFD. When specified, a new resamplefd is provided that notifies > the user when the irqchip has been resampled by the VM. This may, for > instance, indicate a

[PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts

2012-09-17 Thread Alex Williamson
To emulate level triggered interrupts, add a resample option to KVM_IRQFD. When specified, a new resamplefd is provided that notifies the user when the irqchip has been resampled by the VM. This may, for instance, indicate an EOI. Also in this mode, injection of an interrupt through an irqfd onl