summaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/setup.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2016-10-07 18:19:55 +0200
committerHelge Deller <deller@gmx.de>2016-10-07 18:23:43 +0200
commit690d097c00c88fa9d93d198591e184164b1d8c20 (patch)
tree54761151bc2733d59d0ec02c4a7dda571da5076a /arch/parisc/kernel/setup.c
parent4fe9e1d957e45ad8eba9885ee860a0e93d13a7c7 (diff)
downloadlinux-690d097c00c88fa9d93d198591e184164b1d8c20.tar.bz2
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>
Diffstat (limited to 'arch/parisc/kernel/setup.c')
-rw-r--r--arch/parisc/kernel/setup.c8
1 files changed, 8 insertions, 0 deletions
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 @@
#include <linux/export.h>
#include <asm/processor.h>
+#include <asm/sections.h>
#include <asm/pdc.h>
#include <asm/led.h>
#include <asm/machdep.h> /* for pa7300lc_init() proto */
@@ -140,6 +141,13 @@ void __init setup_arch(char **cmdline_p)
#endif
printk(KERN_CONT ".\n");
+ /*
+ * Check if initial kernel page mappings are sufficient.
+ * panic early if not, else we may access kernel functions
+ * and variables which can't be reached.
+ */
+ if (__pa((unsigned long) &_end) >= KERNEL_INITIAL_SIZE)
+ panic("KERNEL_INITIAL_ORDER too small!");
pdc_console_init();