Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-14 Thread Michael S. Tsirkin
On Sun, Jun 14, 2009 at 04:40:11PM +0300, Avi Kivity wrote: > Michael S. Tsirkin wrote: > > > >>> I don't want to assume that the eventfds all come from the same source. >>> >>> That said, we have a workaround, allocate a new gsi with the same >>> routes and attach the excess eventfds there. >>

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-14 Thread Avi Kivity
Michael S. Tsirkin wrote: I don't want to assume that the eventfds all come from the same source. That said, we have a workaround, allocate a new gsi with the same routes and attach the excess eventfds there. Right. So you are ok with 1:1 irqfd:gsi requirement for now? This seems ni

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-14 Thread Michael S. Tsirkin
On Sun, Jun 14, 2009 at 04:23:36PM +0300, Avi Kivity wrote: > Michael S. Tsirkin wrote: > > > >>> I think Avi asked for this specific feature during review which is the >>> reason why its there today. However, I agree that it would probably be >>> a good idea to put an upper limit on the number

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-14 Thread Avi Kivity
Michael S. Tsirkin wrote: I think Avi asked for this specific feature during review which is the reason why its there today. However, I agree that it would probably be a good idea to put an upper limit on the number of supported aliases that can be registered. Will fix. Thanks Michael, -G

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-14 Thread Michael S. Tsirkin
On Sun, Jun 14, 2009 at 08:25:43AM -0400, Gregory Haskins wrote: > Michael S. Tsirkin wrote: > > On Thu, Jun 11, 2009 at 04:16:47PM +0300, Michael S. Tsirkin wrote: > > > >>> + > >>> + ret = file->f_op->poll(file, &irqfd->pt); > >>> + if (ret < 0) > >>> + goto fail; > >>> > > > >

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-14 Thread Michael S. Tsirkin
On Sun, Jun 14, 2009 at 08:40:57AM -0400, Gregory Haskins wrote: > Michael S. Tsirkin wrote: > > On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > > > > ... > > > > > >> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c > >> +static int > >> +kvm_assign_irqfd(struct kvm *kvm,

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-14 Thread Gregory Haskins
Michael S. Tsirkin wrote: > On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > > ... > > >> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c >> +static int >> +kvm_assign_irqfd(struct kvm *kvm, int fd, int gsi) >> +{ >> +struct _irqfd *irqfd; >> +struct file *file = N

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-14 Thread Gregory Haskins
Michael S. Tsirkin wrote: > On Thu, Jun 11, 2009 at 04:16:47PM +0300, Michael S. Tsirkin wrote: > >>> + >>> + ret = file->f_op->poll(file, &irqfd->pt); >>> + if (ret < 0) >>> + goto fail; >>> > > Looking at it some more, we have: > struct file_operations { > > uns

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-14 Thread Michael S. Tsirkin
On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: ... > diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c > +static int > +kvm_assign_irqfd(struct kvm *kvm, int fd, int gsi) > +{ > + struct _irqfd *irqfd; > + struct file *file = NULL; > + int ret; > + > + irqfd =

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-11 Thread Michael S. Tsirkin
On Thu, Jun 11, 2009 at 04:16:47PM +0300, Michael S. Tsirkin wrote: > > + > > + ret = file->f_op->poll(file, &irqfd->pt); > > + if (ret < 0) > > + goto fail; Looking at it some more, we have: struct file_operations { unsigned int (*poll) (struct file *, struct poll_table

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-06-11 Thread Michael S. Tsirkin
Going over this code again, I seem to see a minor error handling issue here: On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c > new file mode 100644 > index 000..72a282e > --- /dev/null > +++ b/virt/kvm/eventfd.c > @@ -0,0

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-27 Thread Gregory Haskins
Michael S. Tsirkin wrote: > On Wed, May 27, 2009 at 04:07:23PM -0400, Gregory Haskins wrote: > >> Do you have a particular suggestion in mind? >> > > Yes. I'll try to post a patch soon. > > Sounds good. Thanks Michael. -Greg signature.asc Description: OpenPGP digital signature

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-27 Thread Michael S. Tsirkin
On Wed, May 27, 2009 at 04:07:23PM -0400, Gregory Haskins wrote: > Michael S. Tsirkin wrote: > > On Wed, May 27, 2009 at 10:06:50AM -0400, Gregory Haskins wrote: > > > >> Michael S. Tsirkin wrote: > >> > >>> On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > >>> > >>>

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-27 Thread Gregory Haskins
Michael S. Tsirkin wrote: > On Wed, May 27, 2009 at 10:06:50AM -0400, Gregory Haskins wrote: > >> Michael S. Tsirkin wrote: >> >>> On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: >>> >>> +static int +kvm_assign_irqfd(struct kvm *kvm, int fd, int gsi) >>>

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-27 Thread Davide Libenzi
On Wed, 27 May 2009, Michael S. Tsirkin wrote: > On Wed, May 27, 2009 at 10:06:50AM -0400, Gregory Haskins wrote: > > Michael S. Tsirkin wrote: > > > On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > > > > > >> +static int > > >> +kvm_assign_irqfd(struct kvm *kvm, int fd, int g

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-27 Thread Michael S. Tsirkin
On Wed, May 27, 2009 at 10:06:50AM -0400, Gregory Haskins wrote: > Michael S. Tsirkin wrote: > > On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > > > >> +static int > >> +kvm_assign_irqfd(struct kvm *kvm, int fd, int gsi) > >> +{ > >> + struct _irqfd *irqfd; > >> + struct fil

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-27 Thread Gregory Haskins
Michael S. Tsirkin wrote: > On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > >> +static int >> +kvm_assign_irqfd(struct kvm *kvm, int fd, int gsi) >> +{ >> +struct _irqfd *irqfd; >> +struct file *file = NULL; >> +int ret; >> + >> +irqfd = kzalloc(sizeof(*irqfd),

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-27 Thread Michael S. Tsirkin
On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > +static int > +kvm_assign_irqfd(struct kvm *kvm, int fd, int gsi) > +{ > + struct _irqfd *irqfd; > + struct file *file = NULL; > + int ret; > + > + irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL); > + if (!irqfd) > +

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-26 Thread Davide Libenzi
On Tue, 26 May 2009, Michael S. Tsirkin wrote: > On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > > +static int > > +irqfd_wakeup(wait_queue_t *wait, unsigned mode, int sync, void *key) > > +{ > > + struct _irqfd *irqfd = container_of(wait, struct _irqfd, wait); > > + > > + /

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-26 Thread Gregory Haskins
Michael S. Tsirkin wrote: > On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > >> +static int >> +irqfd_wakeup(wait_queue_t *wait, unsigned mode, int sync, void *key) >> +{ >> +struct _irqfd *irqfd = container_of(wait, struct _irqfd, wait); >> + >> +/* >> + * The wake

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-26 Thread Michael S. Tsirkin
On Wed, May 20, 2009 at 10:30:49AM -0400, Gregory Haskins wrote: > +static int > +irqfd_wakeup(wait_queue_t *wait, unsigned mode, int sync, void *key) > +{ > + struct _irqfd *irqfd = container_of(wait, struct _irqfd, wait); > + > + /* > + * The wake_up is called with interrupts disable

[KVM PATCH v10] kvm: add support for irqfd

2009-05-20 Thread Gregory Haskins
(Applies to kvm.git/queue:fd2e987d) KVM provides a complete virtual system environment for guests, including support for injecting interrupts modeled after the real exception/interrupt facilities present on the native platform (such as the IDT on x86). Virtual interrupts can come from a variety of

Re: [KVM PATCH v10] kvm: add support for irqfd

2009-05-20 Thread Avi Kivity
Gregory Haskins wrote: (Applies to kvm.git/queue:fd2e987d) KVM provides a complete virtual system environment for guests, including support for injecting interrupts modeled after the real exception/interrupt facilities present on the native platform (such as the IDT on x86). Virtual interrupts c