]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
KVM: x86: Fix SVM VMCB reset
authorZachary Amsden <zamsden@redhat.com>
Thu, 28 Oct 2010 18:48:14 +0000 (16:48 -0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 22 Nov 2010 18:47:34 +0000 (10:47 -0800)
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 925c326cab5b4f3ab4f5e9b617657856b804584e..b15fab64ebd779f6ba6dd6f2845eb675993f1c77 100644 (file)
@@ -621,7 +621,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);