From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42225 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZnUx-00068i-Nf for qemu-devel@nongnu.org; Mon, 03 Jan 2011 11:43:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZnTx-0000za-7U for qemu-devel@nongnu.org; Mon, 03 Jan 2011 11:42:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZnTw-0000zK-Pm for qemu-devel@nongnu.org; Mon, 03 Jan 2011 11:42:05 -0500 Message-ID: <4D21FC57.7050401@redhat.com> Date: Mon, 03 Jan 2011 18:41:59 +0200 From: Avi Kivity MIME-Version: 1.0 References: <4D21F3A5.1030905@redhat.com> <4D21F9A3.6030404@web.de> In-Reply-To: <4D21F9A3.6030404@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Jan Kiszka , Glauber Costa , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org On 01/03/2011 06:30 PM, Jan Kiszka wrote: > Am 03.01.2011 17:04, Avi Kivity wrote: > > On 01/03/2011 10:33 AM, Jan Kiszka wrote: > >> From: Jan Kiszka > >> > >> If kvmclock is used, which implies the kernel supports it, register a > >> kvmclock device with the sysbus. Its main purpose is to save and restore > >> the kernel state on migration, but this will also allow to visualize it > >> one day. > >> > > > > kvmclock is a per-cpu affair. > > Nope, it's state (the one save/restored here) is per VM. > > > > >> > >> @@ -534,6 +599,10 @@ int kvm_arch_init(int smp_cpus) > >> int ret; > >> struct utsname utsname; > >> > >> +#ifdef KVM_CAP_ADJUST_CLOCK > >> + sysbus_register_withprop(&kvmclock_info); > >> +#endif > >> + > > > > So this doesn't look right. I think we're fine with just migrating the > > MSRs, like we migrate anything else that has to do with the cpu. > > > > The kvmclock state is not contained in any MSR. It's an independent > machine state that can be indirectly obtained via MSR access. Therefore, > qemu-kvm currently registers only one vmstate entry per machine, and > this patch just turns this into a clean device - because that's what > kvmclock is in the end, something like an HPET. Okay, thanks for the correction. -- error compiling committee.c: too many arguments to function