From: Marcelo Tosatti <mtosatti@redhat.com>
To: Glauber Costa <glommer@redhat.com>
Cc: kvm@vger.kernel.org, avi@redhat.com
Subject: Re: [RFC] Do clock adjustments over migration
Date: Thu, 15 Oct 2009 17:08:16 -0300 [thread overview]
Message-ID: <20091015200816.GC11656@amt.cnet> (raw)
In-Reply-To: <1255626925-3140-1-git-send-email-glommer@redhat.com>
On Thu, Oct 15, 2009 at 01:15:25PM -0400, Glauber Costa wrote:
> Hey,
>
> This patch is a proposal only. Among other things, it relies on a patch
> Juan is yet to send, and I also would want to give it a bit more testing.
> It shows my indented use of the new ioctl interface I've been proposing.
>
> First of all, we have to save the kvmclock msrs. This is per-cpu, and we
> were failing to do it so far.
>
> The ioctls are issued in pre-save and post-load sections of a new vmstate
> handler. I am not doing it in the cpu vmstate handler, because this has to
> be done once per VM, not cpu. What I basically do is to grab the time
> from GET ioctl, pass on through migration, and then do a SET on the other
> side. Should be straighforward.
>
> Please let me hear your thoughts. And don't get me started with this
> "you can't hear thoughts" thing!
>
> Signed-off-by: Glauber Costa <glommer@redhat.com>
> ---
> kvm/include/linux/kvm.h | 9 +++++++++
> qemu-kvm-x86.c | 6 ++++++
> qemu-kvm.c | 29 +++++++++++++++++++++++++++++
> target-i386/cpu.h | 3 ++-
> target-i386/machine.c | 2 ++
> 5 files changed, 48 insertions(+), 1 deletions(-)
>
> diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
> index fffcfd8..75e2ffd 100644
> --- a/qemu-kvm-x86.c
> +++ b/qemu-kvm-x86.c
> @@ -834,6 +834,9 @@ static int get_msr_entry(struct kvm_msr_entry *entry, CPUState *env)
> case MSR_VM_HSAVE_PA:
> env->vm_hsave = entry->data;
> break;
> + case MSR_KVM_SYSTEM_TIME:
> + env->system_time_msr = entry->data;
> + break;
> default:
> printf("Warning unknown msr index 0x%x\n", entry->index);
> return 1;
> @@ -1001,6 +1004,7 @@ void kvm_arch_load_regs(CPUState *env)
> set_msr_entry(&msrs[n++], MSR_LSTAR , env->lstar);
> }
> #endif
> + set_msr_entry(&msrs[n++], MSR_KVM_SYSTEM_TIME, env->system_time_msr);
>
> rc = kvm_set_msrs(env->kvm_cpu_state.vcpu_ctx, msrs, n);
> if (rc == -1)
> @@ -1179,6 +1183,8 @@ void kvm_arch_save_regs(CPUState *env)
> msrs[n++].index = MSR_LSTAR;
> }
> #endif
> + msrs[n++].index = MSR_KVM_SYSTEM_TIME;
> +
fix MSR_COUNT for kvm_arch_save_regs()
Otherwise looks good.
next prev parent reply other threads:[~2009-10-15 20:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-15 17:15 [RFC] Do clock adjustments over migration Glauber Costa
2009-10-15 20:08 ` Marcelo Tosatti [this message]
2009-10-15 20:21 ` Glauber Costa
2009-10-15 22:53 ` Glauber Costa
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=20091015200816.GC11656@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=glommer@redhat.com \
--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 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.