From: Paolo Bonzini <pbonzini@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>, kvm@vger.kernel.org
Subject: Re: [patch 3/3] KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR
Date: Thu, 28 May 2015 10:52:05 +0200 [thread overview]
Message-ID: <5566D735.9050804@redhat.com> (raw)
In-Reply-To: <20150528014929.546279051@redhat.com>
On 28/05/2015 03:47, Marcelo Tosatti wrote:
> Initialize kvmclock base, on kvmclock system MSR write time,
> so that the guest sees kvmclock counting from zero.
>
> This matches baremetal behaviour when kvmclock in guest
> sets sched clock stable.
>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> ---
> arch/x86/kvm/x86.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> Index: kvm/arch/x86/kvm/x86.c
> ===================================================================
> --- kvm.orig/arch/x86/kvm/x86.c 2015-05-27 17:40:46.948189811 -0300
> +++ kvm/arch/x86/kvm/x86.c 2015-05-27 22:43:47.340413347 -0300
> @@ -1703,6 +1703,8 @@
> /* If the host uses TSC clocksource, then it is stable */
> if (use_master_clock)
> pvclock_flags |= PVCLOCK_TSC_STABLE_BIT;
> + if (ka->kvmclk_counts_from_zero)
Not defined anywhere.
> + pvclock_flags |= PVCLOCK_COUNTS_FROM_ZERO;
Why can't this be unconditional?
Paolo
> vcpu->hv_clock.flags = pvclock_flags;
>
> @@ -2282,6 +2284,9 @@
> &vcpu->requests);
>
> ka->boot_vcpu_runs_old_kvmclock = tmp;
> +
> + ka->kvmclock_offset = -get_kernel_ns();
> + ka->kvmclk_counts_from_zero = true;
> }
>
> vcpu->arch.time = data;
>
>
prev parent reply other threads:[~2015-05-28 8:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 1:46 [patch 0/3] kvmclock: allow stable sched clock Marcelo Tosatti
2015-05-28 1:46 ` [patch 1/3] x86: kvmclock: add flag to indicate pvclock counts from zero Marcelo Tosatti
2015-05-28 1:46 ` [patch 2/3] x86: kvmclock: set scheduler clock stable Marcelo Tosatti
2015-05-28 8:39 ` Paolo Bonzini
2015-05-28 1:47 ` [patch 3/3] KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR Marcelo Tosatti
2015-05-28 8:52 ` Paolo Bonzini [this message]
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=5566D735.9050804@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lcapitulino@redhat.com \
--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.