Fix guest resetting
commit368767f7d03c853c3e0231d9e704c5b51fd8822f
authorJan Kiszka <jan.kiszka@web.de>
Mon, 12 May 2008 10:49:39 +0000 (12 12:49 +0200)
committerAvi Kivity <avi@qumranet.com>
Sun, 18 May 2008 14:33:37 +0000 (18 17:33 +0300)
tree0a28fcebb5f6cd8a68d88c81a06438e983dd42be
parentc40ccca650d6d67ed50e1f4dd261e8f901bf469c
Fix guest resetting

Resetting guests used to be racy, deadlock-prone, or simply broken (for
SMP). This patch fixes the issues, following Marcelo's suggestion to
consolidate the reset activity in the I/O thread. All vcpus are cleanly
stopped before the emulated hardware is reset, and kvm_arch_cpu_reset is
introduced and invoked to ensure that non-boot cpus are put into the
right state on x86. Note that other arch may need to look into this
service as well to get SMP reset right.

Moreover, a safety check is added to pause/resume_all_threads to ensure
that they are only invoked in I/O thread context.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
qemu-kvm-ia64.c
qemu-kvm-powerpc.c
qemu-kvm-x86.c
qemu-kvm.c
qemu-kvm.h
vl.c