From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [patch 2/4] QEMU/KVM: save and load mp state
Date: Sun, 06 Apr 2008 12:13:32 +0300 [thread overview]
Message-ID: <47F8943C.9040001@qumranet.com> (raw)
In-Reply-To: <20080405182320.034097299@localhost.localdomain>
Marcelo Tosatti wrote:
> Use the new ioctl's to save and restore the MP_STATE for all vcpu's.
>
> Fixes SMP migration.
>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> Index: kvm-userspace.io/libkvm/libkvm.c
> ===================================================================
> --- kvm-userspace.io.orig/libkvm/libkvm.c
> +++ kvm-userspace.io/libkvm/libkvm.c
> @@ -776,6 +776,17 @@ int kvm_set_sregs(kvm_context_t kvm, int
> return ioctl(kvm->vcpu_fd[vcpu], KVM_SET_SREGS, sregs);
> }
>
> +int kvm_get_mpstate(kvm_context_t kvm, int vcpu, int *mpstate)
> +{
> + return ioctl(kvm->vcpu_fd[vcpu], KVM_GET_MP_STATE, mpstate);
> +}
> +
> +int kvm_set_mpstate(kvm_context_t kvm, int vcpu, int *mpstate)
> +{
> + return ioctl(kvm->vcpu_fd[vcpu], KVM_SET_MP_STATE, mpstate);
> +}
> +
>
I missed the kernel part of this. The functions need KVM_CAP
compile-time and run-time protection. Please separate the libkvm and
qemu parts.
>
> CPUX86State *cpu_x86_init(const char *cpu_model);
> Index: kvm-userspace.io/qemu/vl.c
> ===================================================================
> --- kvm-userspace.io.orig/qemu/vl.c
> +++ kvm-userspace.io/qemu/vl.c
> @@ -6655,8 +6655,10 @@ void cpu_save(QEMUFile *f, void *opaque)
> uint32_t hflags;
> int i;
>
> - if (kvm_enabled())
> + if (kvm_enabled()) {
> kvm_save_registers(env);
> + kvm_save_mpstate(env);
> + }
>
Perhaps fold kvm_save_mpstate() into kvm_save_registers()? We can
regard the mp state as a hidden register.
>
> for(i = 0; i < CPU_NB_REGS; i++)
> qemu_put_betls(f, &env->regs[i]);
> @@ -6748,6 +6750,7 @@ void cpu_save(QEMUFile *f, void *opaque)
> qemu_put_be32s(f, &env->kvm_interrupt_bitmap[i]);
> }
> qemu_put_be64s(f, &env->tsc);
> + qemu_put_be32s(f, &env->mp_state);
> }
> }
>
Bump the format version number and introduce compatibility code, please.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Register now and save $200. Hurry, offer ends at 11:59 p.m.,
Monday, April 7! Use priority code J8TLD2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
next prev parent reply other threads:[~2008-04-06 9:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-05 18:22 [patch 0/4] fix SMP migration and savevm/loadvm Marcelo Tosatti
2008-04-05 18:22 ` [patch 1/4] QEMU/KVM: only use KVM apic registers if vm is running Marcelo Tosatti
2008-04-06 9:09 ` Avi Kivity
2008-04-05 18:22 ` [patch 2/4] QEMU/KVM: save and load mp state Marcelo Tosatti
2008-04-06 9:13 ` Avi Kivity [this message]
2008-04-05 18:22 ` [patch 3/4] QEMU/KVM: ignore SIG_IPI signals in userspace Marcelo Tosatti
2008-04-06 9:15 ` Avi Kivity
2008-04-07 20:26 ` Marcelo Tosatti
2008-04-08 1:17 ` Avi Kivity
2008-04-05 18:22 ` [patch 4/4] QEMU/KVM: dont read any bits from userspace APIC emulation if its done in-kernel Marcelo Tosatti
2008-04-06 9:18 ` Avi Kivity
2008-04-07 17:35 ` Marcelo Tosatti
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=47F8943C.9040001@qumranet.com \
--to=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
--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 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.