From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se1Wz-0005Fc-2b for qemu-devel@nongnu.org; Mon, 11 Jun 2012 06:07:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Se1Ws-00044U-5d for qemu-devel@nongnu.org; Mon, 11 Jun 2012 06:07:28 -0400 Message-ID: <4FD5C352.4000004@redhat.com> Date: Mon, 11 Jun 2012 13:07:14 +0300 From: Avi Kivity MIME-Version: 1.0 References: <4FCF691A.10502@siemens.com> In-Reply-To: <4FCF691A.10502@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH uq/master] kvm: i8254: Fix conversion of in-kernel to userspace state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Marcelo Tosatti , qemu-devel , kvm , qemu-stable On 06/06/2012 05:28 PM, Jan Kiszka wrote: > Due to a offset between the clock used to generate the in-kernel > count_load_time (CLOCK_MONOTONIC) and the clock used for processing this > in userspace (vm_clock), reading back the output of PIT channel 2 via > port 0x61 was broken. One use cases that suffered from it was the CPU > frequency calibration of SeaBIOS, which also affected IDE/AHCI timeouts. > > This fixes it by calibrating the offset between both clocks on > kvm_pit_get and adjusting the kernel value before saving it in the > userspace state. As the calibration only works while the vm_clock is > running, we cache the in-kernel state across stopped phases. Applied, thanks. > + clock_offset = LLONG_MAX; INT64_MAX would me more strictly correct, but in practice it makes no difference. -- error compiling committee.c: too many arguments to function