aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/crash_core.h
diff options
context:
space:
mode:
authorXunlei Pang <xlpang@redhat.com>2017-07-12 14:33:14 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-12 16:25:59 -0700
commit203e9e41219b4e7357104e525e91ac609fba2c6c (patch)
treef7b0b4235857f20c11bf15d2e582d57f9f29a872 /include/linux/crash_core.h
parentkernel/fork.c: virtually mapped stacks: do not disable interrupts (diff)
downloadlinux-dev-203e9e41219b4e7357104e525e91ac609fba2c6c.tar.xz
linux-dev-203e9e41219b4e7357104e525e91ac609fba2c6c.zip
kexec: move vmcoreinfo out of the kernel's .bss section
As Eric said, "what we need to do is move the variable vmcoreinfo_note out of the kernel's .bss section. And modify the code to regenerate and keep this information in something like the control page. Definitely something like this needs a page all to itself, and ideally far away from any other kernel data structures. I clearly was not watching closely the data someone decided to keep this silly thing in the kernel's .bss section." This patch allocates extra pages for these vmcoreinfo_XXX variables, one advantage is that it enhances some safety of vmcoreinfo, because vmcoreinfo now is kept far away from other kernel data structures. Link: http://lkml.kernel.org/r/1493281021-20737-1-git-send-email-xlpang@redhat.com Signed-off-by: Xunlei Pang <xlpang@redhat.com> Tested-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Reviewed-by: Juergen Gross <jgross@suse.com> Suggested-by: Eric Biederman <ebiederm@xmission.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Dave Young <dyoung@redhat.com> Cc: Hari Bathini <hbathini@linux.vnet.ibm.com> Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/crash_core.h')
-rw-r--r--include/linux/crash_core.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h
index 4090a42578a8..87506a02e914 100644
--- a/include/linux/crash_core.h
+++ b/include/linux/crash_core.h
@@ -19,7 +19,7 @@
CRASH_CORE_NOTE_NAME_BYTES + \
CRASH_CORE_NOTE_DESC_BYTES)
-#define VMCOREINFO_BYTES (4096)
+#define VMCOREINFO_BYTES PAGE_SIZE
#define VMCOREINFO_NOTE_NAME "VMCOREINFO"
#define VMCOREINFO_NOTE_NAME_BYTES ALIGN(sizeof(VMCOREINFO_NOTE_NAME), 4)
#define VMCOREINFO_NOTE_SIZE ((CRASH_CORE_NOTE_HEAD_BYTES * 2) + \
@@ -56,7 +56,7 @@ phys_addr_t paddr_vmcoreinfo_note(void);
#define VMCOREINFO_CONFIG(name) \
vmcoreinfo_append_str("CONFIG_%s=y\n", #name)
-extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
+extern u32 *vmcoreinfo_note;
extern size_t vmcoreinfo_size;
extern size_t vmcoreinfo_max_size;