Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934355AbcKPSNo (ORCPT ); Wed, 16 Nov 2016 13:13:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44002 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934253AbcKPSNl (ORCPT ); Wed, 16 Nov 2016 13:13:41 -0500 Date: Wed, 16 Nov 2016 19:13:38 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, mtosatti@redhat.com Subject: Re: [PATCH v3] KVM: x86: do not go through vcpu in __get_kvmclock_ns Message-ID: <20161116181337.GB20282@potion> References: <20161116173130.24461-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161116173130.24461-1-pbonzini@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 16 Nov 2016 18:13:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 524 Lines: 14 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.