diff options
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 3944e917e794..43e049a2ccf4 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -634,10 +634,12 @@ static void kvm_write_guest_time(struct kvm_vcpu *v) | |||
634 | if ((!vcpu->time_page)) | 634 | if ((!vcpu->time_page)) |
635 | return; | 635 | return; |
636 | 636 | ||
637 | preempt_disable(); | ||
637 | if (unlikely(vcpu->hv_clock_tsc_khz != __get_cpu_var(cpu_tsc_khz))) { | 638 | if (unlikely(vcpu->hv_clock_tsc_khz != __get_cpu_var(cpu_tsc_khz))) { |
638 | kvm_set_time_scale(__get_cpu_var(cpu_tsc_khz), &vcpu->hv_clock); | 639 | kvm_set_time_scale(__get_cpu_var(cpu_tsc_khz), &vcpu->hv_clock); |
639 | vcpu->hv_clock_tsc_khz = __get_cpu_var(cpu_tsc_khz); | 640 | vcpu->hv_clock_tsc_khz = __get_cpu_var(cpu_tsc_khz); |
640 | } | 641 | } |
642 | preempt_enable(); | ||
641 | 643 | ||
642 | /* Keep irq disabled to prevent changes to the clock */ | 644 | /* Keep irq disabled to prevent changes to the clock */ |
643 | local_irq_save(flags); | 645 | local_irq_save(flags); |