Re: [PATCH] target/arm: Add overflow check for gt_recalc_timer

2023-04-13 Thread Peter Maydell
On Thu, 6 Apr 2023 at 16:16, Leonid Komarianskyi wrote: > > If gt_timer is enabled before cval initialization on a virtualized > setup on QEMU, cval equals (UINT64_MAX - 1). Adding an offset value > to this causes an overflow that sets timer into the past, which leads > to infinite loop, because t

[PATCH] target/arm: Add overflow check for gt_recalc_timer

2023-04-06 Thread Leonid Komarianskyi
If gt_timer is enabled before cval initialization on a virtualized setup on QEMU, cval equals (UINT64_MAX - 1). Adding an offset value to this causes an overflow that sets timer into the past, which leads to infinite loop, because this timer fires immediately and calls gt_recalc_timer() once more,