From: "Yang, Sheng" <sheng.yang@intel.com>
To: kvm-devel@lists.sourceforge.net
Cc: chrisw@sous-sol.org, avi@qumranet.com, Glauber Costa <gcosta@redhat.com>
Subject: Re: [PATCH 2/2] [PATCH] disable kvm clock unless addr's LSB is set.
Date: Sat, 8 Mar 2008 11:39:17 +0800 [thread overview]
Message-ID: <200803081139.17367.sheng.yang@intel.com> (raw)
In-Reply-To: <1204814744-12595-3-git-send-email-gcosta@redhat.com>
On Thursday 06 March 2008 22:45:44 Glauber Costa wrote:
> Use LSB of the address passed through the msr to enable/disable
> the clock. Setting it to 1 enables it, setting it to 0 disables it.
>
> As the guest data structures are aligned anyway, this
> won't be a problem, as this bit is free.
>
> Guest is changed accordingly
>
> Signed-off-by: Glauber Costa <gcosta@redhat.com>
> ---
> arch/x86/kernel/kvmclock.c | 2 +-
> arch/x86/kvm/x86.c | 9 ++++++++-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> index 7c481a3..f654a12 100644
> --- a/arch/x86/kernel/kvmclock.c
> +++ b/arch/x86/kernel/kvmclock.c
> @@ -125,7 +125,7 @@ static int kvm_register_clock(void)
> {
> int cpu = smp_processor_id();
> int low, high;
> - low = (int)__pa(&per_cpu(hv_clock, cpu));
> + low = (int)__pa(&per_cpu(hv_clock, cpu)) | 1;
> high = ((u64)__pa(&per_cpu(hv_clock, cpu)) >> 32);
>
> return native_write_msr_safe(MSR_KVM_SYSTEM_TIME, low, high);
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 6abd784..64beff6 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -591,8 +591,15 @@ int kvm_set_msr_common(struct kvm_vcpu *
> if (vcpu->arch.time_page)
> kvm_release_page_dirty(vcpu->arch.time_page);
>
> + /* we verify if the enable bit is set... */
> + if (!(data & 1)) {
> + vcpu->arch.time = NULL;
This line made compiler complaining...
Thanks
Yang, Sheng
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next prev parent reply other threads:[~2008-03-08 3:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 14:45 [PATCH 0/2] provide disable clock functionality Glauber Costa
2008-03-06 14:45 ` [PATCH 1/2] [PATCH] use per cpu variables instead of a vector Glauber Costa
2008-03-06 14:45 ` [PATCH 2/2] [PATCH] disable kvm clock unless addr's LSB is set Glauber Costa
2008-03-08 3:39 ` Yang, Sheng [this message]
2008-03-07 9:05 ` [PATCH 0/2] provide disable clock functionality Avi Kivity
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=200803081139.17367.sheng.yang@intel.com \
--to=sheng.yang@intel.com \
--cc=avi@qumranet.com \
--cc=chrisw@sous-sol.org \
--cc=gcosta@redhat.com \
--cc=kvm-devel@lists.sourceforge.net \
/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.