From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [KVM PATCH v7 2/3] kvm: add support for irqfd via eventfd-notification interface Date: Thu, 14 May 2009 14:22:59 +0300 Message-ID: <4A0BFF13.9090802@redhat.com> References: <20090512181134.26131.10023.stgit@dev.haskins.net> <20090512182655.26131.53824.stgit@dev.haskins.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, viro@ZenIV.linux.org.uk, linux-kernel@vger.kernel.org, davidel@xmailserver.org To: Gregory Haskins Return-path: Received: from mx2.redhat.com ([66.187.237.31]:37572 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760089AbZENLXA (ORCPT ); Thu, 14 May 2009 07:23:00 -0400 In-Reply-To: <20090512182655.26131.53824.stgit@dev.haskins.net> Sender: kvm-owner@vger.kernel.org List-ID: Gregory Haskins wrote: > 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 sources (emulated devices, > pass-through devices, etc) but all must be injected to the guest via > the KVM infrastructure. This patch adds a new mechanism to inject a specific > interrupt to a guest using a decoupled eventfd mechnanism: Any legal signal > on the irqfd (using eventfd semantics from either userspace or kernel) will > translate into an injected interrupt in the guest at the next available > interrupt window. > > + > +static void > +irqfd_inject(struct work_struct *work) > +{ > + struct _irqfd *irqfd = container_of(work, struct _irqfd, work); > + struct kvm *kvm = irqfd->kvm; > + > I think you need to ->read() from the irqfd, otherwise the count will never clear. > + mutex_lock(&kvm->lock); > + kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, irqfd->gsi, 1); > + kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, irqfd->gsi, 0); > + mutex_unlock(&kvm->lock); > +} > -- error compiling committee.c: too many arguments to function