mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][PPC32] Make PPC40x large tlb mapping optional
@ 2004-08-11 17:52 Matt Porter
  2004-08-15 21:23 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Porter @ 2004-08-11 17:52 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, linuxppc-dev

This makes the PPC40x lowmem large tlb mapping selectable via
a cmdline option.  This allows use of the normal page-sized mapping
so that kernel text can be read only if desired.

Signed-off-by: Josh Boyer <jwboyer@charter.net>
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>

diff -Naur -x '*.swp' linux-2.6.orig/arch/ppc/mm/4xx_mmu.c linux-2.6/arch/ppc/mm/4xx_mmu.c
--- linux-2.6.orig/arch/ppc/mm/4xx_mmu.c	2004-06-16 00:18:37.000000000 -0500
+++ linux-2.6/arch/ppc/mm/4xx_mmu.c	2004-08-11 08:25:11.000000000 -0500
@@ -52,6 +52,7 @@
 #include <asm/setup.h>
 #include "mmu_decl.h"
 
+extern int __map_without_ltlbs;
 /*
  * MMU_init_hw does the chip-specific initialization of the MMU hardware.
  */
@@ -102,6 +103,10 @@
 	p = PPC_MEMSTART;
 	s = 0;
 
+	if (__map_without_ltlbs) {
+		return s;
+	}
+
 	while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) {
 		pmd_t *pmdp;
 		unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
diff -Naur -x '*.swp' linux-2.6.orig/arch/ppc/mm/init.c linux-2.6/arch/ppc/mm/init.c
--- linux-2.6.orig/arch/ppc/mm/init.c	2004-08-11 08:03:55.000000000 -0500
+++ linux-2.6/arch/ppc/mm/init.c	2004-08-11 08:11:24.000000000 -0500
@@ -104,6 +104,7 @@
  * -- Cort
  */
 int __map_without_bats;
+int __map_without_ltlbs;
 
 /* max amount of RAM to use */
 unsigned long __max_memory;
@@ -204,6 +205,10 @@
 		__map_without_bats = 1;
 	}
 
+	if (strstr(cmd_line, "noltlbs")) {
+		__map_without_ltlbs = 1;
+	}
+
 	/* Look for mem= option on command line */
 	if (strstr(cmd_line, "mem=")) {
 		char *p, *q;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-15 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-11 17:52 [PATCH][PPC32] Make PPC40x large tlb mapping optional Matt Porter
2004-08-15 21:23 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome