[PATCH] lapic3: fix kernel APIC timer saving

He, Qing
2007-08-09T07:52:53Z

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

kvm: qemu: fix in-kernel APIC timer saving

This patch fixes a bug that APIC timer is disabled when migrating from
in-kernel APIC to userspace APIC, causing guest lockups.

Singed-off-by: Qing He <qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Yaozu (Eddie) Dong <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

---

diff --git a/qemu/hw/apic.c b/qemu/hw/apic.c
index fb6b1e6..1650962 100644
--- a/qemu/hw/apic.c
+++ b/qemu/hw/apic.c
@@ -784,13 +784,12 @@ static void
kvm_kernel_lapic_save_to_user(APICState *s)
s->lvt[i] = kapic_reg(kapic, 0x32 + i);
s->initial_count = kapic_reg(kapic, 0x38);
s->divide_conf = kapic_reg(kapic, 0x3e);
- s->initial_count_load_time = qemu_get_clock(vm_clock);
- s->next_time = s->initial_count_load_time;

v = (s->divide_conf & 3) | ((s->divide_conf >> 1) & 4);
s->count_shift = (v + 1) & 7;

- qemu_del_timer(s->timer);
+ s->initial_count_load_time = qemu_get_clock(vm_clock);
+ apic_timer_update(s, s->initial_count_load_time);
}

static void kvm_kernel_lapic_load_from_user(APICState *s)

[-- Attachment #2: kapic-timer-save.diff --]
[-- Type: application/octet-stream, Size: 749 bytes --]

diff --git a/qemu/hw/apic.c b/qemu/hw/apic.c
index fb6b1e6..1650962 100644
--- a/qemu/hw/apic.c
+++ b/qemu/hw/apic.c
@@ -784,13 +784,12 @@ static void kvm_kernel_lapic_save_to_user(APICState *s)
s->lvt[i] = kapic_reg(kapic, 0x32 + i);
s->initial_count = kapic_reg(kapic, 0x38);
s->divide_conf = kapic_reg(kapic, 0x3e);
- s->initial_count_load_time = qemu_get_clock(vm_clock);
- s->next_time = s->initial_count_load_time;

v = (s->divide_conf & 3) | ((s->divide_conf >> 1) & 4);
s->count_shift = (v + 1) & 7;

- qemu_del_timer(s->timer);
+ s->initial_count_load_time = qemu_get_clock(vm_clock);
+ apic_timer_update(s, s->initial_count_load_time);
}

static void kvm_kernel_lapic_load_from_user(APICState *s)

[-- Attachment #3: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org