Message ID | 20150523200629.GA18207@amt.cnet (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Sat, 23 May 2015 17:06:29 -0300 Marcelo Tosatti <mtosatti@redhat.com> 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 <mtosatti@redhat.com> Tested-by: Luiz Capitulino <lcapitulino@redhat.com> > > 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/ > -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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;
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 <mtosatti@redhat.com> -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html