From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH v3] KVM: x86: do not go through vcpu in __get_kvmclock_ns Date: Wed, 16 Nov 2016 19:13:38 +0100 Message-ID: <20161116181337.GB20282@potion> References: <20161116173130.24461-1-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, mtosatti@redhat.com To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <20161116173130.24461-1-pbonzini@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2016-11-16 18:31+0100, Paolo Bonzini: > Going through the first VCPU is wrong if you follow a KVM_SET_CLOCK with > a KVM_GET_CLOCK immediately after, without letting the VCPU run and > call kvm_guest_time_update. > > To fix this, compute the kvmclock value ourselves, using the master > clock (tsc, nsec) pair as the base and the host CPU frequency as > the scale. > > Reported-by: Marcelo Tosatti > Signed-off-by: Paolo Bonzini > --- Looks good, thanks! Planned for 4.9-rc6.