KVM: x86: Fix SVM VMCB reset
authorZachary Amsden <zamsden@redhat.com>
Fri, 20 Aug 2010 08:07:18 +0000 (22:07 -1000)
committerAvi Kivity <avi@redhat.com>
Mon, 11 Oct 2010 10:36:07 +0000 (12:36 +0200)
On reset, VMCB TSC should be set to zero.  Instead, code was setting
tsc_offset to zero, which passes through the underlying TSC.

Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/svm.c

index bc5b9b8..12b502d 100644 (file)
@@ -766,7 +766,7 @@ static void init_vmcb(struct vcpu_svm *svm)
 
        control->iopm_base_pa = iopm_base;
        control->msrpm_base_pa = __pa(svm->msrpm);
-       control->tsc_offset = 0;
+       control->tsc_offset = 0-native_read_tsc();
        control->int_ctl = V_INTR_MASKING_MASK;
 
        init_seg(&save->es);