Skip to contentSkip to conversation

hpet: lower HPET_MAX_TIMERS to 24

PATCH In review Paolo Bonzini 3 participants 3 messages Mar 27 – Mar 30 Rust

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 include/hw/timer/hpet.h          | 2 +-
 rust/hw/timer/hpet/src/device.rs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/hw/timer/hpet.h +1 -1
index c2656f7f0be..84be4c3529a 100644
@@ -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
 
rust/hw/timer/hpet/src/device.rs +1 -1
index 0a5c131819b..ec0bca4496d 100644
@@ -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;
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Paolo Bonzini

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.

---
 include/hw/timer/hpet.h          | 2 +-
 rust/hw/timer/hpet/src/device.rs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

thanks
-- PMM

Reviewed-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini
Quoted 9 lines · Paolo Bonzini

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.

---
  include/hw/timer/hpet.h          | 2 +-
  rust/hw/timer/hpet/src/device.rs | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)