summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc
diff options
context:
space:
mode:
authorkchow <none@none>2007-10-28 10:20:15 -0700
committerkchow <none@none>2007-10-28 10:20:15 -0700
commit02bc52be7430b2f7fafe1a2c981bff49ef11d6fa (patch)
tree14721ff92a74ba4be3174a552670ce7850c47633 /usr/src/lib/libc
parentf0ed2251df2f0c744e0d198d9b79ae5ed937de7b (diff)
downloadillumos-gate-02bc52be7430b2f7fafe1a2c981bff49ef11d6fa.tar.gz
6453272 ctfmerge uses the largest pagesize from getpagesizes() which can be bad on systems with giant pages
6543997 divide by 0 panic in page_geti_contig_pages during 1g page testing 6587615 1g pagesize support on AMD family 0x10 processors 6588824 throttling large page coalescing needs to be revisited for gigantic pages 6613824 legacy applications (java) should be prevented from inadvertantly using 1g pagesize --HG-- rename : usr/src/lib/libc/common/sys/getpagesizes.s => deleted_files/usr/src/lib/libc/common/sys/getpagesizes.s
Diffstat (limited to 'usr/src/lib/libc')
-rw-r--r--usr/src/lib/libc/amd64/Makefile2
-rw-r--r--usr/src/lib/libc/common/sys/getpagesizes.s45
-rw-r--r--usr/src/lib/libc/i386/Makefile.com2
-rw-r--r--usr/src/lib/libc/inc/synonyms.h1
-rw-r--r--usr/src/lib/libc/port/mapfile-vers3
-rw-r--r--usr/src/lib/libc/port/sys/getpagesizes.c60
-rw-r--r--usr/src/lib/libc/sparc/Makefile2
-rw-r--r--usr/src/lib/libc/sparcv9/Makefile2
8 files changed, 68 insertions, 49 deletions
diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile
index 0539645b34..646d7f06c0 100644
--- a/usr/src/lib/libc/amd64/Makefile
+++ b/usr/src/lib/libc/amd64/Makefile
@@ -206,7 +206,6 @@ COMSYSOBJS= \
gethrtime.o \
getitimer.o \
getmsg.o \
- getpagesizes.o \
getpid.o \
getpmsg.o \
getppid.o \
@@ -798,6 +797,7 @@ PORTSYS= \
fsmisc.o \
fstatat.o \
fsync.o \
+ getpagesizes.o \
getpeerucred.o \
inst_sync.o \
issetugid.o \
diff --git a/usr/src/lib/libc/common/sys/getpagesizes.s b/usr/src/lib/libc/common/sys/getpagesizes.s
deleted file mode 100644
index d70cede69d..0000000000
--- a/usr/src/lib/libc/common/sys/getpagesizes.s
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
-.ident "%Z%%M% %I% %E% SMI"
-
-/* C library -- getpagesizes */
-/* uint_t getpagesizes(size_t buf[], uint_t nelem) */
-
- .file "getpagesizes.s"
-
-#include <sys/asm_linkage.h>
-
- ANSI_PRAGMA_WEAK(getpagesizes,function)
-
-#include "SYS.h"
-
- SYSCALL(getpagesizes)
- RET
- SET_SIZE(getpagesizes)
diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com
index 5fb4ffea84..5e07b84f54 100644
--- a/usr/src/lib/libc/i386/Makefile.com
+++ b/usr/src/lib/libc/i386/Makefile.com
@@ -231,7 +231,6 @@ COMSYSOBJS= \
gethrtime.o \
getitimer.o \
getmsg.o \
- getpagesizes.o \
getpid.o \
getpmsg.o \
getppid.o \
@@ -838,6 +837,7 @@ PORTSYS= \
fsmisc.o \
fstatat.o \
fsync.o \
+ getpagesizes.o \
getpeerucred.o \
inst_sync.o \
issetugid.o \
diff --git a/usr/src/lib/libc/inc/synonyms.h b/usr/src/lib/libc/inc/synonyms.h
index 4b4ce263f0..e7e69a3ce7 100644
--- a/usr/src/lib/libc/inc/synonyms.h
+++ b/usr/src/lib/libc/inc/synonyms.h
@@ -419,6 +419,7 @@ extern "C" {
#define getopt_long _getopt_long
#define getopt_long_only _getopt_long_only
#define getpagesizes _getpagesizes
+#define getpagesizes2 _getpagesizes2
#define getpass _getpass
#define getpassphrase _getpassphrase
#define getpeerucred _getpeerucred
diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers
index 717c4d9186..8444970351 100644
--- a/usr/src/lib/libc/port/mapfile-vers
+++ b/usr/src/lib/libc/port/mapfile-vers
@@ -69,6 +69,8 @@ SUNW_1.23 { # SunOS 5.11 (Solaris 11)
forkx;
fsetattr;
getattrat;
+ getpagesizes2;
+ _getpagesizes2;
htonl;
htons;
lio_listio;
@@ -515,6 +517,7 @@ SUNW_1.21 { # SunOS 5.9 (Solaris 9)
gethomelgroup;
_gethomelgroup = NODYNSORT;
getpagesizes;
+ _getpagesizes;
getrctl;
_getrctl;
issetugid;
diff --git a/usr/src/lib/libc/port/sys/getpagesizes.c b/usr/src/lib/libc/port/sys/getpagesizes.c
new file mode 100644
index 0000000000..86c5944fd9
--- /dev/null
+++ b/usr/src/lib/libc/port/sys/getpagesizes.c
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma weak getpagesizes = _getpagesizes
+#pragma weak getpagesizes2 = _getpagesizes2
+
+#include "synonyms.h"
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+/*
+ * mman.h contains "#pragma redefine_extname getpagesizes getpagesizes2".
+ * Applications that are still calling getpagesizes() instead of
+ * getpagesizes2() are 'legacy' applications that have not been recompiled
+ * since the #pragma redefine_extname change.
+ *
+ * Depending on the platform, 'legacy' applications may not be given the full
+ * set of supported page sizes to prevent them from inadvertantly using 'new'
+ * large pagesizes that might cause application failure or low system memory
+ * conditions.
+ *
+ * The first parameter to the SYS_getpagesizes syscall is effectively
+ * a 'legacy' boolean flag used as such in the kernel.
+ */
+int
+getpagesizes(size_t pagesize[], int nelem)
+{
+ return (syscall(SYS_getpagesizes, 1, pagesize, nelem));
+}
+
+int
+getpagesizes2(size_t pagesize[], int nelem)
+{
+ return (syscall(SYS_getpagesizes, 0, pagesize, nelem));
+}
diff --git a/usr/src/lib/libc/sparc/Makefile b/usr/src/lib/libc/sparc/Makefile
index 37e0818dc6..2089d2920a 100644
--- a/usr/src/lib/libc/sparc/Makefile
+++ b/usr/src/lib/libc/sparc/Makefile
@@ -248,7 +248,6 @@ COMSYSOBJS= \
gethrtime.o \
getitimer.o \
getmsg.o \
- getpagesizes.o \
getpid.o \
getpmsg.o \
getppid.o \
@@ -864,6 +863,7 @@ PORTSYS= \
fsmisc.o \
fstatat.o \
fsync.o \
+ getpagesizes.o \
getpeerucred.o \
inst_sync.o \
issetugid.o \
diff --git a/usr/src/lib/libc/sparcv9/Makefile b/usr/src/lib/libc/sparcv9/Makefile
index c837e39361..e71aef0883 100644
--- a/usr/src/lib/libc/sparcv9/Makefile
+++ b/usr/src/lib/libc/sparcv9/Makefile
@@ -231,7 +231,6 @@ COMSYSOBJS= \
gethrtime.o \
getitimer.o \
getmsg.o \
- getpagesizes.o \
getpid.o \
getpmsg.o \
getppid.o \
@@ -809,6 +808,7 @@ PORTSYS= \
fsmisc.o \
fstatat.o \
fsync.o \
+ getpagesizes.o \
getpeerucred.o \
inst_sync.o \
issetugid.o \