mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Liu Hua <sdu.liu@huawei.com>
To: <ebiederm@xmission.com>
Cc: <kexec@lists.infradead.org>, <kumagai-atsushi@mxc.nes.nec.co.jp>,
	<anderson@redhat.com>, <peifeiyue@huawei.com>,
	<wangnan0@huawei.com>, <linux-kernel@vger.kernel.org>,
	<liusdu@126.com>, <hui.geng@huawei.com>,
	Liu Hua <sdu.liu@huawei.com>
Subject: [RESEND PATCH] kexec : add sparse memory related values to vmcore
Date: Wed, 28 May 2014 21:49:56 +0800	[thread overview]
Message-ID: <1401284996-44873-1-git-send-email-sdu.liu@huawei.com> (raw)

This patch deales with sparse memory model.

For ARM32 platforms, different vendors may define different
SECTION_SIZE_BITS, which we did not write to vmcore.

For example:

  1 arch/arm/mach-clps711x/include/mach/memory.h
    #define SECTION_SIZE_BITS 24
  2 arch/arm/mach-exynos/include/mach/memory.h
    #define SECTION_SIZE_BITS 28
  3 arch/arm/mach-sa1100/include/mach/memory.h
    #define SECTION_SIZE_BITS 27

It is really a bad news for user space tools such as
makedumpfile and crash, who have to defines them as
macros. So for the same architecture, we may need to
recomile them to parse vmcores with different
SECTION_SIZE_BITS.

And if we enable LPAE, MAX_PHYSMEM_SIZE can alse
be variable.

This patch adds these SECTION_SIZE_BITS and MAX_PHYSMEM_SIZE
to vmcore. which makes user space tools more compatible.

BTW, makedumpfile has queued the related patch.

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
---
 kernel/kexec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/kexec.c b/kernel/kexec.c
index bf0b929e..8b1a193 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1577,6 +1577,8 @@ static int __init crash_save_vmcoreinfo_init(void)
 	VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);
 	VMCOREINFO_STRUCT_SIZE(mem_section);
 	VMCOREINFO_OFFSET(mem_section, section_mem_map);
+	VMCOREINFO_NUMBER(MAX_PHYSMEM_BITS);
+	VMCOREINFO_NUMBER(SECTION_SIZE_BITS);
 #endif
 	VMCOREINFO_STRUCT_SIZE(page);
 	VMCOREINFO_STRUCT_SIZE(pglist_data);
-- 
1.9.0


             reply	other threads:[~2014-05-28 13:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28 13:49 Liu Hua [this message]
2014-05-29  0:13 ` Simon Horman
2014-05-30  8:14   ` Liu hua
2014-06-02  0:01     ` Simon Horman
2014-06-03  1:26   ` Liu hua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401284996-44873-1-git-send-email-sdu.liu@huawei.com \
    --to=sdu.liu@huawei.com \
    --cc=anderson@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=hui.geng@huawei.com \
    --cc=kexec@lists.infradead.org \
    --cc=kumagai-atsushi@mxc.nes.nec.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liusdu@126.com \
    --cc=peifeiyue@huawei.com \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®