From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiDHq-0004Dz-1v for qemu-devel@nongnu.org; Wed, 07 May 2014 21:38:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiDHk-0007d6-QY for qemu-devel@nongnu.org; Wed, 07 May 2014 21:38:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiDHk-0007d2-II for qemu-devel@nongnu.org; Wed, 07 May 2014 21:38:08 -0400 Date: Wed, 7 May 2014 22:33:25 -0300 From: Marcelo Tosatti Message-ID: <20140508013325.GA5474@amt.cnet> References: <1399297882-3444-1-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1399297882-3444-1-git-send-email-agraf@suse.de> Subject: Re: [Qemu-devel] [PATCH] kvmclock: Ensure time in migration never goes backward List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On Mon, May 05, 2014 at 03:51:22PM +0200, Alexander Graf wrote: > When we migrate we ask the kernel about its current belief on what the guest > time would be. However, I've seen cases where the kvmclock guest structure > indicates a time more recent than the kvm returned time. > > To make sure we never go backwards, calculate what the guest would have seen > as time at the point of migration and use that value instead of the kernel > returned one when it's more recent. > > While this doesn't fix the underlying issue that the kernel's view of time > is skewed, it allows us to safely migrate guests even from sources that are > known broken. > > Signed-off-by: Alexander Graf OK Alexander better move this logic to the kernel, in KVM_GET_CLOCK. Otherwise every user of KVM_GET_CLOCK would have to apply the workaround.