kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zachary Amsden <zamsden@redhat.com>
To: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Zachary Amsden <zamsden@redhat.com>,
	Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: [PATCH: kvm 5/6] Don't unconditionally clear cpu_khz_tsc in hardware_enable.
Date: Wed, 23 Sep 2009 17:29:04 -1000	[thread overview]
Message-ID: <1253762945-5750-5-git-send-email-zamsden@redhat.com> (raw)
In-Reply-To: <1253762945-5750-4-git-send-email-zamsden@redhat.com>

For the non-hotplug case, this TSC speed should be available; instead, clear
cpu_khz_tsc when bringing down a CPU so it is recomputed at the next bringup.

Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
 arch/x86/kvm/x86.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 38ba4a6..f1470ce 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4721,18 +4721,16 @@ int kvm_arch_cpu_hotadd(int cpu)
 
 void kvm_arch_cpu_hotremove(int cpu)
 {
+	/*
+	 * Reset TSC khz to zero so it is recomputed on bringup
+	 */
+	if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
+		per_cpu(cpu_tsc_khz, cpu) = 0;
 	kvm_x86_ops->cpu_hotremove(cpu);
 }
 
 int kvm_arch_hardware_enable(void *garbage)
 {
-	/*
-	 * Notifier callback chain may not have called cpufreq code
-	 * yet, thus we must reset TSC khz to zero and recompute it
-	 * before entering.
-	 */
-	if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
-		per_cpu(cpu_tsc_khz, raw_smp_processor_id()) = 0;
 	return kvm_x86_ops->hardware_enable(garbage);
 }
 
-- 
1.6.4.4

  reply	other threads:[~2009-09-24  3:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24  3:29 [PATCH: kvm 1/6] Code motion. Separate timer intialization into an indepedent function Zachary Amsden
2009-09-24  3:29 ` [PATCH: kvm 2/6] Kill the confusing tsc_ref_khz and ref_freq variables Zachary Amsden
2009-09-24  3:29   ` [PATCH: kvm 3/6] Fix hotadd of CPUs for KVM Zachary Amsden
2009-09-24  3:29     ` [PATCH: kvm 4/6] Fix hotremove " Zachary Amsden
2009-09-24  3:29       ` Zachary Amsden [this message]
2009-09-24  3:29         ` [PATCH: kvm 6/6] Math is hard; let's do some cooking Zachary Amsden
2009-09-24 15:52     ` [PATCH: kvm 3/6] Fix hotadd of CPUs for KVM Marcelo Tosatti
2009-09-24 20:32       ` Zachary Amsden
2009-09-27  8:44         ` Avi Kivity
2009-09-24 15:10   ` [PATCH: kvm 2/6] Kill the confusing tsc_ref_khz and ref_freq variables Marcelo Tosatti
2009-09-25  0:47     ` Hotplug patches for KVM Zachary Amsden
2009-09-25  0:47       ` [PATCH: kvm 1/5] Code motion. Separate timer intialization into an indepedent function Zachary Amsden
2009-09-25  0:47         ` [PATCH: kvm 2/5] Kill the confusing tsc_ref_khz and ref_freq variables Zachary Amsden
2009-09-25  0:47           ` [PATCH: kvm 3/5] Fix hotadd of CPUs for KVM Zachary Amsden
2009-09-25  0:47             ` [PATCH: kvm 4/5] Fix hotremove " Zachary Amsden
2009-09-25  0:47               ` [PATCH: kvm 5/5] Math is hard; let's do some cooking Zachary Amsden
2009-09-27  8:54               ` [PATCH: kvm 4/5] Fix hotremove of CPUs for KVM Avi Kivity
2009-09-28  1:42                 ` Zachary Amsden
2009-09-27  8:52             ` [PATCH: kvm 3/5] Fix hotadd " Avi Kivity
2009-09-28  1:39               ` Zachary Amsden

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=1253762945-5750-5-git-send-email-zamsden@redhat.com \
    --to=zamsden@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).