@samitouri / QOSamiQemu / commits / 7be175e65f

hpet: lower HPET_MAX_TIMERS to 24

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>

Paolo Bonzini committed Mar 27, 2026 at 21:46 UTC 7be175e65f07bdf93f5f576d1dbb5f993c97cd5c
2 files changed +2 -2
include/hw/timer/hpet.h
+1 -1
@@ -22,7 +22,7 @@
22
23 #define FS_PER_NS 1000000 /* 1000000 femtoseconds == 1 ns */
24 #define HPET_MIN_TIMERS 3
25 -#define HPET_MAX_TIMERS 32
25 +#define HPET_MAX_TIMERS 24
26
27 #define HPET_NUM_IRQ_ROUTES 32
28
rust/hw/timer/hpet/src/device.rs
+1 -1
@@ -32,7 +32,7 @@ const HPET_REG_SPACE_LEN: u64 = 0x400; // 1024 bytes
32 /// Minimum recommended hardware implementation.
33 const HPET_MIN_TIMERS: usize = 3;
34 /// Maximum timers in each timer block.
35 -const HPET_MAX_TIMERS: usize = 32;
35 +const HPET_MAX_TIMERS: usize = 24;
36
37 /// Flags that HPETState.flags supports.
38 const HPET_FLAG_MSI_SUPPORT_SHIFT: usize = 0;