From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCHv0 RFC] kvm: irqfd support for level interrupts Date: Wed, 19 Aug 2009 16:09:05 +0300 Message-ID: <20090819130905.GC3080@redhat.com> References: <20090726162225.GA21972@redhat.com> <4A8BEE05.1000105@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: gleb@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:36187 "EHLO mx2.redhat.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751868AbZHSNK1 (ORCPT ); Wed, 19 Aug 2009 09:10:27 -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 n7JDASXo007353 for ; Wed, 19 Aug 2009 09:10:28 -0400 Content-Disposition: inline In-Reply-To: <4A8BEE05.1000105@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Aug 19, 2009 at 03:20:21PM +0300, Avi Kivity wrote: > 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? This patch precedes that effort. > Seems much more natural for this. Good. Could you please review and ack the state-capable eventfd patch then, so I can try pushing it upstream? >> >> 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