From patchwork Tue Dec 15 22:51:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 557169 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 50C831402D6 for ; Wed, 16 Dec 2015 09:53:42 +1100 (AEDT) Received: from localhost ([::1]:39444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8yTU-00081H-6P for incoming@patchwork.ozlabs.org; Tue, 15 Dec 2015 17:53:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8yRp-0004pv-4l for qemu-devel@nongnu.org; Tue, 15 Dec 2015 17:51:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8yRo-0001ci-5o for qemu-devel@nongnu.org; Tue, 15 Dec 2015 17:51:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8yRj-0001cA-IZ; Tue, 15 Dec 2015 17:51:51 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 23381C0B7E03; Tue, 15 Dec 2015 22:51:51 +0000 (UTC) Received: from hawk.localdomain.com (ovpn-204-26.brq.redhat.com [10.40.204.26]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBFMpNh5024186; Tue, 15 Dec 2015 17:51:46 -0500 From: Andrew Jones To: qemu-devel@nongnu.org Date: Tue, 15 Dec 2015 16:51:13 -0600 Message-Id: <1450219878-5293-5-git-send-email-drjones@redhat.com> In-Reply-To: <1450219878-5293-1-git-send-email-drjones@redhat.com> References: <1450219878-5293-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, agraf@suse.de, armbru@redhat.com, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, afaerber@suse.de, rth@twiddle.net Subject: [Qemu-devel] [PATCH v3 4/9] dump: allow target to set the physical base X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org crash assumes the physical base in the kdump subheader of makedumpfile formatted dumps is correct. Zero is not correct for all architectures, so allow it to be changed. (No functional change.) Signed-off-by: Andrew Jones Reviewed-by: Peter Maydell --- dump.c | 4 ++-- include/sysemu/dump-arch.h | 1 + include/sysemu/dump.h | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dump.c b/dump.c index e1d9bae9e89d1..2d4892bec2672 100644 --- a/dump.c +++ b/dump.c @@ -775,7 +775,7 @@ static void create_header32(DumpState *s, Error **errp) /* 64bit max_mapnr_64 */ kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr); - kh->phys_base = cpu_to_dump32(s, PHYS_BASE); + kh->phys_base = cpu_to_dump32(s, s->dump_info.phys_base); kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL); offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size; @@ -875,7 +875,7 @@ static void create_header64(DumpState *s, Error **errp) /* 64bit max_mapnr_64 */ kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr); - kh->phys_base = cpu_to_dump64(s, PHYS_BASE); + kh->phys_base = cpu_to_dump64(s, s->dump_info.phys_base); kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL); offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size; diff --git a/include/sysemu/dump-arch.h b/include/sysemu/dump-arch.h index 43358396ea81a..e25b02e99013c 100644 --- a/include/sysemu/dump-arch.h +++ b/include/sysemu/dump-arch.h @@ -20,6 +20,7 @@ typedef struct ArchDumpInfo { int d_class; /* ELFCLASS32 or ELFCLASS64 */ uint32_t page_size; /* The target's page size. If it's variable and * unknown, then this should be the maximum. */ + uint64_t phys_base; /* The target's physmem base. */ } ArchDumpInfo; struct GuestPhysBlockList; /* memory_mapping.h */ diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index 16cbd8d881fd6..2f04b247bed1b 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -33,7 +33,6 @@ #define KDUMP_SIGNATURE "KDUMP " #define SIG_LEN (sizeof(KDUMP_SIGNATURE) - 1) -#define PHYS_BASE (0) #define DUMP_LEVEL (1) #define DISKDUMP_HEADER_BLOCKS (1)