]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
migration/colo.c: Use cpu_synchronize_all_states()
authorLukas Straub <lukasstraub2@web.de>
Mon, 11 May 2020 11:10:48 +0000 (13:10 +0200)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 1 Jun 2020 17:44:27 +0000 (18:44 +0100)
cpu_synchronize_all_pre_loadvm() marks all vcpus as dirty, so the
registers are loaded from CPUState before we continue running
the vm. However if we failover during checkpoint, CPUState is not
initialized and the registers are loaded with garbage. This causes
guest hangs and crashes.

Fix this by using cpu_synchronize_all_states(), which initializes
CPUState from the current cpu registers additionally to marking
the vcpus as dirty.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Message-Id: <9675031ce557b73ebd10e7bd20ebbf57f30b177c.1589193382.git.lukasstraub2@web.de>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/colo.c

index fe0d6e93e5c7829772067f5f6188e3af72b36469..d00b3b9d6b981aa43515db774b36dd779e282d3f 100644 (file)
@@ -705,7 +705,7 @@ static void colo_incoming_process_checkpoint(MigrationIncomingState *mis,
     }
 
     qemu_mutex_lock_iothread();
-    cpu_synchronize_all_pre_loadvm();
+    cpu_synchronize_all_states();
     ret = qemu_loadvm_state_main(mis->from_src_file, mis);
     qemu_mutex_unlock_iothread();