From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luiz Capitulino Subject: Re: [PATCH v2] KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR Date: Tue, 26 May 2015 09:22:40 -0400 Message-ID: <20150526092240.4a74fa67@redhat.com> References: <20150523200629.GA18207@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Owen Hofmann , Paolo Bonzini , KVM General , LKML , Sasha Levin To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54641 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753850AbbEZNWo (ORCPT ); Tue, 26 May 2015 09:22:44 -0400 In-Reply-To: <20150523200629.GA18207@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, 23 May 2015 17:06:29 -0300 Marcelo Tosatti wrote: > Initialize kvmclock base, on kvmclock system MSR write time, > so that the guest sees kvmclock counting from zero. > > This matches baremetal behaviour when kvmclock in guest > sets sched clock stable. > > Signed-off-by: Marcelo Tosatti Tested-by: Luiz Capitulino > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index cc2c759..ea40d24 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -2188,6 +2188,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) > &vcpu->requests); > > ka->boot_vcpu_runs_old_kvmclock = tmp; > + > + ka->kvmclock_offset = -get_kernel_ns(); > } > > vcpu->arch.time = data; > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >