From: Anton Johansson Date: Wed, 20 May 2026 12:53:54 +0000 (+0200) Subject: target/riscv: Fix size of irq_overflow_left X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad8df5d448f55e40334f032f6bbb607ca7994dd2;p=thirdparty%2Fqemu.git target/riscv: Fix size of irq_overflow_left Fix to 64 bits to hold all relevant values. Also update comment to reflect that irq_overflow_left stores the ns beyond INT64_MAX until the next overflow, this to account for the uint64_t/int64_t timer value difference between RISCV/QEMU. Signed-off-by: Anton Johansson Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Acked-by: Alistair Francis Message-ID: <20260520125406.28693-17-anjo@rev.ng> Signed-off-by: Alistair Francis --- diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 380749f9a8..5d01672f12 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -224,8 +224,8 @@ typedef struct PMUCTRState { uint64_t mhpmcounter_val; /* Snapshot value of a counter */ uint64_t mhpmcounter_prev; - /* Value beyond UINT32_MAX/UINT64_MAX before overflow interrupt trigger */ - target_ulong irq_overflow_left; + /* Value beyond INT64_MAX before overflow interrupt trigger */ + uint64_t irq_overflow_left; } PMUCTRState; typedef struct PMUFixedCtrState {