From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amit Shah Subject: Re: x86: kvmclock: abstract save/restore sched_clock_state (v2) Date: Mon, 13 Feb 2012 21:56:50 +0530 Message-ID: <20120213162650.GB28343@amit.redhat.com> References: <20120207210542.GC20618@amt.cnet> <20120213130727.GA8052@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, johnstul@us.ibm.com, riel@redhat.com, avi@redhat.com, imammedo@redhat.com To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48071 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754883Ab2BMQ1B (ORCPT ); Mon, 13 Feb 2012 11:27:01 -0500 Content-Disposition: inline In-Reply-To: <20120213130727.GA8052@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On (Mon) 13 Feb 2012 [11:07:27], Marcelo Tosatti wrote: > > Upon resume from hibernation, CPU 0's hvclock area contains the old > values for system_time and tsc_timestamp. It is necessary for the > hypervisor to update these values with uptodate ones before the CPU uses > them. > > Abstract TSC's save/restore sched_clock_state functions and use > restore_state to write to KVM_SYSTEM_TIME MSR, forcing an update. > > Also move restore_sched_clock_state before __restore_processor_state, > since the later calls CONFIG_LOCK_STAT's lockstat_clock (also for TSC). > Thanks to Igor Mammedov for tracking it down. > > Fixes suspend-to-disk with kvmclock. > > Signed-off-by: Marcelo Tosatti This works fine, thanks. Tested-by: Amit Shah Amit