From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [PATCH v3 5/5] KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices Date: Wed, 03 Nov 2010 09:57:47 -0600 Message-ID: <1288799867.3045.149.camel@x201> References: <628f014fb1efb8e2208db03d13198ba301a3a34c.1288771873.git.jan.kiszka@web.de> <20101103084320.GF6772@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , Avi Kivity , Marcelo Tosatti , kvm , Jan Kiszka To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:60297 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752818Ab0KCP5v (ORCPT ); Wed, 3 Nov 2010 11:57:51 -0400 In-Reply-To: <20101103084320.GF6772@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2010-11-03 at 10:43 +0200, Michael S. Tsirkin wrote: > On Wed, Nov 03, 2010 at 09:11:16AM +0100, Jan Kiszka wrote: > > From: Jan Kiszka > > > > PCI 2.3 allows to generically disable IRQ sources at device level. This > > enables us to share IRQs of such devices between on the host side when > > passing them to a guest. This feature is optional, user space has to > > request it explicitly. > > > > Signed-off-by: Jan Kiszka > > > I just realized something. > With this patch, if guest ever looks at > interrupt disable bit, it will go crazy as that bit goes on/off by > itself. I guess we could have an ioctl to set/clear the bit on > device, and have qemu call that on config write into command/status > register. > > There's also something I don't completely unerstand with current code: > how does interrupt sharing work? E.g. can assigned and emulated > devices share an interrupt? I've been pondering this with VFIO too. There it seems to work, even when I enable irqfd. The VFIO kernel/qemu driver needs to filter EOIs based on whether the interrupt was actually asserted by the device, but I think we're likely relying somewhat on interrupts being reasserted to help us keep everything serviced. Alex