aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2016-10-07 12:19:55 -0400
committerHelge Deller <deller@gmx.de>2016-10-07 12:23:43 -0400
commit690d097c00c88fa9d93d198591e184164b1d8c20 (patch)
tree54761151bc2733d59d0ec02c4a7dda571da5076a
parent4fe9e1d957e45ad8eba9885ee860a0e93d13a7c7 (diff)
parisc: Increase KERNEL_INITIAL_SIZE for 32-bit SMP kernels
Increase the initial kernel default page mapping size for SMP kernels to 32MB and add a runtime check which panics early if the kernel is bigger than the initial mapping size. This fixes boot crashes of 32bit SMP kernels. Due to the introduction of huge page support in kernel 4.4 and it's required initial kernel layout in memory, a 32bit SMP kernel usually got bigger (in layout, not size) than 16MB. Cc: stable@vger.kernel.org #4.4+ Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--arch/parisc/include/asm/pgtable.h2
-rw-r--r--arch/parisc/kernel/setup.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index 291cee28ccb6..e44bdb9078a5 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -83,7 +83,7 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
83 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e)) 83 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e))
84 84
85/* This is the size of the initially mapped kernel memory */ 85/* This is the size of the initially mapped kernel memory */
86#ifdef CONFIG_64BIT 86#if defined(CONFIG_64BIT) || defined(CONFIG_SMP)
87#define KERNEL_INITIAL_ORDER 25 /* 1<<25 = 32MB */ 87#define KERNEL_INITIAL_ORDER 25 /* 1<<25 = 32MB */
88#else 88#else
89#define KERNEL_INITIAL_ORDER 24 /* 1<<24 = 16MB */ 89#define KERNEL_INITIAL_ORDER 24 /* 1<<24 = 16MB */
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index f7ea626e29c9..81d6f6391944 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -38,6 +38,7 @@
38#include <linux/export.h> 38#include <linux/export.h>
39 39
40#include <asm/processor.h> 40#include <asm/processor.h>
41#include <asm/sections.h>
41#include <asm/pdc.h> 42#include <asm/pdc.h>
42#include <asm/led.h> 43#include <asm/led.h>
43#include <asm/machdep.h> /* for pa7300lc_init() proto */ 44#include <asm/machdep.h> /* for pa7300lc_init() proto */
@@ -140,6 +141,13 @@ void __init setup_arch(char **cmdline_p)
140#endif 141#endif
141 printk(KERN_CONT ".\n"); 142 printk(KERN_CONT ".\n");
142 143
144 /*
145 * Check if initial kernel page mappings are sufficient.
146 * panic early if not, else we may access kernel functions
147 * and variables which can't be reached.
148 */
149 if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE)
150 panic("KERNEL_INITIAL_ORDER too small!");
143 151
144 pdc_console_init(); 152 pdc_console_init();
145 153