All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: kvm@vger.kernel.org, avi@redhat.com
Subject: Re: [PATCH] qemu-kvm: reserve the low 24 gsi values
Date: Tue, 21 Jul 2009 20:21:15 +0300	[thread overview]
Message-ID: <20090721172115.GD1424@redhat.com> (raw)
In-Reply-To: <20090721155742.GC3229@redhat.com>

On Tue, Jul 21, 2009 at 06:57:42PM +0300, Michael S. Tsirkin wrote:
> reserve gsi 0 to 23 so that they won't be allocated for msi
> 
In the not so distant future we may want to support more then one
ioapic, so 23 will became 23*n where n is a number of ioapics. I prefer
to fix it by moving msi injection to its own ioctl. But for now may be
we can scan used_gsi_bitmap from the end during allocation of gsi for
msi?

> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> ---
> 
> diff --git a/qemu-kvm.c b/qemu-kvm.c
> index c6c9fc6..f440b2d 100644
> --- a/qemu-kvm.c
> +++ b/qemu-kvm.c
> @@ -1613,10 +1613,12 @@ int kvm_get_irq_route_gsi(kvm_context_t kvm)
>  {
>  	int i, bit;
>  	uint32_t *buf = kvm->used_gsi_bitmap;
> +	uint32_t mask = 0xff000000;
>  
>  	/* Return the lowest unused GSI in the bitmap */
> -	for (i = 0; i < kvm->max_gsi / 32; i++) {
> -		bit = ffs(~buf[i]);
> +	for (i = 0; i < kvm->max_gsi / 32; i++) {
> +		bit = ffs(~buf[i] & mask);
> +		mask = 0xffffffff;
>  		if (!bit)
>  			continue;
>  

--
			Gleb.

  reply	other threads:[~2009-07-21 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 15:57 [PATCH] qemu-kvm: reserve the low 24 gsi values Michael S. Tsirkin
2009-07-21 17:21 ` Gleb Natapov [this message]
2009-07-21 20:23   ` Michael S. Tsirkin

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=20090721172115.GD1424@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@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 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.