Skip to content

Commit 64acc23

Browse files
committed
rust: hpet: fix decoding of timer registers
Due to a missing "& 0x18", timer registers are not decoded correctly. This breaks the tests/functional/test_x86_64_tuxrun.py functional test. Fixes: 519088b ("rust: hpet: decode HPET registers into enums", 2025-03-06) Reported-by: Peter Maydell <[email protected]> Tested-by: Peter Maydell <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent f7b87e4 commit 64acc23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/hw/timer/hpet/src/hpet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ impl HPETState {
776776
let timer_id: usize = ((addr - 0x100) / 0x20) as usize;
777777
if timer_id <= self.num_timers.get() {
778778
// TODO: Add trace point - trace_hpet_ram_[read|write]_timer_id(timer_id)
779-
TimerRegister::try_from(addr)
779+
TimerRegister::try_from(addr & 0x18)
780780
.map(|reg| HPETRegister::Timer(&self.timers[timer_id], reg))
781781
} else {
782782
// TODO: Add trace point - trace_hpet_timer_id_out_of_range(timer_id)

0 commit comments

Comments
 (0)