[PATCH v4 24/33] target/riscv: Fix size of irq_overflow_left

Anton Johansson via posted 33 patches 2 weeks, 4 days ago
Maintainers: Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Laurent Vivier <laurent@vivier.eu>, Christoph Muellner <christoph.muellner@vrull.eu>, Michael Tokarev <mjt@tls.msk.ru>
There is a newer version of this series
[PATCH v4 24/33] target/riscv: Fix size of irq_overflow_left
Posted by Anton Johansson via 2 weeks, 4 days ago
Fix to 64 bits to hold all relevant values.

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/riscv/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index d6ad0e1896..604a356292 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -224,7 +224,7 @@ typedef struct PMUCTRState {
     /* Snapshot value of a counter */
     uint64_t mhpmcounter_prev;
     /* Value beyond UINT32_MAX/UINT64_MAX before overflow interrupt trigger */
-    target_ulong irq_overflow_left;
+    uint64_t irq_overflow_left;
 } PMUCTRState;
 
 typedef struct PMUFixedCtrState {
-- 
2.51.0


Re: [PATCH v4 24/33] target/riscv: Fix size of irq_overflow_left
Posted by Alistair Francis 2 weeks ago
On Tue, Oct 28, 2025 at 4:24 AM Anton Johansson via
<qemu-devel@nongnu.org> wrote:
>
> Fix to 64 bits to hold all relevant values.
>
> 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>

Alistair

> ---
>  target/riscv/cpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
> index d6ad0e1896..604a356292 100644
> --- a/target/riscv/cpu.h
> +++ b/target/riscv/cpu.h
> @@ -224,7 +224,7 @@ typedef struct PMUCTRState {
>      /* Snapshot value of a counter */
>      uint64_t mhpmcounter_prev;
>      /* Value beyond UINT32_MAX/UINT64_MAX before overflow interrupt trigger */
> -    target_ulong irq_overflow_left;
> +    uint64_t irq_overflow_left;
>  } PMUCTRState;
>
>  typedef struct PMUFixedCtrState {
> --
> 2.51.0
>
>