From: Jan Kiszka <jan.kiszka@siemens.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Avi Kivity <avi@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [RFC][PATCH 05/11] kvm: Introduce kvm_irqchip_add_msi_route
Date: Mon, 25 Jun 2012 15:50:02 +0200 [thread overview]
Message-ID: <4FE86C8A.6080700@siemens.com> (raw)
In-Reply-To: <1340631494.14120.88.camel@bling.home>
On 2012-06-25 15:38, Alex Williamson wrote:
> On Mon, 2012-05-14 at 18:07 -0300, Jan Kiszka wrote:
>> Add a service that establishes a static route from a virtual IRQ line to
>> an MSI message. Will be used for IRQFD and device assignment. As we will
>> use this service outside of CONFIG_KVM protected code, stub it properly.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> kvm-all.c | 31 +++++++++++++++++++++++++++++++
>> kvm-stub.c | 8 ++++++++
>> kvm.h | 10 ++++++----
>> 3 files changed, 45 insertions(+), 4 deletions(-)
>>
>> diff --git a/kvm-all.c b/kvm-all.c
>> index 8ab83db..f45b852 100644
>> --- a/kvm-all.c
>> +++ b/kvm-all.c
>> @@ -1080,6 +1080,32 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg)
>> return kvm_irqchip_set_irq(s, route->kroute.gsi, 1);
>> }
>>
>> +int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg)
>> +{
>> + struct kvm_irq_routing_entry kroute;
>> + int gsi;
>> +
>> + if (!kvm_irqchip_in_kernel()) {
>> + return -ENOSYS;
>> + }
>> +
>> + gsi = kvm_get_pseudo_gsi(s);
>> + if (gsi < 0) {
>> + return gsi;
>> + }
>> +
>> + kroute.gsi = gsi;
>> + kroute.type = KVM_IRQ_ROUTING_MSI;
>> + kroute.flags = 0;
>> + kroute.u.msi.address_lo = (uint32_t)msg.address;
>> + kroute.u.msi.address_hi = msg.address >> 32;
>> + kroute.u.msi.data = msg.data;
>> +
>> + kvm_add_routing_entry(s, &kroute);
>> +
>> + return gsi;
>> +}
>> +
>> #else /* !KVM_CAP_IRQ_ROUTING */
>>
>> static void kvm_init_irq_routing(KVMState *s)
>> @@ -1090,6 +1116,11 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg)
>> {
>> abort();
>> }
>> +
>> +int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg)
>> +{
>> + abort();
>> +}
>> #endif /* !KVM_CAP_IRQ_ROUTING */
>
>
> Jan,
>
> Could we perhaps return a sane error value here? This seems to be the
> initial function used to setup direct MSI injection and if we have code
> like:
>
> virq = kvm_irqchip_add_msi_route(...)
> if (virq < 0) {
> slow path...
> } else {
> fast path...
> }
>
> It works on x86 w/ or w/o irqchip, works with kvm disabled, but gives an
> abort on !x86. I really don't want to have to surround the above in a
> #define or in-kernel ioapic test. Thanks,
No problems, just send a patch.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2012-06-25 13:50 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 21:07 [RFC][PATCH 00/11] uq/master: irqfd-based interrupt injection for virtio/vhost Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 01/11] msix: Factor out msix_get_message Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 02/11] msix: Invoke msix_handle_mask_update on msix_mask_all Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 03/11] msix: Introduce vector notifiers Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-15 13:31 ` [PATCH 12/11] msix: Trigger vector mask update check after vmload Jan Kiszka
2012-05-15 13:31 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 04/11] kvm: Rename kvm_irqchip_add_route to kvm_irqchip_add_irq_route Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 05/11] kvm: Introduce kvm_irqchip_add_msi_route Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-06-25 13:38 ` Alex Williamson
2012-06-25 13:50 ` Jan Kiszka [this message]
2012-05-14 21:07 ` [RFC][PATCH 06/11] kvm: Publicize kvm_release_gsi as kvm_irqchip_release_virq Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 07/11] kvm: Make kvm_irqchip_commit_routes an internal service Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 08/11] kvm: Introduce kvm_irqchip_add/remove_irqfd Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 09/11] kvm: Enable use of kvm_irqchip_in_kernel in hwlib code Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 10/11] msix: Add msix_nr_vectors_allocated Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
2012-05-14 21:07 ` [RFC][PATCH 11/11] virtio/vhost: Add support for KVM in-kernel MSI injection Jan Kiszka
2012-05-14 21:07 ` [Qemu-devel] " Jan Kiszka
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=4FE86C8A.6080700@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.