All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hpet: Init capability register only once
@ 2010-06-14  6:40 Jan Kiszka
  2010-06-14 16:27 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2010-06-14  6:40 UTC (permalink / raw)
  To: qemu-devel

From: Jan Kiszka <jan.kiszka@siemens.com>

The capability register is read-only from guest POV, so we do not need
to update it on reset.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 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);
 
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] hpet: Init capability register only once
  2010-06-14  6:40 [Qemu-devel] [PATCH] hpet: Init capability register only once Jan Kiszka
@ 2010-06-14 16:27 ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2010-06-14 16:27 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel

On 06/14/2010 01:40 AM, Jan Kiszka wrote:
> From: Jan Kiszka<jan.kiszka@siemens.com>
>
> The capability register is read-only from guest POV, so we do not need
> to update it on reset.
>
> Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>   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);
>
>    

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-14 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-14  6:40 [Qemu-devel] [PATCH] hpet: Init capability register only once Jan Kiszka
2010-06-14 16:27 ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.