hpet: fix and cleanup persistence of interrupt status
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Jul 2024 09:36:44 +0000 (11:36 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 22 Jul 2024 17:19:44 +0000 (19:19 +0200)
commitf0ccf770789e48b7a73497b465fdc892d28c1339
tree5ef460902dde6d29472a62a33583c65b2c2f9265
parent0418f90809aea5b375c859e744c8e8610e9be446
hpet: fix and cleanup persistence of interrupt status

There are several bugs in the handling of the ISR register:

- switching level->edge was not lowering the interrupt and
  clearing ISR

- switching on the enable bit was not raising a level-triggered
  interrupt if the timer had fired

- the timer must be kept running even if not enabled, in
  order to set the ISR flag, so writes to HPET_TN_CFG must
  not call hpet_del_timer()

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/timer/hpet.c