blob: 2b8729399ffe5c48ffe82289901ac36e351f2d88 [file] [log] [blame]
From mtosatti@redhat.com Fri Oct 29 15:21:03 2010
From: Zachary Amsden <zamsden@redhat.com>
Date: Thu, 28 Oct 2010 16:48:14 -0200
Subject: KVM: x86: Fix SVM VMCB reset
To: greg@kroah.com
Cc: avi@redhat.com, mtosatti@redhat.com, stable@kernel.org, Zachary Amsden <zamsden@redhat.com>
Message-ID: <20101028185027.916574115@amt.cnet>
Content-Disposition: inline; filename=0006-KVM-x86-Fix-SVM-VMCB-reset.patch
From: Zachary Amsden <zamsden@redhat.com>
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -621,7 +621,7 @@ static void init_vmcb(struct vcpu_svm *s
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);