From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCHv0 RFC] kvm: irqfd support for level interrupts Date: Wed, 19 Aug 2009 15:20:21 +0300 Message-ID: <4A8BEE05.1000105@redhat.com> References: <20090726162225.GA21972@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: gleb@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:52281 "EHLO mx2.redhat.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751161AbZHSMUX (ORCPT ); Wed, 19 Aug 2009 08:20:23 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7JCKPxZ000414 for ; Wed, 19 Aug 2009 08:20:25 -0400 In-Reply-To: <20090726162225.GA21972@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 07/26/2009 07:22 PM, Michael S. Tsirkin wrote: > Here's an untested patch with partial support for level triggered > interrupts in irqfd. What this patch has: support for clearing interrupt > on ack. What this patch does not have: support signalling eventfd on ack > so that userspace can take action and e.g. reenable interrupt. > > Gleb, Marcelo, I'd like your input on the approach taken wrt locking. > Does it look sane? > > Avi, how's the interface? I intend to also add an eventfd probably in > the padding in the irqfd struct. > What about the state-capable eventfd? Seems much more natural for this. > > static struct workqueue_struct *irqfd_cleanup_wq; > @@ -63,10 +65,15 @@ irqfd_inject(struct work_struct *work) > > mutex_lock(&kvm->irq_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); > + if (!irqfd->is_level) > + kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, irqfd->gsi, 0); > e.g. inject the eventfd->state as the irq level. -- error compiling committee.c: too many arguments to function