]> git.hungrycats.org Git - linux/commitdiff
KVM: x86: Fix SVM VMCB reset
authorMarcelo Tosatti <mtosatti@redhat.com>
Thu, 14 Oct 2010 16:49:56 +0000 (13:49 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 29 Oct 2010 04:51:37 +0000 (21:51 -0700)
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: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/svm.c

index ce438e0fdd268f394995d604070b8b2aad783e4d..5fb0ebd213bf43ce01a2f6db4f9ccdc33254bac7 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);