Commit 681f8c29aaa375b2b46ff81844b9bfa594538f43
1 parent
c8f79b67
APIC: Do not start zero-period timers (Jan Kiszka)
The APIC timer must not start when the initial count is (still) zero. This caused occasional stalls when booting secondary CPUs of Linux SMP guests. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5024 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
2 additions
and
0 deletions
hw/apic.c
... | ... | @@ -566,6 +566,8 @@ static void apic_timer_update(APICState *s, int64_t current_time) |
566 | 566 | d = (current_time - s->initial_count_load_time) >> |
567 | 567 | s->count_shift; |
568 | 568 | if (s->lvt[APIC_LVT_TIMER] & APIC_LVT_TIMER_PERIODIC) { |
569 | + if (!s->initial_count) | |
570 | + goto no_timer; | |
569 | 571 | d = ((d / ((uint64_t)s->initial_count + 1)) + 1) * ((uint64_t)s->initial_count + 1); |
570 | 572 | } else { |
571 | 573 | if (d >= s->initial_count) | ... | ... |