From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Ingo Molnar <mingo@kernel.org>, Mike Galbraith <efault@gmx.de>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Baoquan He <bhe@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dave Young <dyoung@redhat.com>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Andy Lutomirski <luto@amacapital.net>,
linux-mm@kvack.org, Vivek Goyal <vgoyal@redhat.com>,
Cyrill Gorcunov <gorcunov@openvz.org>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@suse.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH 4.14 023/159] mm/sparsemem: Allocate mem_section at runtime for CONFIG_SPARSEMEM_EXTREME=y
Date: Tue, 9 Jan 2018 03:13:03 +0300 [thread overview]
Message-ID: <20180109001303.dy73bpixsaegn4ol@node.shutemov.name> (raw)
In-Reply-To: <20180108174653.7muglyihpngxp5tl@black.fi.intel.com>
On Mon, Jan 08, 2018 at 08:46:53PM +0300, Kirill A. Shutemov wrote:
> On Mon, Jan 08, 2018 at 04:04:44PM +0000, Ingo Molnar wrote:
> >
> > hi Kirill,
> >
> > As Mike reported it below, your 5-level paging related upstream commit
> > 83e3c48729d9 and all its followup fixes:
> >
> > 83e3c48729d9: mm/sparsemem: Allocate mem_section at runtime for CONFIG_SPARSEMEM_EXTREME=y
> > 629a359bdb0e: mm/sparsemem: Fix ARM64 boot crash when CONFIG_SPARSEMEM_EXTREME=y
> > d09cfbbfa0f7: mm/sparse.c: wrong allocation for mem_section
> >
> > ... still breaks kexec - and that now regresses -stable as well.
> >
> > Given that 5-level paging now syntactically depends on having this commit, if we
> > fully revert this then we'll have to disable 5-level paging as well.
This *should* help.
Mike, could you test this? (On top of the rest of the fixes.)
Sorry for the mess.
From 100fd567754f1457be94732046aefca204c842d2 Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Date: Tue, 9 Jan 2018 02:55:47 +0300
Subject: [PATCH] kdump: Write a correct address of mem_section into vmcoreinfo
Depending on configuration mem_section can now be an array or a pointer
to an array allocated dynamically. In most cases, we can continue to refer
to it as 'mem_section' regardless of what it is.
But there's one exception: '&mem_section' means "address of the array" if
mem_section is an array, but if mem_section is a pointer, it would mean
"address of the pointer".
We've stepped onto this in kdump code. VMCOREINFO_SYMBOL(mem_section)
writes down address of pointer into vmcoreinfo, not array as we wanted.
Let's introduce VMCOREINFO_ARRAY() that would handle the situation
correctly for both cases.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Fixes: 83e3c48729d9 ("mm/sparsemem: Allocate mem_section at runtime for CONFIG_SPARSEMEM_EXTREME=y")
---
include/linux/crash_core.h | 2 ++
kernel/crash_core.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h
index 06097ef30449..83ae04950269 100644
--- a/include/linux/crash_core.h
+++ b/include/linux/crash_core.h
@@ -42,6 +42,8 @@ phys_addr_t paddr_vmcoreinfo_note(void);
vmcoreinfo_append_str("PAGESIZE=%ld\n", value)
#define VMCOREINFO_SYMBOL(name) \
vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
+#define VMCOREINFO_ARRAY(name) \
+ vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)name)
#define VMCOREINFO_SIZE(name) \
vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
(unsigned long)sizeof(name))
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index b3663896278e..d4122a837477 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -410,7 +410,7 @@ static int __init crash_save_vmcoreinfo_init(void)
VMCOREINFO_SYMBOL(contig_page_data);
#endif
#ifdef CONFIG_SPARSEMEM
- VMCOREINFO_SYMBOL(mem_section);
+ VMCOREINFO_ARRAY(mem_section);
VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);
VMCOREINFO_STRUCT_SIZE(mem_section);
VMCOREINFO_OFFSET(mem_section, section_mem_map);
--
Kirill A. Shutemov
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next parent reply other threads:[~2018-01-09 0:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171222084623.668990192@linuxfoundation.org>
[not found] ` <20171222084625.007160464@linuxfoundation.org>
[not found] ` <1515302062.6507.18.camel@gmx.de>
[not found] ` <20180108160444.2ol4fvgqbxnjmlpg@gmail.com>
[not found] ` <20180108174653.7muglyihpngxp5tl@black.fi.intel.com>
2018-01-09 0:13 ` Kirill A. Shutemov [this message]
2018-01-09 1:09 ` [PATCH 4.14 023/159] mm/sparsemem: Allocate mem_section at runtime for CONFIG_SPARSEMEM_EXTREME=y Dave Young
2018-01-09 5:41 ` Baoquan He
2018-01-09 7:24 ` Dave Young
2018-01-09 9:05 ` Kirill A. Shutemov
2018-01-10 3:08 ` Dave Young
2018-01-10 11:16 ` Kirill A. Shutemov
2018-01-11 1:06 ` Baoquan He
2018-01-12 0:55 ` Dave Young
2018-01-15 5:57 ` Omar Sandoval
2018-01-16 8:36 ` Atsushi Kumagai
2018-01-09 3:44 ` Mike Galbraith
2018-02-07 9:25 ` Dou Liyang
2018-02-07 10:41 ` Kirill A. Shutemov
2018-02-07 10:45 ` Mike Galbraith
2018-02-07 12:00 ` Dou Liyang
2018-02-07 12:08 ` Baoquan He
2018-02-07 12:17 ` Dou Liyang
2018-02-07 12:27 ` Baoquan He
2018-02-07 12:34 ` Dou Liyang
2018-02-07 12:45 ` Baoquan He
2018-02-08 1:14 ` Dou Liyang
2018-02-08 1:23 ` Baoquan He
2018-02-08 1:44 ` Dou Liyang
2018-02-07 11:28 ` Baoquan He
2018-01-17 5:24 ` Baoquan He
2018-01-25 15:50 ` Kirill A. Shutemov
2018-01-26 2:48 ` Baoquan He
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=20180109001303.dy73bpixsaegn4ol@node.shutemov.name \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=bp@suse.de \
--cc=dyoung@redhat.com \
--cc=efault@gmx.de \
--cc=gorcunov@openvz.org \
--cc=gregkh@linuxfoundation.org \
--cc=kexec@lists.infradead.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vgoyal@redhat.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