Skip to contentSkip to conversation

Make PPC40x large tlb mapping optional

PATCH In review Matt Porter 2 participants 2 messages Aug 11, 2004 – Aug 15, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make PPC40x large tlb mapping optional

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.

arch/ppc/mm/4xx_mmu.c +5 -0
diff -Naur -x '*.swp' linux-2.6.orig/arch/ppc/mm/4xx_mmu.c linux-2.6/arch/ppc/mm/4xx_mmu.c
@@ -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;
arch/ppc/mm/init.c +5 -0
diff -Naur -x '*.swp' linux-2.6.orig/arch/ppc/mm/init.c linux-2.6/arch/ppc/mm/init.c
@@ -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;
#1 lore raw
Quoted 3 lines · Matt Porter

This makes the PPC40x lowmem large tlb mapping selectable via
a cmdline option.

Please send a separate update to Documentation/kernel-parameters.txt.