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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/exec/elf/elf_notes.c
          +++ new/usr/src/uts/common/exec/elf/elf_notes.c
↓ open down ↓ 20 lines elided ↑ open up ↑
  21   21   */
  22   22  /*
  23   23   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  /*
  28   28   * Copyright 2012 DEY Storage Systems, Inc.  All rights reserved.
  29   29   * Copyright 2018 Joyent, Inc.
  30   30   * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  31      - * Copyright 2022 Oxide Computer Company
       31 + * Copyright 2023 Oxide Computer Company
  32   32   */
  33   33  
  34   34  #include <sys/types.h>
  35   35  #include <sys/param.h>
  36   36  #include <sys/thread.h>
  37   37  #include <sys/sysmacros.h>
  38   38  #include <sys/signal.h>
  39   39  #include <sys/cred.h>
  40   40  #include <sys/priv.h>
  41   41  #include <sys/user.h>
↓ open down ↓ 89 lines elided ↑ open up ↑
 131  131  
 132  132  
 133  133  #if defined(__i386_COMPAT)
 134  134          mutex_enter(&p->p_ldtlock);
 135  135          size = prnldt(p) * sizeof (struct ssd);
 136  136          mutex_exit(&p->p_ldtlock);
 137  137          if (size != 0)
 138  138                  v[0].p_filesz += sizeof (Note) + roundup(size, sizeof (Word));
 139  139  #endif  /* __i386_COMPAT */
 140  140  
 141      -        if ((size = prhasx(p)? prgetprxregsize(p) : 0) != 0)
      141 +        if ((size = prhasx(p) ? prgetprxregsize(p) : 0) != 0)
 142  142                  v[0].p_filesz += nlwp * sizeof (Note)
 143  143                      + nlwp * roundup(size, sizeof (Word));
 144  144  
 145  145  #if defined(__sparc)
 146  146          /*
 147  147           * Figure out the number and sizes of register windows.
 148  148           */
 149  149          {
 150  150                  kthread_t *t = p->p_tlist;
 151  151                  do {
↓ open down ↓ 38 lines elided ↑ open up ↑
 190  190                  char            xregs[1];
 191  191                  aux_entry_t     auxv[__KERN_NAUXV_IMPL];
 192  192                  prcred_t        pcred;
 193  193                  prpriv_t        ppriv;
 194  194                  priv_impl_info_t prinfo;
 195  195                  struct utsname  uts;
 196  196                  prsecflags_t    psecflags;
 197  197                  prupanic_t      upanic;
 198  198          } *bigwad;
 199  199  
 200      -        size_t xregsize = prhasx(p)? prgetprxregsize(p) : 0;
      200 +        size_t xregsize = prhasx(p) ? prgetprxregsize(p) : 0;
 201  201          size_t crsize = sizeof (prcred_t) + sizeof (gid_t) * (ngroups_max - 1);
 202  202          size_t psize = prgetprivsize();
 203  203          size_t bigsize = MAX(psize, MAX(sizeof (*bigwad),
 204  204              MAX(xregsize, crsize)));
 205  205  
 206  206          priv_impl_info_t *prii;
 207  207  
 208  208          lwpdir_t *ldp;
 209  209          lwpent_t *lep;
 210  210          kthread_t *t;
↓ open down ↓ 356 lines elided ↑ open up ↑
 567  567                          prgetasregs(lwp, bigwad->asrset);
 568  568                          error = elfnote(vp, &offset, NT_ASRS,
 569  569                              sizeof (asrset_t), (caddr_t)bigwad->asrset,
 570  570                              rlimit, credp);
 571  571                          if (error)
 572  572                                  goto done;
 573  573                  }
 574  574  #endif /* __sparc */
 575  575  
 576  576                  if (xregsize) {
 577      -                        prgetprxregs(lwp, bigwad->xregs);
      577 +                        prgetprxregs(lwp, (prxregset_t *)bigwad->xregs);
 578  578                          error = elfnote(vp, &offset, NT_PRXREG,
 579  579                              xregsize, bigwad->xregs, rlimit, credp);
 580  580                          if (error)
 581  581                                  goto done;
 582  582                  }
 583  583  
 584  584                  if (t->t_lwp->lwp_spymaster != NULL) {
 585  585                          void *psaddr = t->t_lwp->lwp_spymaster;
 586  586  #ifdef _ELF32_COMPAT
 587  587                          /*
↓ open down ↓ 58 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX