From patchwork Mon Jun 14 06:40:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 55479 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6941DB7D61 for ; Mon, 14 Jun 2010 16:43:34 +1000 (EST) Received: from localhost ([127.0.0.1]:46718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OO3ON-0001bT-PL for incoming@patchwork.ozlabs.org; Mon, 14 Jun 2010 02:43:31 -0400 Received: from [140.186.70.92] (port=48007 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OO3LU-0000R7-Lx for qemu-devel@nongnu.org; Mon, 14 Jun 2010 02:40:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OO3LT-0006ET-2v for qemu-devel@nongnu.org; Mon, 14 Jun 2010 02:40:32 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:57241) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OO3LS-0006EP-SF for qemu-devel@nongnu.org; Mon, 14 Jun 2010 02:40:31 -0400 Received: from smtp02.web.de ( [172.20.0.184]) by fmmailgate03.web.de (Postfix) with ESMTP id 1FCF315615511 for ; Mon, 14 Jun 2010 08:40:30 +0200 (CEST) Received: from [92.74.52.35] (helo=[192.168.1.10]) by smtp02.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OO3LS-0005m1-00 for qemu-devel@nongnu.org; Mon, 14 Jun 2010 08:40:30 +0200 Message-ID: <4C15CEDD.8020104@web.de> Date: Mon, 14 Jun 2010 08:40:29 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: qemu-devel X-Enigmail-Version: 0.95.7 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1/s4OF+4YywhzM2afhouXaZnOSBaA1qc1aLXhi0 Gbgw3q8U8Y8DWeY60ZuoL1KE4wRv2WcY468MT7d0d6gPrVK2gA CZTME+obQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Subject: [Qemu-devel] [PATCH] hpet: Init capability register only once X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka The capability register is read-only from guest POV, so we do not need to update it on reset. Signed-off-by: Jan Kiszka --- hw/hpet.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/hpet.c b/hw/hpet.c index 93fc399..e9b585c 100644 --- a/hw/hpet.c +++ b/hw/hpet.c @@ -648,10 +648,6 @@ static void hpet_reset(DeviceState *d) s->hpet_counter = 0ULL; s->hpet_offset = 0ULL; - /* 64-bit main counter; LegacyReplacementRoute. */ - s->capability = 0x8086a001ULL; - s->capability |= (s->num_timers - 1) << HPET_ID_NUM_TIM_SHIFT; - s->capability |= ((HPET_CLK_PERIOD) << 32); s->config = 0ULL; if (count > 0) { /* we don't enable pit when hpet_reset is first called (by hpet_init) @@ -696,6 +692,11 @@ static int hpet_init(SysBusDevice *dev) timer->state = s; } + /* 64-bit main counter; LegacyReplacementRoute. */ + s->capability = 0x8086a001ULL; + s->capability |= (s->num_timers - 1) << HPET_ID_NUM_TIM_SHIFT; + s->capability |= ((HPET_CLK_PERIOD) << 32); + isa_reserve_irq(RTC_ISA_IRQ); qdev_init_gpio_in(&dev->qdev, hpet_handle_rtc_irq, 1);