[PATCH] hpet: lower HPET_MAX_TIMERS to 24

Paolo Bonzini posted 1 patch 5 days, 15 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260327204704.424158-1-pbonzini@redhat.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
include/hw/timer/hpet.h          | 2 +-
rust/hw/timer/hpet/src/device.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[PATCH] hpet: lower HPET_MAX_TIMERS to 24
Posted by Paolo Bonzini 5 days, 15 hours ago
Each timer block occupies 32 bytes, but they only start at
offset 256 of the 1024-byte MMIO register space.  Therefore
the correct limit for HPET_MAX_TIMERS is 24, not 32.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/hw/timer/hpet.h          | 2 +-
 rust/hw/timer/hpet/src/device.rs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/hw/timer/hpet.h b/include/hw/timer/hpet.h
index c2656f7f0be..84be4c3529a 100644
--- a/include/hw/timer/hpet.h
+++ b/include/hw/timer/hpet.h
@@ -22,7 +22,7 @@
 
 #define FS_PER_NS 1000000       /* 1000000 femtoseconds == 1 ns */
 #define HPET_MIN_TIMERS         3
-#define HPET_MAX_TIMERS         32
+#define HPET_MAX_TIMERS         24
 
 #define HPET_NUM_IRQ_ROUTES     32
 
diff --git a/rust/hw/timer/hpet/src/device.rs b/rust/hw/timer/hpet/src/device.rs
index 0a5c131819b..ec0bca4496d 100644
--- a/rust/hw/timer/hpet/src/device.rs
+++ b/rust/hw/timer/hpet/src/device.rs
@@ -32,7 +32,7 @@
 /// Minimum recommended hardware implementation.
 const HPET_MIN_TIMERS: usize = 3;
 /// Maximum timers in each timer block.
-const HPET_MAX_TIMERS: usize = 32;
+const HPET_MAX_TIMERS: usize = 24;
 
 /// Flags that HPETState.flags supports.
 const HPET_FLAG_MSI_SUPPORT_SHIFT: usize = 0;
-- 
2.53.0
Re: [PATCH] hpet: lower HPET_MAX_TIMERS to 24
Posted by Philippe Mathieu-Daudé 2 days, 20 hours ago
On 27/3/26 21:47, Paolo Bonzini wrote:
> Each timer block occupies 32 bytes, but they only start at
> offset 256 of the 1024-byte MMIO register space.  Therefore
> the correct limit for HPET_MAX_TIMERS is 24, not 32.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   include/hw/timer/hpet.h          | 2 +-
>   rust/hw/timer/hpet/src/device.rs | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Re: [PATCH] hpet: lower HPET_MAX_TIMERS to 24
Posted by Peter Maydell 5 days, 1 hour ago
On Fri, 27 Mar 2026 at 20:47, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Each timer block occupies 32 bytes, but they only start at
> offset 256 of the 1024-byte MMIO register space.  Therefore
> the correct limit for HPET_MAX_TIMERS is 24, not 32.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  include/hw/timer/hpet.h          | 2 +-
>  rust/hw/timer/hpet/src/device.rs | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM