summaryrefslogtreecommitdiff
path: root/usr/src/uts/intel/ia32/os/sundep.c
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2021-07-01 13:27:16 -0400
committerGitHub <noreply@github.com>2021-07-01 13:27:16 -0400
commit1fef3b89560b821bfc30ca13f87ed2c0d876ee17 (patch)
treeac9d8ca9247cf806d445001c5f382ff4eb4d5ce3 /usr/src/uts/intel/ia32/os/sundep.c
parent0402a6962cad4cc9a83682bb49b6496264a913c3 (diff)
downloadillumos-joyent-release-20210701.tar.gz
OS-8288 Pull in 13902 and 13915 early (#370)release-20210701
Portions contributed by: Jerry Jelinek <gjelinek@gmail.com>
Diffstat (limited to 'usr/src/uts/intel/ia32/os/sundep.c')
-rw-r--r--usr/src/uts/intel/ia32/os/sundep.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/usr/src/uts/intel/ia32/os/sundep.c b/usr/src/uts/intel/ia32/os/sundep.c
index 34e0a03d68..8a5562f4ad 100644
--- a/usr/src/uts/intel/ia32/os/sundep.c
+++ b/usr/src/uts/intel/ia32/os/sundep.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2021 Joyent, Inc.
*/
/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
@@ -763,7 +763,7 @@ lwp_attach_brand_hdlrs(klwp_t *lwp)
brand_interpositioning_disable, NULL) == 0);
installctx(t, NULL, brand_interpositioning_disable,
brand_interpositioning_enable, NULL, NULL,
- brand_interpositioning_disable, NULL);
+ brand_interpositioning_disable, NULL, NULL);
if (t == curthread) {
kpreempt_disable();
@@ -829,6 +829,7 @@ lwp_installctx(klwp_t *lwp)
#else
void (*restop)(klwp_t *) = lwp_segregs_restore;
#endif
+ struct ctxop *ctx;
/*
* Install the basic lwp context handlers on each lwp.
@@ -844,10 +845,14 @@ lwp_installctx(klwp_t *lwp)
*/
ASSERT(removectx(t, lwp, lwp_segregs_save, restop,
NULL, NULL, NULL, NULL) == 0);
- if (thisthread)
+ if (thisthread) {
+ ctx = installctx_preallocate();
kpreempt_disable();
+ } else {
+ ctx = NULL;
+ }
installctx(t, lwp, lwp_segregs_save, restop,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, ctx);
if (thisthread) {
/*
* Since we're the right thread, set the values in the GDT
@@ -874,10 +879,14 @@ lwp_installctx(klwp_t *lwp)
ASSERT(removectx(t, kstktop,
sep_save, sep_restore, NULL, NULL, NULL, NULL) == 0);
- if (thisthread)
+ if (thisthread) {
+ ctx = installctx_preallocate();
kpreempt_disable();
+ } else {
+ ctx = NULL;
+ }
installctx(t, kstktop,
- sep_save, sep_restore, NULL, NULL, NULL, NULL);
+ sep_save, sep_restore, NULL, NULL, NULL, NULL, ctx);
if (thisthread) {
/*
* We're the right thread, so set the stack pointer