From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: Re: [PATCH uq/master] kvm: i8254: Finish time conversion fix Date: Mon, 13 Aug 2012 22:40:31 +0400 Message-ID: <50294A1F.9070104@msgid.tls.msk.ru> References: <5024011F.2020200@msgid.tls.msk.ru> <20120810073346.GD24410@redhat.com> <5024D336.5090108@msgid.tls.msk.ru> <20120812081038.GJ3341@redhat.com> <50277631.2080808@msgid.tls.msk.ru> <5028FC02.4090205@siemens.com> <5028FE26.9090504@msgid.tls.msk.ru> <502944F9.9070200@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , Gerd Hoffmann , KVM list , Gleb Natapov , qemu-devel , qemu-stable To: Jan Kiszka Return-path: Received: from isrv.corpit.ru ([86.62.121.231]:58364 "EHLO isrv.corpit.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752816Ab2HMSke (ORCPT ); Mon, 13 Aug 2012 14:40:34 -0400 In-Reply-To: <502944F9.9070200@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On 13.08.2012 22:18, Jan Kiszka wrote: > 0cdd3d1444 fixed reading back the counter load time from the kernel > while assuming the kernel would always update its load time on writing > the state. That is only true for channel 1, and so pit_get_channel_info > returned wrong output pin states for high counter values. > > Fix this by applying the offset also on kvm_pit_put. For this purpose, > we cache the clock offset in KVMPITState, only updating it on VM state > changes or when we write the state while the VM is stopped. Wug. The fix (consisting of two halves) appears to be quite messy. Is it a (temporary) workaround or a real solution? And yes, this second half fixes the reported issue with grub timekeeping, and should fix the seabios problem as well (so it shouldn't be necessary to mess with timekeeping in seabios anymore). Thank you Jan! /mjt From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0zZJ-0003tt-GI for qemu-devel@nongnu.org; Mon, 13 Aug 2012 14:40:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0zZD-00087U-R7 for qemu-devel@nongnu.org; Mon, 13 Aug 2012 14:40:49 -0400 Message-ID: <50294A1F.9070104@msgid.tls.msk.ru> Date: Mon, 13 Aug 2012 22:40:31 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <5024011F.2020200@msgid.tls.msk.ru> <20120810073346.GD24410@redhat.com> <5024D336.5090108@msgid.tls.msk.ru> <20120812081038.GJ3341@redhat.com> <50277631.2080808@msgid.tls.msk.ru> <5028FC02.4090205@siemens.com> <5028FE26.9090504@msgid.tls.msk.ru> <502944F9.9070200@siemens.com> In-Reply-To: <502944F9.9070200@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH uq/master] kvm: i8254: Finish time conversion fix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: KVM list , Gleb Natapov , Marcelo Tosatti , qemu-devel , qemu-stable , Avi Kivity , Gerd Hoffmann On 13.08.2012 22:18, Jan Kiszka wrote: > 0cdd3d1444 fixed reading back the counter load time from the kernel > while assuming the kernel would always update its load time on writing > the state. That is only true for channel 1, and so pit_get_channel_info > returned wrong output pin states for high counter values. > > Fix this by applying the offset also on kvm_pit_put. For this purpose, > we cache the clock offset in KVMPITState, only updating it on VM state > changes or when we write the state while the VM is stopped. Wug. The fix (consisting of two halves) appears to be quite messy. Is it a (temporary) workaround or a real solution? And yes, this second half fixes the reported issue with grub timekeeping, and should fix the seabios problem as well (so it shouldn't be necessary to mess with timekeeping in seabios anymore). Thank you Jan! /mjt