]> git.proxmox.com Git - qemu.git/commitdiff
Synchronize VCPU states before reset
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 2 Mar 2011 07:56:11 +0000 (08:56 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 15 Mar 2011 04:19:05 +0000 (01:19 -0300)
This is required to support keeping VCPU states across a system reset.
If we do not read the current state before the reset,
cpu_synchronize_all_post_reset may write back incorrect state
information.

The first user of this will be MCE MSR synchronization which currently
works around the missing cpu_synchronize_all_states.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
vl.c

diff --git a/vl.c b/vl.c
index 5e007a764cf58f7952a7cbfdaae1d362dbe1678d..f4c24d30dcda372d54d9dadc3436549453926867 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1450,6 +1450,7 @@ static void main_loop(void)
         }
         if (qemu_reset_requested()) {
             pause_all_vcpus();
+            cpu_synchronize_all_states();
             qemu_system_reset();
             resume_all_vcpus();
         }