public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH 5/7] qemu-kvm: Move gsi bits from kvm_msix_vector_add to kvm_msi_add_message
Date: Wed, 27 Apr 2011 15:54:11 +0300	[thread overview]
Message-ID: <20110427125411.GF15788@redhat.com> (raw)
In-Reply-To: <cbb603304713eeb0ad413a98ab7705cb28dcc428.1303554218.git.jan.kiszka@web.de>

On Sat, Apr 23, 2011 at 12:23:38PM +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Testing support and allocating a GSI for an MSI message is required both
> for MSI and MSI-X. At this chance, drop the aging version warning.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

No objection, but I do note that this means running on an old
kernel will lead to a silent failure.
stderr output is not in fact much better: I think we should
check the capability in msix_init. Care coding this up?

> ---
>  hw/msix.c  |   13 -------------
>  qemu-kvm.c |   11 +++++++++++
>  2 files changed, 11 insertions(+), 13 deletions(-)
> 
> diff --git a/hw/msix.c b/hw/msix.c
> index 1bdffb6..8c8bc18 100644
> --- a/hw/msix.c
> +++ b/hw/msix.c
> @@ -113,19 +113,6 @@ static int kvm_msix_vector_add(PCIDevice *dev, unsigned vector)
>      KVMMsiMessage *kmm = dev->msix_irq_entries + vector;
>      int r;
>  
> -    if (!kvm_has_gsi_routing()) {
> -        fprintf(stderr, "Warning: no MSI-X support found. "
> -                "At least kernel 2.6.30 is required for MSI-X support.\n"
> -               );
> -        return -EOPNOTSUPP;
> -    }
> -
> -    r = kvm_get_irq_route_gsi();
> -    if (r < 0) {
> -        fprintf(stderr, "%s: kvm_get_irq_route_gsi failed: %s\n", __func__, strerror(-r));
> -        return r;
> -    }
> -    kmm->gsi = r;
>      kvm_msix_message_from_vector(dev, vector, kmm);
>      r = kvm_msi_message_add(kmm);
>      if (r < 0) {
> diff --git a/qemu-kvm.c b/qemu-kvm.c
> index 9cbc109..7317f87 100644
> --- a/qemu-kvm.c
> +++ b/qemu-kvm.c
> @@ -984,6 +984,17 @@ static void kvm_msi_routing_entry(struct kvm_irq_routing_entry *e,
>  int kvm_msi_message_add(KVMMsiMessage *msg)
>  {
>      struct kvm_irq_routing_entry e;
> +    int ret;
> +
> +    if (!kvm_has_gsi_routing()) {
> +        return -EOPNOTSUPP;
> +    }
> +
> +    ret = kvm_get_irq_route_gsi();
> +    if (ret < 0) {
> +        return ret;
> +    }
> +    msg->gsi = ret;
>  
>      kvm_msi_routing_entry(&e, msg);
>      return kvm_add_routing_entry(&e);
> -- 
> 1.7.1

  reply	other threads:[~2011-04-27 12:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-23 10:23 [PATCH 0/7] qemu-kvm: Clean up and enhance MSI irqchip support Jan Kiszka
2011-04-23 10:23 ` [PATCH 1/7] qemu-kvm: Drop unneeded kvm_irq_routing_entry declaration Jan Kiszka
2011-04-23 10:23 ` [PATCH 2/7] qemu-kvm: Rename kvm_msix_message to KVMMsiMessage Jan Kiszka
2011-04-27 13:34   ` Michael S. Tsirkin
2011-04-27 14:04     ` Jan Kiszka
2011-04-27 14:29       ` Avi Kivity
2011-04-27 14:30         ` Jan Kiszka
2011-04-27 14:40           ` Avi Kivity
2011-04-27 14:47             ` Jan Kiszka
2011-04-27 14:36         ` Michael S. Tsirkin
2011-04-27 14:35       ` Michael S. Tsirkin
2011-04-23 10:23 ` [PATCH 3/7] qemu-kvm: Refactor MSI core API of KVM Jan Kiszka
2011-04-23 10:23 ` [PATCH 4/7] qemu-kvm: Fix and clean up msix vector use/unuse hooks Jan Kiszka
2011-04-27 12:06   ` Michael S. Tsirkin
2011-04-23 10:23 ` [PATCH 5/7] qemu-kvm: Move gsi bits from kvm_msix_vector_add to kvm_msi_add_message Jan Kiszka
2011-04-27 12:54   ` Michael S. Tsirkin [this message]
2011-04-27 13:29     ` Jan Kiszka
2011-04-27 13:36       ` Michael S. Tsirkin
2011-04-23 10:23 ` [PATCH 6/7] qemu-kvm: Move entry comparison into kvm_msi_update_message Jan Kiszka
2011-04-23 10:23 ` [PATCH 7/7] qemu-kvm: Add in-kernel irqchip support for MSI Jan Kiszka
2011-04-27 13:31   ` Michael S. Tsirkin
2011-04-27 14:44     ` 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=20110427125411.GF15788@redhat.com \
    --to=mst@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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