Module Name:    src
Committed By:   martin
Date:           Sun Nov 15 20:35:34 UTC 2015

Modified Files:
        src/sys/arch/sparc64/include: vmparam.h

Log Message:
PR 32999: adjust VM parameters for 64 bit kernel/userlands.
Limit old binaries (i.e. processes not using topdown VA layout) to 2 GB
data size.
Use the same limits as native sparc for netbsd32 emulation - we need to
revisit this, but currently automatic test runs in this environment
fail big time, so there is no easy way to verify any changes.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sparc64/include/vmparam.h

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/sparc64/include/vmparam.h
diff -u src/sys/arch/sparc64/include/vmparam.h:1.34 src/sys/arch/sparc64/include/vmparam.h:1.35
--- src/sys/arch/sparc64/include/vmparam.h:1.34	Mon Apr 14 10:54:08 2014
+++ src/sys/arch/sparc64/include/vmparam.h	Sun Nov 15 20:35:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.34 2014/04/14 10:54:08 martin Exp $ */
+/*	$NetBSD: vmparam.h,v 1.35 2015/11/15 20:35:33 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -78,8 +78,7 @@
 /*
  * Virtual memory related constants, all in bytes
  */
-/* #ifdef __arch64__ */
-#if 0
+#if __arch64__
 /*
  * 64-bit limits:
  *
@@ -90,64 +89,69 @@
  * of that for data and the other half for stack.
  */
 #ifndef MAXTSIZ
-#define	MAXTSIZ		(4L*1024*1024*1024)	/* max text size */
+#define	MAXTSIZ		(4UL*1024*1024*1024)	/* max text size */
 #endif
 #ifndef DFLDSIZ
-#define	DFLDSIZ		(128L*1024*1024)	/* initial data size limit */
+#define	DFLDSIZ		(128UL*1024*1024)	/* initial data size limit */
 #endif
 #ifndef MAXDSIZ
-#define	MAXDSIZ		(1L<<39)		/* max data size */
+#define	MAXDSIZ		(1UL<<39)		/* max data size */
+/*
+ * For processes not using topdown VA, we need to limit the data size -
+ * they probably have not been compiled with the proper compiler memory
+ * model.
+ */
+#define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \
+    round_page((vaddr_t)(da) + (vsize_t)max(maxdmap,2UL*1024*1024*1024))
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
 #endif
 #ifndef	MAXSSIZ
-#define	MAXSSIZ		MAXDSIZ			/* max stack size */
+#define	MAXSSIZ		(128*1024*1024)		/* max stack size */
 #endif
 #else
 /*
  * 32-bit limits:
  *
- * We only have 4GB to play with.  Limit stack, data, and text
- * each to half of that.
+ * We only have 4GB to play with.  Limit data, and text
+ * each to half of that and set a reasonable stack limit.
  *
- * This is silly.  Apparently if we go above these numbers
- * integer overflows in other parts of the kernel cause hangs.
  */
 #ifndef MAXTSIZ
-#define	MAXTSIZ		(1*1024*1024*1024)	/* max text size */
+#define	MAXTSIZ		(2UL*1024*1024*1024)	/* max text size */
 #endif
 #ifndef DFLDSIZ
 #define	DFLDSIZ		(128*1024*1024)		/* initial data size limit */
 #endif
 #ifndef MAXDSIZ
-#define	MAXDSIZ		(1*1024*1024*1024)	/* max data size */
+#define	MAXDSIZ		(2UL*1024*1024*1024)	/* max data size */
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
 #endif
 #ifndef	MAXSSIZ
-#define	MAXSSIZ		(8*1024*1024)			/* max stack size */
+#define	MAXSSIZ		(64*1024*1024)		/* max stack size */
 #endif
 #endif
 
 /*
- * 32-bit emulation limits.
+ * 32-bit emulation limits (same as sparc - we could go bigger)
  */
 #ifndef MAXTSIZ32
-#define	MAXTSIZ32	(1*1024*1024*1024)	/* max text size */
+#define	MAXTSIZ32	(64*1024*1024)		/* max text size */
 #endif
 #ifndef DFLDSIZ32
-#define	DFLDSIZ32	(128*1024*1024)		/* initial data size limit */
+#define	DFLDSIZ32	(64*1024*1024)		/* initial data size limit */
 #endif
 #ifndef MAXDSIZ32
-#define	MAXDSIZ32	(1*1024*1024*1024)	/* max data size */
+#define	MAXDSIZ32	(512*1024*1024)		/* max data size */
 #endif
 #ifndef	DFLSSIZ32
 #define	DFLSSIZ32	(2*1024*1024)		/* initial stack size limit */
 #endif
 #ifndef	MAXSSIZ32
-#define	MAXSSIZ32	(8*1024*1024)			/* max stack size */
+#define	MAXSSIZ32	(32*1024*1024)		/* max stack size */
 #endif
 
 /*

Reply via email to