Re: [PATCH v3] hw/intc/sifive_clint: Fix overflow in sifive_clint_write_timecmp()

2021-08-24 Thread Alistair Francis
On Thu, Aug 19, 2021 at 3:19 PM David Hoppenbrouwers wrote: > > `muldiv64` would overflow in cases where the final 96-bit value does not > fit in a `uint64_t`. This would result in small values that cause an > interrupt to be triggered much sooner than intended. > > The overflow can be detected in

[PATCH v3] hw/intc/sifive_clint: Fix overflow in sifive_clint_write_timecmp()

2021-08-18 Thread David Hoppenbrouwers
`muldiv64` would overflow in cases where the final 96-bit value does not fit in a `uint64_t`. This would result in small values that cause an interrupt to be triggered much sooner than intended. The overflow can be detected in most cases by checking if the new value is smaller than the previous va