public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Gleb Natapov <gleb@redhat.com>, kvm-devel <kvm@vger.kernel.org>
Subject: Re: [RFC][PATCH] qemu-kvm: x86: Refactor persistent CPU state
Date: Sun, 24 May 2009 15:13:00 +0300	[thread overview]
Message-ID: <4A1939CC.8030206@redhat.com> (raw)
In-Reply-To: <4A15BFCB.6050403@web.de>

Jan Kiszka wrote:
> This patch reworks the KVM-related layout and encoding of the CPU state
> to be saved to disk or migrated. The goal is to define a format, version
> 9, that is also acceptable for upstream and can later be merged into
> QEMU. Besides unconditionally writing KVM states, this format compresses
> interrupt_bitmap into a single number as there can be no more than one
> pending IRQ at a time.
>
>  
> -    if (kvm_enabled()) {
> -        for (i = 0; i < sizeof(env->interrupt_bitmap)/8 ; i++) {
> -            qemu_put_be64s(f, &env->interrupt_bitmap[i]);
> +    /* KVM-related states */
> +
> +    /* There can only be one pending IRQ set in the bitmap at a time, so try
> +       to find it and save its number instead (-1 for none). */
> +    pending_irq = -1;
> +    for (i = 0; i < sizeof(env->interrupt_bitmap)/2; i++) {
> +        bit = ffs(((uint16_t *)env->interrupt_bitmap)[i]);
> +        if (bit) {
> +            pending_irq = i * 16 + bit;
>   

bit - 1

> +            break;
>          }
>   

Why are you using uint64_t?  It would be more natural to use ffsll and 
the natural type of the bitmap vector.

> +        } else {
> +            kvm_load_registers(env);
> +            kvm_load_tsc(env);
>              kvm_load_mpstate(env);
>          }
>      }
>   

Don't you need to load the pending interrupt?

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-05-24 12:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-21 20:55 [RFC][PATCH] qemu-kvm: x86: Refactor persistent CPU state Jan Kiszka
2009-05-24 12:13 ` Avi Kivity [this message]
2009-05-25  6:47   ` [PATCH v2] " Jan Kiszka
2009-05-27  9:48     ` Avi Kivity
2009-05-27 10:16       ` [PATCH v3] " Jan Kiszka
2009-05-27 11:03         ` Avi Kivity
2009-05-27 11:39           ` 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=4A1939CC.8030206@redhat.com \
    --to=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.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