218e99
From 5f3d2969b85b5e679b6d110d180500914a499993 Mon Sep 17 00:00:00 2001
218e99
From: Laszlo Ersek <lersek@redhat.com>
218e99
Date: Mon, 12 Aug 2013 15:59:35 +0200
218e99
Subject: dump: Abstract dump_init() with cpu_synchronize_all_states()
218e99
218e99
RH-Author: Laszlo Ersek <lersek@redhat.com>
218e99
Message-id: <1376323180-12863-6-git-send-email-lersek@redhat.com>
218e99
Patchwork-id: 53164
218e99
O-Subject: [RHEL-7 qemu-kvm PATCH 05/10] dump: Abstract dump_init() with cpu_synchronize_all_states()
218e99
Bugzilla: 981582
218e99
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
218e99
RH-Acked-by: Radim Krcmar <rkrcmar@redhat.com>
218e99
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
218e99
From: Andreas Färber <afaerber@suse.de>
218e99
218e99
Instead of calling cpu_synchronize_state() for each CPU, call the
218e99
existing cpu_synchronize_all_states() helper.
218e99
218e99
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
218e99
Signed-off-by: Andreas Färber <afaerber@suse.de>
218e99
(cherry picked from commit 1b3509ca5bbd8e7d2be92ac42196a3ee2e31cb03)
218e99
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
218e99
218e99
diff --git a/dump.c b/dump.c
218e99
index c0d3da5..87ca12c 100644
218e99
--- a/dump.c
218e99
+++ b/dump.c
218e99
@@ -21,6 +21,7 @@
218e99
 #include "sysemu/dump.h"
218e99
 #include "sysemu/sysemu.h"
218e99
 #include "sysemu/memory_mapping.h"
218e99
+#include "sysemu/cpus.h"
218e99
 #include "qapi/error.h"
218e99
 #include "qmp-commands.h"
218e99
 
218e99
@@ -731,12 +732,12 @@ static int dump_init(DumpState *s, int fd, bool paging, bool has_filter,
218e99
      * If the target architecture is not supported, cpu_get_dump_info() will
218e99
      * return -1.
218e99
      *
218e99
-     * if we use kvm, we should synchronize the register before we get dump
218e99
+     * If we use KVM, we should synchronize the registers before we get dump
218e99
      * info.
218e99
      */
218e99
+    cpu_synchronize_all_states();
218e99
     nr_cpus = 0;
218e99
     for (env = first_cpu; env != NULL; env = env->next_cpu) {
218e99
-        cpu_synchronize_state(env);
218e99
         nr_cpus++;
218e99
     }
218e99