Patchwork [24/35] Synchronize VCPU states before reset

login
register
mail settings
Submitter Marcelo Tosatti
Date Jan. 6, 2011, 5:56 p.m.
Message ID <fb73a84c82c258a7188e981f5bb85ba2522937f1.1294336601.git.mtosatti@redhat.com>
Download mbox | patch
Permalink /patch/77766/
State New
Headers show

Comments

Marcelo Tosatti - Jan. 6, 2011, 5:56 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
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 |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index 78fcef1..b0b6605 100644
--- a/vl.c
+++ b/vl.c
@@ -1422,6 +1422,7 @@  static void main_loop(void)
         }
         if (qemu_reset_requested()) {
             pause_all_vcpus();
+            cpu_synchronize_all_states();
             qemu_system_reset();
             resume_all_vcpus();
         }