From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
To: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: d.hatayama@jp.fujitsu.com, kexec@lists.infradead.org
Subject: [PATCH 1/2] makedumpfile: Fix zero checking of get_mm_sparsemem()
Date: Tue, 25 Mar 2014 17:13:56 +0100 [thread overview]
Message-ID: <20140325171356.6d06178c@holzheu> (raw)
Currently zero entries in the "mem_section" array and the section arrays
from the "mem_section" entries are not checked correctly. The problem
especially hits the s390x architecture because there the is_kvaddr()
function returns true for the first memory page.
So add missing zero checks and set "mem_map" to NOT_MEMMAP_ADDR for
all found zero entries.
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
makedumpfile.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2690,11 +2690,14 @@ nr_to_section(unsigned long nr, unsigned
{
unsigned long addr;
- if (is_sparsemem_extreme())
+ if (is_sparsemem_extreme()) {
+ if (mem_sec[SECTION_NR_TO_ROOT(nr)] == 0)
+ return NOT_KV_ADDR;
addr = mem_sec[SECTION_NR_TO_ROOT(nr)] +
(nr & SECTION_ROOT_MASK()) * SIZE(mem_section);
- else
+ } else {
addr = SYMBOL(mem_section) + (nr * SIZE(mem_section));
+ }
if (!is_kvaddr(addr))
return NOT_KV_ADDR;
@@ -2778,10 +2781,19 @@ get_mm_sparsemem(void)
}
for (section_nr = 0; section_nr < num_section; section_nr++) {
section = nr_to_section(section_nr, mem_sec);
- mem_map = section_mem_map_addr(section);
- mem_map = sparse_decode_mem_map(mem_map, section_nr);
- if (!is_kvaddr(mem_map))
+ if (section == NOT_KV_ADDR) {
mem_map = NOT_MEMMAP_ADDR;
+ } else {
+ mem_map = section_mem_map_addr(section);
+ if (mem_map == 0) {
+ mem_map = NOT_MEMMAP_ADDR;
+ } else {
+ mem_map = sparse_decode_mem_map(mem_map,
+ section_nr);
+ if (!is_kvaddr(mem_map))
+ mem_map = NOT_MEMMAP_ADDR;
+ }
+ }
pfn_start = section_nr * PAGES_PER_SECTION();
pfn_end = pfn_start + PAGES_PER_SECTION();
if (info->max_mapnr < pfn_end)
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
reply other threads:[~2014-03-25 16:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20140325171356.6d06178c@holzheu \
--to=holzheu@linux.vnet.ibm.com \
--cc=d.hatayama@jp.fujitsu.com \
--cc=kexec@lists.infradead.org \
--cc=kumagai-atsushi@mxc.nes.nec.co.jp \
/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