From patchwork Mon Jan 11 19:56:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 566098 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 53B481401B5 for ; Tue, 12 Jan 2016 06:58:58 +1100 (AEDT) Received: from localhost ([::1]:56645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIicC-0007e3-9v for incoming@patchwork.ozlabs.org; Mon, 11 Jan 2016 14:58:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIia9-0003MH-H7 for qemu-devel@nongnu.org; Mon, 11 Jan 2016 14:56:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIia8-0002vN-NI for qemu-devel@nongnu.org; Mon, 11 Jan 2016 14:56:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIia4-0002t0-95; Mon, 11 Jan 2016 14:56:44 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id C9F0DC0A8058; Mon, 11 Jan 2016 19:56:43 +0000 (UTC) Received: from hawk.localdomain.com (dhcp-1-158.brq.redhat.com [10.34.1.158]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0BJuU1l012743; Mon, 11 Jan 2016 14:56:41 -0500 From: Andrew Jones To: qemu-devel@nongnu.org Date: Mon, 11 Jan 2016 20:56:21 +0100 Message-Id: <1452542185-10914-5-git-send-email-drjones@redhat.com> In-Reply-To: <1452542185-10914-1-git-send-email-drjones@redhat.com> References: <1452542185-10914-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 v4 4/8] 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)