From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqAcO-0002HH-Aj for qemu-devel@nongnu.org; Fri, 21 Jun 2013 19:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqAcN-0005R0-9K for qemu-devel@nongnu.org; Fri, 21 Jun 2013 19:19:48 -0400 Message-ID: <1371856771.3944.85.camel@pasglop> From: Benjamin Herrenschmidt Date: Sat, 22 Jun 2013 09:19:31 +1000 In-Reply-To: <1371856234.30572.140.camel@ul30vt.home> References: <1371806575-19347-1-git-send-email-aik@ozlabs.ru> <1371806575-19347-3-git-send-email-aik@ozlabs.ru> <1371816181.3944.58.camel@pasglop> <4C36A400-2A38-458A-B849-8D8F6D49A566@suse.de> <1371816659.3944.63.camel@pasglop> <0E9E14EB-DD5F-4B7A-ACE5-6C9F0103324C@suse.de> <1371851687.3944.69.camel@pasglop> <1371853305.3944.83.camel@pasglop> <1371856234.30572.140.camel@ul30vt.home> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] KVM: add kvm_arch_irqchip_add_msi_route List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: Anthony Liguori , Alexey Kardashevskiy , Alexander Graf , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, David Gibson On Fri, 2013-06-21 at 17:10 -0600, Alex Williamson wrote: > MSI-X is rather ugly. As you suggest, we trap accesses to the MSI-X > table. We don't know how many vectors the guest is going to use, so we > incrementally add them by disabling and re-enabling with a new vector > count. The host decides what to put in the table, we don't care. All > interrupts bounce through the host and get to the guest via eventfd, > either through qemu or directly through KVM irqfd. > > If an in-use vector is modified, we write the new "MSI route" to KVM, > the host doesn't need to care. If a vector is masked, we free the host > irq handler w/o modifying the vector configuration. There's a comment > in hw/misc/vfio.c that we could also just bounce masked vectors through > qemu and let it drop it if we wanted to completely avoid toggling the > host. Linux currently does not have a usable interface for masking > vectors at the device. Thanks, Right. It might also be handy to add what Willy's been talking about for a while now, which is an interface to enable/setup individual MSI-X at runtime. Cheers, Ben.