aboutsummaryrefslogtreecommitdiff
path: root/page-vary.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-08-22 14:23:54 +0100
committerRichard Henderson <richard.henderson@linaro.org>2022-09-14 11:19:40 +0100
commitf1dd2506ee75b21a604e5a8b6e1c0fd00a435f7e (patch)
tree9713bafe446cc8aeabd446ae4a3fad6731b2ae72 /page-vary.c
parent872d20343de4f1af45a31270f47cc54cc474bf55 (diff)
target/arm: Detect overflow when calculating next PMU interrupt
In pmccntr_op_finish() and pmevcntr_op_finish() we calculate the next point at which we will get an overflow and need to fire the PMU interrupt or set the overflow flag. We do this by calculating the number of nanoseconds to the overflow event and then adding it to qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL). However, we don't check whether that signed addition overflows, which can happen if the next PMU interrupt would happen massively far in the future (250 years or more). Since QEMU assumes that "when the QEMU_CLOCK_VIRTUAL rolls over" is "never", the sensible behaviour in this situation is simply to not try to set the timer if it would be beyond that point. Detect the overflow, and skip setting the timer in that case. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220822132358.3524971-7-peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'page-vary.c')
0 files changed, 0 insertions, 0 deletions