summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/exec
diff options
context:
space:
mode:
authorPatrick Mooney <pmooney@pfmooney.com>2016-05-16 20:49:35 +0000
committerPatrick Mooney <pmooney@pfmooney.com>2016-05-16 20:49:35 +0000
commitd19cb1300ec66e8552d605a713e7b6dd6ba255f5 (patch)
treea3bbb3f8d5bcee582c50fbf4f5ef425fd9a8ed2d /usr/src/uts/common/exec
parenta257e301376666442c2b655cf573c9d3e34b1ed5 (diff)
downloadillumos-joyent-d19cb1300ec66e8552d605a713e7b6dd6ba255f5.tar.gz
OS-5192 need faster clock_gettime
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Joshua M. Clulow <jmc@joyent.com> Reviewed by: Ryan Zezeski <ryan@zinascii.com>
Diffstat (limited to 'usr/src/uts/common/exec')
-rw-r--r--usr/src/uts/common/exec/elf/elf.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/usr/src/uts/common/exec/elf/elf.c b/usr/src/uts/common/exec/elf/elf.c
index f1b4473260..14f309a0c3 100644
--- a/usr/src/uts/common/exec/elf/elf.c
+++ b/usr/src/uts/common/exec/elf/elf.c
@@ -26,7 +26,7 @@
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
- * Copyright (c) 2016, Joyent, Inc. All rights reserved.
+ * Copyright 2016 Joyent, Inc.
*/
#include <sys/types.h>
@@ -66,6 +66,11 @@
#include <sys/sdt.h>
#include <sys/siginfo.h>
+#if defined(__x86) && !defined(__xpv)
+#include <sys/comm_page.h>
+#endif /* defined(__x86) && !defined(__xpv) */
+
+
extern int at_flags;
#define ORIGIN_STR "ORIGIN"
@@ -580,6 +585,15 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
args->auxsize += sizeof (aux_entry_t);
}
+
+ /*
+ * On supported kernels (64-bit, non-xpv) make room in the auxv for the
+ * AT_SUN_COMMPAGE entry.
+ */
+#if defined(__amd64) && !defined(__xpv)
+ args->auxsize += sizeof (aux_entry_t);
+#endif /* defined(__amd64) && !defined(__xpv) */
+
/*
* If we have user credentials, we'll supply the following entries:
* AT_SUN_UID
@@ -859,6 +873,7 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
if (hasauxv) {
int auxf = AF_SUN_HWCAPVERIFY;
+
/*
* Note: AT_SUN_PLATFORM, AT_SUN_EXECNAME and AT_RANDOM were
* filled in via exec_args()
@@ -946,6 +961,16 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
ADDAUX(aux, AT_SUN_BRAND_AUX4, 0)
}
+ /*
+ * Add the comm page auxv entry, mapping it in if needed.
+ */
+#if defined(__amd64) && !defined(__xpv)
+ if (args->commpage != NULL ||
+ (args->commpage = (uintptr_t)comm_page_mapin()) != NULL) {
+ ADDAUX(aux, AT_SUN_COMMPAGE, args->commpage)
+ }
+#endif /* defined(__amd64) && !defined(__xpv) */
+
ADDAUX(aux, AT_NULL, 0)
postfixsize = (char *)aux - (char *)bigwad->elfargs;
@@ -985,6 +1010,7 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
}
bzero(up->u_auxv, sizeof (up->u_auxv));
+ up->u_commpagep = args->commpage;
if (postfixsize) {
int num_auxv;