Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146545
b: refs/heads/master
c: 463656c
h: refs/heads/master
i:
  146543: 6efed43
v: v3
  • Loading branch information
Avi Kivity committed Jun 10, 2009
1 parent 25be7b2 commit 0a29c93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 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: 8317c298eab14cc20e2de5289743ff0d4c5a6b30
refs/heads/master: 463656c0007ddccee78db383eeb9e6eac75ccb7f
11 changes: 6 additions & 5 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,16 +631,17 @@ static void kvm_write_guest_time(struct kvm_vcpu *v)
unsigned long flags;
struct kvm_vcpu_arch *vcpu = &v->arch;
void *shared_kaddr;
unsigned long this_tsc_khz;

if ((!vcpu->time_page))
return;

preempt_disable();
if (unlikely(vcpu->hv_clock_tsc_khz != __get_cpu_var(cpu_tsc_khz))) {
kvm_set_time_scale(__get_cpu_var(cpu_tsc_khz), &vcpu->hv_clock);
vcpu->hv_clock_tsc_khz = __get_cpu_var(cpu_tsc_khz);
this_tsc_khz = get_cpu_var(cpu_tsc_khz);
if (unlikely(vcpu->hv_clock_tsc_khz != this_tsc_khz)) {
kvm_set_time_scale(this_tsc_khz, &vcpu->hv_clock);
vcpu->hv_clock_tsc_khz = this_tsc_khz;
}
preempt_enable();
put_cpu_var(cpu_tsc_khz);

/* Keep irq disabled to prevent changes to the clock */
local_irq_save(flags);
Expand Down

0 comments on commit 0a29c93

Please sign in to comment.