diff options
| author | Jan Kiszka <jan.kiszka@web.de> | 2009-06-27 09:24:58 +0200 |
|---|---|---|
| committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-29 14:18:07 -0500 |
| commit | 8d2ba1fb9c8e7006e10d71fa51a020977f14c8b0 (patch) | |
| tree | fe229d578c3380d6b9e874337f06413a9a1160af /hw/apic.c | |
| parent | e9283f8b88eb6054ac032f3d9b773e80d842c0cf (diff) | |
| download | focaccia-qemu-8d2ba1fb9c8e7006e10d71fa51a020977f14c8b0.tar.gz focaccia-qemu-8d2ba1fb9c8e7006e10d71fa51a020977f14c8b0.zip | |
kvm: Rework VCPU synchronization
During startup and after reset we have to synchronize user space to the in-kernel KVM state. Namely, we need to transfer the VCPU registers when they change due to VCPU as well as APIC reset. This patch refactors the required hooks so that kvm_init_vcpu registers its own per-VCPU reset handler and adds a cpu_synchronize_state to the APIC reset. That way we no longer depend on the new reset order (and can drop this disliked interface again) and we can even drop a KVM hook in main(). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/apic.c')
| -rw-r--r-- | hw/apic.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/apic.c b/hw/apic.c index 3ec4156cf2..cb9f8ee04d 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -23,6 +23,7 @@ #include "msix.h" #include "qemu-timer.h" #include "host-utils.h" +#include "kvm.h" //#define DEBUG_APIC @@ -953,6 +954,8 @@ static void apic_reset(void *opaque) */ s->lvt[APIC_LVT_LINT0] = 0x700; } + + cpu_synchronize_state(s->cpu_env, 1); } static CPUReadMemoryFunc *apic_mem_read[3] = { |