]> git.hungrycats.org Git - linux/commitdiff
KVM: x86: Fix SVM VMCB reset
authorZachary Amsden <zamsden@redhat.com>
Fri, 20 Aug 2010 08:07:18 +0000 (22:07 -1000)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 6 Jan 2011 23:08:22 +0000 (18:08 -0500)
commit 58877679fd393d3ef71aa383031ac7817561463d upstream.

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>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
arch/x86/kvm/svm.c

index 49dabc138f5c8298653726b0998dbd3e00208ea9..508e1362032cc0b7a004444c97886e9f57f1f838 100644 (file)
@@ -632,7 +632,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);