qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 0/7] hpet: fixes for 64-bit mode and interrupt status registers
Date: Mon, 22 Jul 2024 14:05:34 +0200	[thread overview]
Message-ID: <20240722120541.70790-1-pbonzini@redhat.com> (raw)

The main fixes are in patches 1 and 5:

- 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()

- 64-bit reads and writes must be implemented so that
  TN_SET_VAL is applied to both halves if the 64-bit counter
  is written with a single 8-byte write

Patch 6 improves the tracking of the HPET state, by storing
the full 64-bit target value of the counter (which is used
to set the corresponding QEMUTimer).  Patch 7 is a longstanding
TODO that is enabled by all these changes, limiting the maximum
timer frequency of a periodic timer.

Paolo


Paolo Bonzini (7):
  hpet: fix and cleanup persistence of interrupt status
  hpet: ignore high bits of comparator in 32-bit mode
  hpet: remove unnecessary variable "index"
  hpet: place read-only bits directly in "new_val"
  hpet: accept 64-bit reads and writes
  hpet: store full 64-bit target value of the counter
  hpet: avoid timer storms on periodic timers

 hw/timer/hpet.c       | 329 +++++++++++++++++++-----------------------
 hw/timer/trace-events |   4 +-
 2 files changed, 151 insertions(+), 182 deletions(-)

-- 
2.45.2



             reply	other threads:[~2024-07-22 12:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22 12:05 Paolo Bonzini [this message]
2024-07-22 12:05 ` [PATCH 1/7] hpet: fix and cleanup persistence of interrupt status Paolo Bonzini
2024-07-22 12:05 ` [PATCH 2/7] hpet: ignore high bits of comparator in 32-bit mode Paolo Bonzini
2024-07-22 12:05 ` [PATCH 3/7] hpet: remove unnecessary variable "index" Paolo Bonzini
2024-07-22 12:05 ` [PATCH 4/7] hpet: place read-only bits directly in "new_val" Paolo Bonzini
2024-07-22 12:05 ` [PATCH 5/7] hpet: accept 64-bit reads and writes Paolo Bonzini
2024-07-22 12:05 ` [PATCH 6/7] hpet: store full 64-bit target value of the counter Paolo Bonzini
2024-07-22 12:05 ` [PATCH 7/7] hpet: avoid timer storms on periodic timers Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240722120541.70790-1-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).