From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Upuaw-0004mV-JB for qemu-devel@nongnu.org; Fri, 21 Jun 2013 02:13:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Upuav-00047s-5Y for qemu-devel@nongnu.org; Fri, 21 Jun 2013 02:13:14 -0400 Message-ID: <1371795171.3944.52.camel@pasglop> From: Benjamin Herrenschmidt Date: Fri, 21 Jun 2013 16:12:51 +1000 In-Reply-To: <1371794598.30572.122.camel@ul30vt.home> References: <1371737338-25148-1-git-send-email-aik@ozlabs.ru> <1371747090.32709.61.camel@ul30vt.home> <51C3B2E4.7000807@ozlabs.ru> <1371782063.30572.74.camel@ul30vt.home> <51C3BF3E.20901@ozlabs.ru> <1371789981.30572.114.camel@ul30vt.home> <1371791533.3944.50.camel@pasglop> <1371794598.30572.122.camel@ul30vt.home> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] RFC kvm irqfd: add directly mapped MSI IRQ support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: Anthony Liguori , "Michael S . Tsirkin" , Alexey Kardashevskiy , qemu-devel@nongnu.org, Alexander Graf , qemu-trivial@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Paul Mackerras , David Gibson On Fri, 2013-06-21 at 00:03 -0600, Alex Williamson wrote: > On Fri, 2013-06-21 at 15:12 +1000, Benjamin Herrenschmidt wrote: > > On Thu, 2013-06-20 at 22:46 -0600, Alex Williamson wrote: > > > Maybe you could add a device parameter to kvm_irqchip_add_msi_route so > > > that it can be implemented on POWER without this pci_bus_map_msi > > > interface that seems very unique to POWER. Thanks, > > > > You mean unique to all non-x86 ? :-) > > > > I believe almost everybody eventually turn MSIs into "normal" > > interrupts... > > > > Most often than not, the logic to do so is in the PCI Host Bridge. > > > > The whole concept of passing the message address/data accross the > > user/kernel interface is an x86 crackpotery but as is the entire > > remapping/routing layer so ... :-) > > Regardless, this is exactly what kvm_irqchip_add_msi_route does. It > says, here's an MSIMessage, give me an IRQ that sends that. Yes, and in our case, what happens is that the guest said to use "I want an MSI", we picked up an IRQ, and made up a message for it :-) The actual message address/data we use is a complete invention that only exists within qemu. So here we need to basically turn it back into an IRQ, which we might be able to do by ... just making the message (or part of the address) be the IRQ number or something like that. > In the x86 > case, that means pick a free IRQ and program it to send that MSIMessage > when we hit the irqfd. In the case of POWER it means lookup which IRQ > gets fired by that MSIMessage and return it. In a non-accelerated QEMU > case I'd think msi_notify() would write the MSIMessage to this IRQ > remapper device and let it toggle the next qemu_irq down the line. If > we ever add an IOMMU based IRQ remapper to the x86 model, we'd need > something similar. Thanks, Ben.