From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT9FI-00049f-RD for qemu-devel@nongnu.org; Thu, 27 Mar 2014 08:17:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WT9FE-0008Ad-CD for qemu-devel@nongnu.org; Thu, 27 Mar 2014 08:17:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT9FE-0008AV-34 for qemu-devel@nongnu.org; Thu, 27 Mar 2014 08:17:16 -0400 Message-ID: <533416BF.9050004@redhat.com> Date: Thu, 27 Mar 2014 13:17:03 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <53082983.4090000@ddn.com> <53086768.7070200@redhat.com> <533336A1.5060803@ddn.com> In-Reply-To: <533336A1.5060803@ddn.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Don't enable a HPET timer if HPET is disabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Matt Lupfer , QEMU Developers Cc: Alex Bligh , "Michael S. Tsirkin" Il 26/03/2014 21:20, Matt Lupfer ha scritto: > On 02/22/2014 02:01 AM, Paolo Bonzini wrote: >> Il 22/02/2014 05:37, Matt Lupfer ha scritto: >>> A HPET timer can be started when HPET is not yet >>> enabled. This will not generate an interrupt >>> to the guest, but causes problems when HPET is later >>> enabled. >>> >>> A timer that is created and expires at least once before >>> HPET is enabled will have an initialized comparator based >>> on a hpet_offset of 0 (uninitialized). When HPET is >>> enabled, hpet_set_timer() is called a second time, which >>> modifies the timer expiry to a time based on the >>> difference between current ticks (measured with the >>> newly initialized hpet_offset) and the timer's >>> comparator (which was generated before hpet_offset was >>> initialized). This results in a long period of no HPET >>> timer ticks. >>> >>> When this occurs with a CentOS 5.x guest, the guest >>> may not receive timer interrupts during its narrow >>> timer check window and panic on boot. >>> >>> Signed-off-by: Matt Lupfer >>> --- >>> hw/timer/hpet.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c >>> index 1264dfd..e15d6bc 100644 >>> --- a/hw/timer/hpet.c >>> +++ b/hw/timer/hpet.c >>> @@ -506,7 +506,8 @@ static void hpet_ram_write(void *opaque, hwaddr addr, >>> timer->cmp = (uint32_t)timer->cmp; >>> timer->period = (uint32_t)timer->period; >>> } >>> - if (activating_bit(old_val, new_val, HPET_TN_ENABLE)) { >>> + if (activating_bit(old_val, new_val, HPET_TN_ENABLE) && >>> + hpet_enabled(s)) { >>> hpet_set_timer(timer); >>> } else if (deactivating_bit(old_val, new_val, HPET_TN_ENABLE)) { >>> hpet_del_timer(timer); >>> >> >> Reviewed-by: Paolo Bonzini > > Ping? Now that 1.7.1 is out, I hope this small patch will be considered > for the 2.0 release. > > http://patchwork.ozlabs.org/patch/323121/ Oops. Michael, can you take care of this one? Paolo