Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172307
b: refs/heads/master
c: 6b7d7e7
h: refs/heads/master
i:
  172305: da07140
  172303: 2cec686
v: v3
  • Loading branch information
Zachary Amsden authored and Avi Kivity committed Dec 3, 2009
1 parent ca89334 commit b535cdb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 565d0998ecac8373b9a9ecd5991abe74318cd235
refs/heads/master: 6b7d7e762b238f908fe4c3345c2c6eb5c3fdbd59
16 changes: 12 additions & 4 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,12 @@ long kvm_arch_dev_ioctl(struct file *filp,
void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
{
kvm_x86_ops->vcpu_load(vcpu, cpu);
if (unlikely(per_cpu(cpu_tsc_khz, cpu) == 0))
per_cpu(cpu_tsc_khz, cpu) = cpufreq_quick_get(cpu);
if (unlikely(per_cpu(cpu_tsc_khz, cpu) == 0)) {
unsigned long khz = cpufreq_quick_get(cpu);
if (!khz)
khz = tsc_khz;
per_cpu(cpu_tsc_khz, cpu) = khz;
}
kvm_request_guest_time_update(vcpu);
}

Expand Down Expand Up @@ -3144,8 +3148,12 @@ static void kvm_timer_init(void)
if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
CPUFREQ_TRANSITION_NOTIFIER);
for_each_online_cpu(cpu)
per_cpu(cpu_tsc_khz, cpu) = cpufreq_get(cpu);
for_each_online_cpu(cpu) {
unsigned long khz = cpufreq_get(cpu);
if (!khz)
khz = tsc_khz;
per_cpu(cpu_tsc_khz, cpu) = khz;
}
} else {
for_each_possible_cpu(cpu)
per_cpu(cpu_tsc_khz, cpu) = tsc_khz;
Expand Down

0 comments on commit b535cdb

Please sign in to comment.