]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/riscv: Fix size of irq_overflow_left
authorAnton Johansson <anjo@rev.ng>
Wed, 20 May 2026 12:53:54 +0000 (14:53 +0200)
committerAlistair Francis <alistair.francis@wdc.com>
Mon, 15 Jun 2026 03:10:15 +0000 (13:10 +1000)
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 <anjo@rev.ng>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260520125406.28693-17-anjo@rev.ng>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.h

index 380749f9a89bdf2847ee53c7e3a386c9a9caf523..5d01672f12e512799f0e9d64ca08b21b6095f4bf 100644 (file)
@@ -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 {