On 06/30/2013 12:28 AM, Anthony Liguori wrote: > On Sat, Jun 29, 2013 at 8:45 AM, Alexey Kardashevskiy <a...@ozlabs.ru> wrote: >> On PPC64 systems MSI Messages are translated to system IRQ in a PCI >> host bridge. This is already supported for emulated MSI/MSIX but >> not for irqfd where the current QEMU allocates IRQ numbers from >> irqchip and maps MSIMessages to those IRQ in the host kernel. >> >> The patch extends irqfd support in order to avoid unnecessary >> mapping and reuse the one which already exists in a PCI host bridge. >> >> Specifically, a map_msi callback is added to PCIBus and pci_bus_map_msi() >> to PCI API. The latter returns -1 if a specific PHB does not provide >> with any trsnslation so the existing code will work. > > I think there's a bit of confusion here. The kernel needs a "virq" > number to create an eventfd. virq is just a KVM concept, it doesn't > correspond to anything useful in hardware. > > On pseries, there is a 1-1 mapping between XICS IRQs and VIRQs and MSI > can be trivially mapped to a virq. > > On x86, we need to call a special kernel function which essentially > creates an apic message->virq mapping such that we can deliver the > irqfd. > > So what this should look like is: > > 1) A PCI bus function to do the MSI -> virq mapping > 2) On x86 (and e500), this is implemented by calling > kvm_irqchip_add_msi_route() > 3) On pseries, this just returns msi->data > > Perhaps (2) can just be the default PCI bus implementation to simplify things. > >> Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> >> >> --- >> >> Looks like we agreed that in general PHB is the right place for this, >> not KVM, so I am trying again. >> >> Probably something should be done to kvm_irqchip_update_msi_route() >> as well but I do not really understand what exactly. Any suggestions?
Ah. Everybody ignored, I'll try asking again :) kvm_irqchip_update_msi_route() - where should it go? What is it for? virtio-pci and pci device assignment use it but vfio does not - is it a bug of vfio? Thanks. -- Alexey