lkml.org 
[lkml]   [2004]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][PPC32] 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.

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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.078 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site