All of lore.kernel.org
 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/5] Math is hard; let's do some cooking.
Date: Thu, 24 Sep 2009 14:47:20 -1000	[thread overview]
Message-ID: <1253839640-12695-6-git-send-email-zamsden@redhat.com> (raw)
In-Reply-To: <1253839640-12695-5-git-send-email-zamsden@redhat.com>

CPU frequency change callback provides new TSC frequency for us, and in the
same units (kHz), so there is no reason to do any math.

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

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 66c6bb9..60ae2c7 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3070,15 +3070,12 @@ static int kvmclock_cpufreq_notifier(struct notifier_block *nb, unsigned long va
 	struct kvm *kvm;
 	struct kvm_vcpu *vcpu;
 	int i, send_ipi = 0;
-	unsigned long old_khz;
 
 	if (val == CPUFREQ_PRECHANGE && freq->old > freq->new)
 		return 0;
 	if (val == CPUFREQ_POSTCHANGE && freq->old < freq->new)
 		return 0;
-	old_khz = per_cpu(cpu_tsc_khz, freq->cpu);
-	per_cpu(cpu_tsc_khz, freq->cpu) = cpufreq_scale(old_khz, freq->old,
-							freq->new);
+	per_cpu(cpu_tsc_khz, freq->cpu) = freq->new;
 
 	spin_lock(&kvm_lock);
 	list_for_each_entry(kvm, &vm_list, vm_list) {
-- 
1.6.4.4


  reply	other threads:[~2009-09-25  0:49 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       ` [PATCH: kvm 5/6] Don't unconditionally clear cpu_khz_tsc in hardware_enable Zachary Amsden
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               ` Zachary Amsden [this message]
2009-09-27  8:54               ` 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=1253839640-12695-6-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 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.