cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
5d360b
From 26e8c3574944585f9f02a92b03a6e7097dd3a7dd Mon Sep 17 00:00:00 2001
5d360b
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
5d360b
Date: Wed, 13 Dec 2017 13:38:53 +0100
5d360b
Subject: [PATCH 22/41] dump: allow target to set the physical base
5d360b
MIME-Version: 1.0
5d360b
Content-Type: text/plain; charset=UTF-8
5d360b
Content-Transfer-Encoding: 8bit
5d360b
5d360b
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
5d360b
Message-id: <20171213133912.26176-23-marcandre.lureau@redhat.com>
5d360b
Patchwork-id: 78371
5d360b
O-Subject: [RHEL-7.5 qemu-kvm PATCH v3 22/41] dump: allow target to set the physical base
5d360b
Bugzilla: 1411490
5d360b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
5d360b
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
5d360b
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
5d360b
5d360b
From: Andrew Jones <drjones@redhat.com>
5d360b
5d360b
crash assumes the physical base in the kdump subheader of
5d360b
makedumpfile formatted dumps is correct. Zero is not correct
5d360b
for all architectures, so allow it to be changed.
5d360b
5d360b
(No functional change.)
5d360b
5d360b
Signed-off-by: Andrew Jones <drjones@redhat.com>
5d360b
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5d360b
Message-id: 1452542185-10914-5-git-send-email-drjones@redhat.com
5d360b
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5d360b
5d360b
(cherry picked from commit b6e05aa473b52e049654fae834453232e6b6e798)
5d360b
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
5d360b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
5d360b
---
5d360b
 dump.c                     | 4 ++--
5d360b
 include/sysemu/dump-arch.h | 1 +
5d360b
 include/sysemu/dump.h      | 1 -
5d360b
 3 files changed, 3 insertions(+), 3 deletions(-)
5d360b
5d360b
diff --git a/dump.c b/dump.c
5d360b
index b5d6608..a359c29 100644
5d360b
--- a/dump.c
5d360b
+++ b/dump.c
5d360b
@@ -780,7 +780,7 @@ static void create_header32(DumpState *s, Error **errp)
5d360b
 
5d360b
     /* 64bit max_mapnr_64 */
5d360b
     kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr);
5d360b
-    kh->phys_base = cpu_to_dump32(s, PHYS_BASE);
5d360b
+    kh->phys_base = cpu_to_dump32(s, s->dump_info.phys_base);
5d360b
     kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);
5d360b
 
5d360b
     offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
5d360b
@@ -880,7 +880,7 @@ static void create_header64(DumpState *s, Error **errp)
5d360b
 
5d360b
     /* 64bit max_mapnr_64 */
5d360b
     kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr);
5d360b
-    kh->phys_base = cpu_to_dump64(s, PHYS_BASE);
5d360b
+    kh->phys_base = cpu_to_dump64(s, s->dump_info.phys_base);
5d360b
     kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);
5d360b
 
5d360b
     offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
5d360b
diff --git a/include/sysemu/dump-arch.h b/include/sysemu/dump-arch.h
5d360b
index 4335839..e25b02e 100644
5d360b
--- a/include/sysemu/dump-arch.h
5d360b
+++ b/include/sysemu/dump-arch.h
5d360b
@@ -20,6 +20,7 @@ typedef struct ArchDumpInfo {
5d360b
     int d_class;             /* ELFCLASS32 or ELFCLASS64 */
5d360b
     uint32_t page_size;      /* The target's page size. If it's variable and
5d360b
                               * unknown, then this should be the maximum. */
5d360b
+    uint64_t phys_base;      /* The target's physmem base. */
5d360b
 } ArchDumpInfo;
5d360b
 
5d360b
 struct GuestPhysBlockList; /* memory_mapping.h */
5d360b
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
5d360b
index 16cbd8d..2f04b24 100644
5d360b
--- a/include/sysemu/dump.h
5d360b
+++ b/include/sysemu/dump.h
5d360b
@@ -33,7 +33,6 @@
5d360b
 
5d360b
 #define KDUMP_SIGNATURE             "KDUMP   "
5d360b
 #define SIG_LEN                     (sizeof(KDUMP_SIGNATURE) - 1)
5d360b
-#define PHYS_BASE                   (0)
5d360b
 #define DUMP_LEVEL                  (1)
5d360b
 #define DISKDUMP_HEADER_BLOCKS      (1)
5d360b
 
5d360b
-- 
5d360b
1.8.3.1
5d360b