From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Upv1K-00041l-QZ for qemu-devel@nongnu.org; Fri, 21 Jun 2013 02:40:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Upv1I-00058x-0w for qemu-devel@nongnu.org; Fri, 21 Jun 2013 02:40:30 -0400 Received: from mail-ie0-x22a.google.com ([2607:f8b0:4001:c03::22a]:56059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Upv1H-00058X-So for qemu-devel@nongnu.org; Fri, 21 Jun 2013 02:40:27 -0400 Received: by mail-ie0-f170.google.com with SMTP id e11so18856838iej.1 for ; Thu, 20 Jun 2013 23:40:26 -0700 (PDT) Message-ID: <51C3F552.6050609@ozlabs.ru> Date: Fri, 21 Jun 2013 16:40:18 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 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> <1371795171.3944.52.camel@pasglop> In-Reply-To: <1371795171.3944.52.camel@pasglop> Content-Type: text/plain; charset=KOI8-R 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: Benjamin Herrenschmidt Cc: Anthony Liguori , "Michael S . Tsirkin" , qemu-trivial@nongnu.org, qemu-devel@nongnu.org, Alexander Graf , Alex Williamson , qemu-ppc@nongnu.org, Paolo Bonzini , Paul Mackerras , David Gibson On 06/21/2013 04:12 PM, Benjamin Herrenschmidt wrote: > 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, Yes, I am changing IRQ to MSI message conversion (and some other things as replacing per PHB MSI windows to one for a whole system) and I am going to post something tonight. -- Alexey