aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaoquan He <bhe@redhat.com>2018-10-06 04:43:25 -0400
committerIngo Molnar <mingo@kernel.org>2018-10-06 08:46:46 -0400
commit06d4a462e954756f3d3d54e6f3f1bdc2e6f592a9 (patch)
treeb51c46fa5a90bce676dc65af68b9ce5c269870da
parent992b649a3f013465d8128da02e5449def662a4c3 (diff)
x86/KASLR: Update KERNEL_IMAGE_SIZE description
Currently CONFIG_RANDOMIZE_BASE=y is set by default, which makes some of the old comments above the KERNEL_IMAGE_SIZE definition out of date. Update them to the current state of affairs. Signed-off-by: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@surriel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: corbet@lwn.net Cc: linux-doc@vger.kernel.org Cc: thgarnie@google.com Link: http://lkml.kernel.org/r/20181006084327.27467-2-bhe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/include/asm/page_64_types.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
index 6afac386a434..cd0cf1c568b4 100644
--- a/arch/x86/include/asm/page_64_types.h
+++ b/arch/x86/include/asm/page_64_types.h
@@ -59,13 +59,16 @@
59#endif 59#endif
60 60
61/* 61/*
62 * Kernel image size is limited to 1GiB due to the fixmap living in the 62 * Maximum kernel image size is limited to 1 GiB, due to the fixmap living
63 * next 1GiB (see level2_kernel_pgt in arch/x86/kernel/head_64.S). Use 63 * in the next 1 GiB (see level2_kernel_pgt in arch/x86/kernel/head_64.S).
64 * 512MiB by default, leaving 1.5GiB for modules once the page tables 64 *
65 * are fully set up. If kernel ASLR is configured, it can extend the 65 * On KASLR use 1 GiB by default, leaving 1 GiB for modules once the
66 * kernel page table mapping, reducing the size of the modules area. 66 * page tables are fully set up.
67 *
68 * If KASLR is disabled we can shrink it to 0.5 GiB and increase the size
69 * of the modules area to 1.5 GiB.
67 */ 70 */
68#if defined(CONFIG_RANDOMIZE_BASE) 71#ifdef CONFIG_RANDOMIZE_BASE
69#define KERNEL_IMAGE_SIZE (1024 * 1024 * 1024) 72#define KERNEL_IMAGE_SIZE (1024 * 1024 * 1024)
70#else 73#else
71#define KERNEL_IMAGE_SIZE (512 * 1024 * 1024) 74#define KERNEL_IMAGE_SIZE (512 * 1024 * 1024)