Module Name:    src
Committed By:   tsutsui
Date:           Sun Jan  2 06:15:04 UTC 2011

Modified Files:
        src/sys/arch/mvme68k/include: vmparam.h
        src/sys/arch/mvme68k/mvme68k: pmap_bootstrap.c

Log Message:
Remove "last kernel PT page" stuff derived from hp300 where PA != VA.

Compile test only, but same changes as other PA == VA m68k ports like
luna68k, news68k, and x68k used for a decade.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mvme68k/include/vmparam.h
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mvme68k/include/vmparam.h
diff -u src/sys/arch/mvme68k/include/vmparam.h:1.32 src/sys/arch/mvme68k/include/vmparam.h:1.33
--- src/sys/arch/mvme68k/include/vmparam.h:1.32	Sat Nov  6 15:42:47 2010
+++ src/sys/arch/mvme68k/include/vmparam.h	Sun Jan  2 06:15:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.32 2010/11/06 15:42:47 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.33 2011/01/02 06:15:04 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -147,7 +147,7 @@
 #define VM_MAXUSER_ADDRESS	((vaddr_t)0xFFF00000)
 #define VM_MAX_ADDRESS		((vaddr_t)0xFFF00000)
 #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)0)
-#define VM_MAX_KERNEL_ADDRESS	((vaddr_t)(0-PAGE_SIZE*NPTEPG*2))
+#define VM_MAX_KERNEL_ADDRESS	((vaddr_t)(0-PAGE_SIZE*NPTEPG))
 
 /* virtual sizes (bytes) for various kernel submaps */
 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)

Index: src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c
diff -u src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.44 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.45
--- src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.44	Sat Dec 25 16:14:44 2010
+++ src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c	Sun Jan  2 06:15:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.44 2010/12/25 16:14:44 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.45 2011/01/02 06:15:04 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #include "opt_m68k_arch.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.44 2010/12/25 16:14:44 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.45 2011/01/02 06:15:04 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/kcore.h>
@@ -89,7 +89,7 @@
 void
 pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
 {
-	paddr_t kstpa, kptpa, kptmpa, lkptpa, lwp0upa;
+	paddr_t kstpa, kptpa, kptmpa, lwp0upa;
 	u_int nptpages, kstsize;
 	st_entry_t protoste, *ste, *este;
 	pt_entry_t protopte, *pte, *epte;
@@ -110,8 +110,6 @@
 	 *
 	 *	kptmpa		kernel PT map		1 page
 	 *
-	 *	lkptpa		last kernel PT page	1 page
-	 *
 	 *	kptpa		statically allocated
 	 *			kernel PT pages		Sysptsize+ pages
 	 *
@@ -138,8 +136,6 @@
 	nextpa += kstsize * PAGE_SIZE;
 	kptmpa = nextpa;
 	nextpa += PAGE_SIZE;
-	lkptpa = nextpa;
-	nextpa += PAGE_SIZE;
 	kptpa = nextpa;
 	nptpages = RELOC(Sysptsize, int) + (iiomappages + NPTEPG - 1) / NPTEPG;
 	nextpa += nptpages * PAGE_SIZE;
@@ -164,18 +160,8 @@
 	 * each mapping 256kb.  Note that there may be additional "segment
 	 * table" pages depending on how large MAXKL2SIZE is.
 	 *
-	 * Portions of the last two segment of KVA space (0xFF800000 -
-	 * 0xFFFFFFFF) are mapped for a couple of purposes.
-	 * The first segment (0xFF800000 - 0xFFBFFFFF) is mapped
-	 * for the kernel page tables.
-	 *
-	 * XXX: It looks this was copied from hp300 and not sure if
-	 * XXX: last physical page mapping is really needed on this port.
-	 * The very last page (0xFFFFF000) in the second segment is mapped
-	 * to the last physical page of RAM to give us a region in which
-	 * PA == VA.  We use the first part of this page for enabling
-	 * and disabling mapping.  The last part of this page also contains
-	 * info left by the boot ROM.
+	 * Portions of the last segment of KVA space (0xFFC00000 -
+	 * 0xFFFFFFFF) are mapped for the kernel page tables.
 	 *
 	 * XXX cramming two levels of mapping into the single "segment"
 	 * table on the 68040 is intended as a temporary hack to get things
@@ -233,23 +219,17 @@
 		*ste = protoste;
 		/*
 		 * Now initialize the final portion of that block of
-		 * descriptors to map kptmpa and the "last PT page".
+		 * descriptors to map Sysmap.
 		 */
 		i = SG4_LEV1SIZE + (nl1desc * SG4_LEV2SIZE);
 		ste = (st_entry_t *)kstpa;
-		ste = &ste[i + SG4_LEV2SIZE - (NPTEPG / SG4_LEV3SIZE) * 2];
+		ste = &ste[i + SG4_LEV2SIZE - (NPTEPG / SG4_LEV3SIZE)];
 		este = &ste[NPTEPG / SG4_LEV3SIZE];
 		protoste = kptmpa | SG_U | SG_RW | SG_V;
 		while (ste < este) {
 			*ste++ = protoste;
 			protoste += (SG4_LEV3SIZE * sizeof(st_entry_t));
 		}
-		este = &ste[NPTEPG / SG4_LEV3SIZE];
-		protoste = lkptpa | SG_U | SG_RW | SG_V;
-		while (ste < este) {
-			*ste++ = protoste;
-			protoste += (SG4_LEV3SIZE * sizeof(st_entry_t));
-		}
 		/*
 		 * Calculate the free level 2 descriptor mask
 		 * noting that we have used:
@@ -287,14 +267,11 @@
 			*pte++ = PG_NV;
 		}
 		/*
-		 * Initialize the last ones to point to kptmpa and the page
-		 * table page allocated earlier.
+		 * Initialize the last one to point to Sysptmap.
 		 */
 		pte = (pt_entry_t *)kptmpa;
 		pte = &pte[SYSMAP_VA >> SEGSHIFT];
 		*pte = kptmpa | PG_RW | PG_CI | PG_V;
-		pte++;		/* XXX should use [MAXADDR >> SEGSHIFT] */
-		*pte = lkptpa | PG_RW | PG_CI | PG_U | PG_V;
 	} else
 #endif /* M68040 || M68060 */
 	{
@@ -325,8 +302,7 @@
 		while (pte < epte)
 			*pte++ = PG_NV;
 		/*
-		 * Initialize the last ones to point to Sysptmap and the page
-		 * table page allocated earlier.
+		 * Initialize the last one to point to Sysptmap.
 		 */
 		ste = (st_entry_t *)kstpa;
 		ste = &ste[SYSMAP_VA >> SEGSHIFT];
@@ -334,23 +310,7 @@
 		pte = &pte[SYSMAP_VA >> SEGSHIFT];
 		*ste = kptmpa | SG_RW | SG_V;
 		*pte = kptmpa | PG_RW | PG_CI | PG_V;
-		ste++;		/* XXX should use [MAXADDR >> SEGSHIFT] */
-		pte++;		/* XXX should use [MAXADDR >> SEGSHIFT] */
-		*ste = lkptpa | SG_RW | SG_V;
-		*pte = lkptpa | PG_RW | PG_CI | PG_V;
 	}
-	/*
-	 * Invalidate all but the final entry in the last kernel PT page.
-	 * The final entry maps the last page of physical memory to
-	 * prepare a page that is PA == VA to turn on the MMU.
-	 *
-	 * XXX: This looks copied from hp300 where PA != VA, but
-	 * XXX: it's suspicious if this is also required on this port.
-	 */
-	pte = (pt_entry_t *)lkptpa;
-	epte = &pte[NPTEPG - 1];
-	while (pte < epte)
-		*pte++ = PG_NV;
 
 	/*
 	 * Initialize kernel page table.

Reply via email to