Print this page
15254 %ymm registers not restored after signal handler
15367 x86 getfpregs() summons corrupting %xmm ghosts
15333 want x86 /proc xregs support (libc_db, libproc, mdb, etc.)
15336 want libc functions for extended ucontext_t
15334 want ps_lwphandle-specific reg routines
15328 FPU_CW_INIT mistreats reserved bit
15335 i86pc fpu_subr.c isn't really platform-specific
15332 setcontext(2) isn't actually noreturn
15331 need <sys/stdalign.h>
Change-Id: I7060aa86042dfb989f77fc3323c065ea2eafa9ad
Conflicts:
    usr/src/uts/common/fs/proc/prcontrol.c
    usr/src/uts/intel/os/archdep.c
    usr/src/uts/intel/sys/ucontext.h
    usr/src/uts/intel/syscall/getcontext.c
        
@@ -26,26 +26,38 @@
 
 /*      Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
 /*      Copyright (c) 1988 AT&T */
 /*        All Rights Reserved   */
 
+/*
+ * Copyright 2023 Oxide Computer Company
+ */
+
 #include "lint.h"
 #include <sys/types.h>
 #include <sys/ucontext.h>
 #include <setjmp.h>
 #include <ucontext.h>
+#include <strings.h>
+#include <upanic.h>
 #include "libc.h"
 
 #pragma weak _siglongjmp = siglongjmp
 
 void
 siglongjmp(sigjmp_buf env, int val)
 {
+        const char *msg = "siglongjmp(): setcontext() returned";
         ucontext_t *ucp = (ucontext_t *)env;
 
         if (val)
                 ucp->uc_mcontext.gregs[EAX] = val;
         else
                 ucp->uc_mcontext.gregs[EAX] = 1;
 
+        /*
+         * While unlikely, it is possible that setcontext() may fail for some
+         * reason. If that happens, we will kill the process.
+         */
         (void) setcontext(ucp);
+        upanic(msg, strlen(msg) + 1);
 }