[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 1/2] target/arm: detect 64 bit overflow caused by high cval +
From: |
Alex Bennée |
Subject: |
[PATCH v1 1/2] target/arm: detect 64 bit overflow caused by high cval + voff |
Date: |
Fri, 10 Jan 2020 16:16:25 +0000 |
If we don't detect this we will be stuck in a busy loop as we schedule
a timer for before now which will continually trigger gt_recalc_timer
even though we haven't reached the state required to trigger the IRQ.
Bug: https://bugs.launchpad.net/bugs/1859021
Cc: address@hidden
Signed-off-by: Alex Bennée <address@hidden>
---
target/arm/helper.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 19a57a17da5..eb17106f7bd 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -2481,6 +2481,9 @@ static void gt_recalc_timer(ARMCPU *cpu, int timeridx)
} else {
/* Next transition is when we hit cval */
nexttick = gt->cval + offset;
+ if (nexttick < gt->cval) {
+ nexttick = UINT64_MAX;
+ }
}
/* Note that the desired next expiry time might be beyond the
* signed-64-bit range of a QEMUTimer -- in this case we just
--
2.20.1