[08/35] Synchronize VCPU states before reset

Message ID a7ada1510cb380b86c4811aa40fc45c8a7fc0daf.1300225848.git.mtosatti@redhat.com
State New
Headers show

Commit Message

Marcelo Tosatti March 15, 2011, 9:50 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

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

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 |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/vl.c b/vl.c
index 5e007a7..f4c24d3 100644
--- a/vl.c
+++ b/vl.c
@@ -1450,6 +1450,7 @@  static void main_loop(void)
         if (qemu_reset_requested()) {
+            cpu_synchronize_all_states();