stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "parisc: Increase KERNEL_INITIAL_SIZE for 32-bit SMP kernels" has been added to the 4.8-stable tree
@ 2016-10-26  7:34 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-10-26  7:34 UTC (permalink / raw)
  To: deller, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    parisc: Increase KERNEL_INITIAL_SIZE for 32-bit SMP kernels

to the 4.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     parisc-increase-kernel_initial_size-for-32-bit-smp-kernels.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 690d097c00c88fa9d93d198591e184164b1d8c20 Mon Sep 17 00:00:00 2001
From: Helge Deller <deller@gmx.de>
Date: Fri, 7 Oct 2016 18:19:55 +0200
Subject: parisc: Increase KERNEL_INITIAL_SIZE for 32-bit SMP kernels

From: Helge Deller <deller@gmx.de>

commit 690d097c00c88fa9d93d198591e184164b1d8c20 upstream.

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.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/parisc/include/asm/pgtable.h |    2 +-
 arch/parisc/kernel/setup.c        |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -83,7 +83,7 @@ static inline void purge_tlb_entries(str
 	printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e))
 
 /* This is the size of the initially mapped kernel memory */
-#ifdef CONFIG_64BIT
+#if defined(CONFIG_64BIT) || defined(CONFIG_SMP)
 #define KERNEL_INITIAL_ORDER	25	/* 1<<25 = 32MB */
 #else
 #define KERNEL_INITIAL_ORDER	24	/* 1<<24 = 16MB */
--- 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();
 


Patches currently in stable-queue which might be from deller@gmx.de are

queue-4.8/parisc-fix-kernel-memory-layout-regarding-position-of-__gp.patch
queue-4.8/parisc-increase-initial-kernel-mapping-size.patch
queue-4.8/parisc-increase-kernel_initial_size-for-32-bit-smp-kernels.patch
queue-4.8/parisc-fix-self-detected-cpu-stall-warnings-on-mako-machines.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-26  7:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-26  7:34 Patch "parisc: Increase KERNEL_INITIAL_SIZE for 32-bit SMP kernels" has been added to the 4.8-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).