On 09/30/2010 01:07 PM, Michael Tokarev wrote: > 01.10.2010 03:02, Michael Tokarev wrote: > >> 30.09.2010 23:05, Marcelo Tosatti wrote: >> [] >> >>> Arjan, Michael, can you try the following: >>> >>> From 3823c018162dc708b543cbdc680a4c7d63533fee Mon Sep 17 00:00:00 2001 >>> From: Zachary Amsden >>> Date: Sat, 29 May 2010 17:52:46 -1000 >>> Subject: [KVM V2 04/25] Fix SVM VMCB reset >>> Cc: Avi Kivity, >>> Marcelo Tosatti, >>> Glauber Costa, >>> linux-kernel@vger.kernel.org >>> >>> 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 >>> --- >>> arch/x86/kvm/svm.c | 2 +- >>> 1 files changed, 1 insertions(+), 1 deletions(-) >>> >>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c >>> index 760c86e..46856d2 100644 >>> --- a/arch/x86/kvm/svm.c >>> +++ b/arch/x86/kvm/svm.c >>> @@ -781,7 +781,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; >>> + guest_write_tsc(&svm->vcpu, 0); >>> control->int_ctl = V_INTR_MASKING_MASK; >>> >> This fails to compile on 2.6.35.5: >> >> arch/x86/kvm/svm.c: In function ‘init_vmcb’: >> arch/x86/kvm/svm.c:769: error: implicit declaration of function ‘guest_write_tsc’ >> >> I'll take a look tomorrow where that comes from.. hopefully ;) >> > Ok, that routine is static, defined in arch/x86/kvm/vmx.c > (not svm.c). I'm not sure it's ok to use it in svm.c > directly, as it appears to be vmx-specific. > > Thanks! > > /mjt > Can you try this patch to see if it helps? I believe it is also safe for Xen, but cc'ing to double check.