thebeanogamer / rpms / qemu-kvm

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