From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Alexander Graf <agraf@suse.de>,
qemu-devel <qemu-devel@nongnu.org>,
Alex Williamson <alex.williamson@redhat.com>,
qemu-ppc@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Paul Mackerras <paulus@samba.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH] RFCv3 kvm irqfd: support msimessage to irq translation in PHB
Date: Sun, 30 Jun 2013 17:37:06 +1000 [thread overview]
Message-ID: <51CFE022.1000600@ozlabs.ru> (raw)
In-Reply-To: <CA+aC4ksLP8BX5WjVbEMpmdwMAcPrtDLpB9rJeZu6iLgwWyWvtA@mail.gmail.com>
On 06/30/2013 12:28 AM, Anthony Liguori wrote:
> On Sat, Jun 29, 2013 at 8:45 AM, Alexey Kardashevskiy <aik@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 <aik@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
next prev parent reply other threads:[~2013-06-30 7:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-29 13:45 [Qemu-devel] [PATCH] RFCv3 kvm irqfd: support msimessage to irq translation in PHB Alexey Kardashevskiy
2013-06-29 14:06 ` Andreas Färber
2013-06-29 14:28 ` Anthony Liguori
2013-06-30 0:59 ` Alexey Kardashevskiy
2013-06-30 6:32 ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
2013-06-30 7:09 ` Alexey Kardashevskiy
2013-06-30 14:23 ` [Qemu-devel] " Anthony Liguori
2013-06-30 7:37 ` Alexey Kardashevskiy [this message]
2013-06-30 14:20 ` Anthony Liguori
2013-08-19 8:10 ` Alexey Kardashevskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51CFE022.1000600@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=agraf@suse.de \
--cc=alex.williamson@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=anthony@codemonkey.ws \
--cc=david@gibson.dropbear.id.au \
--cc=jan.kiszka@siemens.com \
--cc=mst@redhat.com \
--cc=paulus@samba.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).