From patchwork Wed Nov 25 00:37:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 57279 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2433278lbb; Tue, 24 Nov 2015 16:40:07 -0800 (PST) X-Received: by 10.31.47.204 with SMTP id v195mr30733048vkv.119.1448412007268; Tue, 24 Nov 2015 16:40:07 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h133si21059492vkh.138.2015.11.24.16.40.07 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 Nov 2015 16:40:07 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:42266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1O7y-00006r-Pf for patch@linaro.org; Tue, 24 Nov 2015 19:40:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1O6Q-0005vH-Gl for qemu-devel@nongnu.org; Tue, 24 Nov 2015 19:38:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1O6P-0002Mq-HR for qemu-devel@nongnu.org; Tue, 24 Nov 2015 19:38:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1O6J-0002Ly-Jo; Tue, 24 Nov 2015 19:38:27 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 4792696D0; Wed, 25 Nov 2015 00:38:23 +0000 (UTC) Received: from hawk.localdomain.com (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAP0c1s1014074; Tue, 24 Nov 2015 19:38:19 -0500 From: Andrew Jones To: qemu-devel@nongnu.org Date: Tue, 24 Nov 2015 19:37:55 -0500 Message-Id: <1448411877-22019-5-git-send-email-drjones@redhat.com> In-Reply-To: <1448411877-22019-1-git-send-email-drjones@redhat.com> References: <1448411877-22019-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 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 v2 4/6] 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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 --- dump.c | 4 ++-- include/sysemu/dump-arch.h | 1 + include/sysemu/dump.h | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) -- 2.4.3 Reviewed-by: Peter Maydell 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)