From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] fix kvmclock bug Date: Tue, 28 Sep 2010 10:58:28 +0200 Message-ID: <4CA1AE34.8080903@siemens.com> References: <4C95560D.3050108@redhat.com> <4C9C5309.5080403@web.de> <4C9F1849.1050801@web.de> <4CA0E9E0.7020209@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Avi Kivity , kvm , Glauber Costa To: Zachary Amsden Return-path: Received: from goliath.siemens.de ([192.35.17.28]:16892 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586Ab0I1I6r (ORCPT ); Tue, 28 Sep 2010 04:58:47 -0400 In-Reply-To: <4CA0E9E0.7020209@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 27.09.2010 21:00, Zachary Amsden wrote: > On 09/25/2010 11:54 PM, Jan Kiszka wrote: >> That only leaves us with the likely wrong unstable declaration of the >> TSC after resume. And that raises the question for me if KVM is actually >> that much smarter than the Linux kernel in detecting TSC jumps. If >> something is missing, can't we improve the kernel's detection mechanism >> which already has suspend/resume support? >> > > Linux must make the the conservative choice about TSC being declared > unstable; if it is possible that it has become unstable, it is > unstable. Unfortunately, this bodes not well for us, as most of the > finer points of accuracy depend on having a stable TSC. > > There's a bunch of places that declare TSC unstable, and where in the > suspend / resume cycle that happens would depend on your actual hardware. It's absolutely clear where this happens: kvm_arch_vcpu_load. And it seems to happen as the TSC is reset due to suspend-to-RAM. Again: Linux recovers from this and continues to use the TSC. KVM is more picky, so my question is if this is really required. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux