Sat Aug 27 16:54:14 2011 UTC ()
There are non-writable bits in MIPS_COP_0_TLB_HI between ASID and VPN, so
mips3_cp0_tlb_entry_hi_probe() returns a value with some 0 in the low 12 bits.
Thus the computed mips_vm_maxuser_address is wrong. Fix by oring PAGE_MASK to
return value of mips3_cp0_tlb_entry_hi_probe().


(bouyer)
diff -r1.247 -r1.248 src/sys/arch/mips/mips/mips_machdep.c

cvs diff -r1.247 -r1.248 src/sys/arch/mips/mips/mips_machdep.c (expand / switch to context diff)
--- src/sys/arch/mips/mips/mips_machdep.c 2011/08/24 16:01:53 1.247
+++ src/sys/arch/mips/mips/mips_machdep.c 2011/08/27 16:54:14 1.248
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.247 2011/08/24 16:01:53 matt Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.248 2011/08/27 16:54:14 bouyer Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.247 2011/08/24 16:01:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.248 2011/08/27 16:54:14 bouyer Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -1358,6 +1358,7 @@
 	opts->mips3_tlb_pg_mask = mips3_cp0_tlb_page_mask_probe();
 	if (CPUIS64BITS) {
 		opts->mips3_tlb_vpn_mask = mips3_cp0_tlb_entry_hi_probe();
+		opts->mips3_tlb_vpn_mask |= PAGE_MASK;
 		opts->mips3_tlb_vpn_mask <<= 2;
 		opts->mips3_tlb_vpn_mask >>= 2;
 		opts->mips3_tlb_pfn_mask = mips3_cp0_tlb_entry_lo_probe();