From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH v3 5/5] KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices Date: Wed, 3 Nov 2010 11:05:50 +0200 Message-ID: <20101103090550.GG6772@redhat.com> References: <628f014fb1efb8e2208db03d13198ba301a3a34c.1288771873.git.jan.kiszka@web.de> <20101103084320.GF6772@redhat.com> <4CD1227E.9020908@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , kvm , Alex Williamson , Jan Kiszka To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21073 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753743Ab0KCJFx (ORCPT ); Wed, 3 Nov 2010 05:05:53 -0400 Content-Disposition: inline In-Reply-To: <4CD1227E.9020908@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Nov 03, 2010 at 09:51:10AM +0100, Jan Kiszka wrote: > Am 03.11.2010 09:43, 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. > > I understand the problem, but I don't get why the kernel should bother. > User space has to filter the config space access, returning precisely > the value of the INTx disabled bit that the guest wrote. Yes but if guest disables INTx it should not get interrupts :) > > > > 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? > > You mean on the guest IRQ line (host-side sharing is obviously fine)? > Don't know, but that wouldn't be a new issue. Need to study the sources > /wrt IRQ line arbitration and concurrent use. > > Jan >