summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-18 14:19:42 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-18 14:19:42 +0000
commit681f8c29aaa375b2b46ff81844b9bfa594538f43 (patch)
tree9a937489703d83d9a4ba523e71523dbad0e12b87
parentc8f79b67cf6f03cea76185f11094dbceff67a0ef (diff)
downloadhqemu-681f8c29aaa375b2b46ff81844b9bfa594538f43.zip
hqemu-681f8c29aaa375b2b46ff81844b9bfa594538f43.tar.gz
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
-rw-r--r--hw/apic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/apic.c b/hw/apic.c
index 6fd0160..cfaa1db 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)
OpenPOWER on IntegriCloud