From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [PATCH v8 6/6] kvm: Add de-assert option to KVM_IRQ_ACKFD Date: Wed, 15 Aug 2012 11:24:03 -0600 Message-ID: <1345051443.4683.425.camel@ul30vt.home> References: <20120810223633.809.44188.stgit@bling.home> <20120810223754.809.60610.stgit@bling.home> <20120815141113.GE3068@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: avi@redhat.com, gleb@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20120815141113.GE3068@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, 2012-08-15 at 17:11 +0300, Michael S. Tsirkin wrote: > On Fri, Aug 10, 2012 at 04:37:56PM -0600, Alex Williamson wrote: > > It's likely (vfio) that one of the reasons to watch for an IRQ ACK > > is to de-assert and re-enable an interrupt. As the IRQ ACK notfier > > is already watching a GSI for an IRQ source ID we can easily couple > > these together. > > > > Signed-off-by: Alex Williamson > > This source id is required the only way to assert > in the 1st place is with irqfd. ioctl(fd, KVM_IRQ_ACKFD, kvm_irq_ackfd.{flags = 0, fd = eventfd, gsi = $GSI}); ioctl(fd, KVM_IRQ_LINE, kvm_irq_level.{irq = $GSI, level = 1); /* eventfd notification */ ioctl(fd, KVM_IRQ_LINE, kvm_irq_level.{irq = $GSI, level = 0); > So why is this an ackfd flag and not an irqfd flag? > I am guessing because this way you do not need > an extra ack notifier, but isn't this an internal > optimization leaking out to userspace? If irqfd were to setup it's own irq ack notifier for de-assert, we can guarantee the ordering of de-assert vs eventfd trigger. So, whoever does one, needs to do both. Thanks, Alex