[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/6] migration/colo.c: Use cpu_synchronize_all_states()
From: |
Lukas Straub |
Subject: |
[PATCH v2 2/6] migration/colo.c: Use cpu_synchronize_all_states() |
Date: |
Wed, 20 May 2020 22:42:16 +0200 |
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 <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
---
migration/colo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/colo.c b/migration/colo.c
index 09168627bc..6b2ad35aa4 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -696,7 +696,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();
--
2.20.1
pgp7814_ghQuC.pgp
Description: OpenPGP digital signature
- [PATCH v2 0/6] colo: migration related bugfixes, Lukas Straub, 2020/05/20
- [PATCH v2 2/6] migration/colo.c: Use cpu_synchronize_all_states(),
Lukas Straub <=
- [PATCH v2 1/6] migration/colo.c: Use event instead of semaphore, Lukas Straub, 2020/05/20
- [PATCH v2 3/6] migration/colo.c: Flush ram cache only after receiving device state, Lukas Straub, 2020/05/20
- [PATCH v2 4/6] migration/colo.c: Relaunch failover even if there was an error, Lukas Straub, 2020/05/20
- [PATCH v2 5/6] migration/colo.c: Move colo_notify_compares_event to the right place, Lukas Straub, 2020/05/20
- [PATCH v2 6/6] migration/migration.c: Fix hang in ram_save_host_page, Lukas Straub, 2020/05/20