From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v4 3/9] KVM: Clear assigned guest IRQ on release Date: Wed, 10 Nov 2010 08:53:35 +0200 Message-ID: <4CDA416F.3060905@redhat.com> References: <4CD92950.1070309@redhat.com> <1289327779.14321.43.camel@x201> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , Marcelo Tosatti , kvm , "Michael S. Tsirkin" To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35121 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752365Ab0KJGxo (ORCPT ); Wed, 10 Nov 2010 01:53:44 -0500 In-Reply-To: <1289327779.14321.43.camel@x201> Sender: kvm-owner@vger.kernel.org List-ID: On 11/09/2010 08:36 PM, Alex Williamson wrote: > > > > Note: all this kvm_set_irq(..., [01]) is incorrect as it doesn't account > > for polarity. Currently the qemu-emulated chipset uses level high pci > > interrupts, but that's not a given from kvm's point of view. > > > > I think vfio fixes this by only routing msi interrupts via the kernel, > > and routing level interrupts through userspace, which can adjust > > polarity. Alex/Michael? > > The latest patches will route legacy interrupts via irqfd if available > too. We do have the issue that KVM pulses interrupts injected this way, > but it seems to work nonetheless. That doesn't sound too good. > I was thinking about proposing a > level flag for set_irqfd to only set it, allowing the ack notifier to > deassert it. Perhaps we also need a flag to toggle the polarity. Or maybe irqfd is not up to this task. I'd rather stick with the ordinary ioctls for this until proven they're too slow. By proven, I mean a userspace irq forwarding implementation that doesn't suck like we it does now (can be just a prototype). -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.