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>
This commit is contained in:
Paolo Bonzini
2026-03-27 21:46:54 +01:00
parent 24b9ebd5f1
commit 7be175e65f
2 changed files with 2 additions and 2 deletions

View File

@@ -22,7 +22,7 @@
#define FS_PER_NS 1000000 /* 1000000 femtoseconds == 1 ns */ #define FS_PER_NS 1000000 /* 1000000 femtoseconds == 1 ns */
#define HPET_MIN_TIMERS 3 #define HPET_MIN_TIMERS 3
#define HPET_MAX_TIMERS 32 #define HPET_MAX_TIMERS 24
#define HPET_NUM_IRQ_ROUTES 32 #define HPET_NUM_IRQ_ROUTES 32

View File

@@ -32,7 +32,7 @@ const HPET_REG_SPACE_LEN: u64 = 0x400; // 1024 bytes
/// Minimum recommended hardware implementation. /// Minimum recommended hardware implementation.
const HPET_MIN_TIMERS: usize = 3; const HPET_MIN_TIMERS: usize = 3;
/// Maximum timers in each timer block. /// Maximum timers in each timer block.
const HPET_MAX_TIMERS: usize = 32; const HPET_MAX_TIMERS: usize = 24;
/// Flags that HPETState.flags supports. /// Flags that HPETState.flags supports.
const HPET_FLAG_MSI_SUPPORT_SHIFT: usize = 0; const HPET_FLAG_MSI_SUPPORT_SHIFT: usize = 0;