aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/apic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/apic.c b/hw/apic.c
index 6fd01602fe..cfaa1db778 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -566,6 +566,8 @@ static void apic_timer_update(APICState *s, int64_t current_time)
d = (current_time - s->initial_count_load_time) >>
s->count_shift;
if (s->lvt[APIC_LVT_TIMER] & APIC_LVT_TIMER_PERIODIC) {
+ if (!s->initial_count)
+ goto no_timer;
d = ((d / ((uint64_t)s->initial_count + 1)) + 1) * ((uint64_t)s->initial_count + 1);
} else {
if (d >= s->initial_count)