cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-dump-Abstract-dump_init-with-cpu_synchronize_all_states.patch

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