From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2gUu-0007oy-Om for qemu-devel@nongnu.org; Fri, 04 Nov 2016 11:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2gUt-0006YR-NF for qemu-devel@nongnu.org; Fri, 04 Nov 2016 11:33:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57944) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2gUt-0006Xn-HC for qemu-devel@nongnu.org; Fri, 04 Nov 2016 11:33:39 -0400 References: <20161104094322.GA16930@amt.cnet> <20161104152522.GC5388@potion> From: Paolo Bonzini Message-ID: <1c69a083-eef0-8fa0-0e74-5a4e25a066a0@redhat.com> Date: Fri, 4 Nov 2016 16:33:33 +0100 MIME-Version: 1.0 In-Reply-To: <20161104152522.GC5388@potion> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [QEMU PATCH] kvmclock: advance clock by time window between vm_stop and pre_save List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Marcelo Tosatti Cc: kvm@vger.kernel.org, qemu-devel , "Dr. David Alan Gilbert" , Juan Quintela , Eduardo Habkost , Roman Kagan On 04/11/2016 16:25, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >> > =20 >> > + if (s->advance_clock && s->clock + s->advance_clock > s->cl= ock) { >> > + s->clock +=3D s->advance_clock; >> > + s->advance_clock =3D 0; >> > + } > Can't the advance_clock added to the migrated KVMClockState instead of > passing it as another parameter? >=20 > (It is sad that we can't just query KVMClockState in kvmclock_pre_save > because of the Linux bug.) What Linux bug? The one that makes us use kvmclock_current_nsec? It should work with 4.9-rc (well, once Linus applies my pull request). 4.9-rc will not return ktime_get_ns for KVM_GET_CLOCK; it will return the raw value from the kernel timekeeper. I'm thinking that we should add a KVM capability for this, and skip kvmclock_current_nsec if the capability is present. The first part is trivial, so we can do it even during Linux rc period. Paolo