Print this page
11787 Kernel needs to be built with retpolines
11788 Kernel needs to generally use RSB stuffing
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: John Levon <john.levon@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/ml/fast_trap_asm.s
          +++ new/usr/src/uts/i86pc/ml/fast_trap_asm.s
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2019 Joyent, Inc.
  24   25   */
  25   26  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   27  #include <sys/asm_linkage.h>
  29   28  #include <sys/asm_misc.h>
  30   29  #include <sys/regset.h>
  31   30  #include <sys/psw.h>
  32   31  
  33   32  #if defined(__lint)
  34   33  
  35   34  #include <sys/types.h>
  36   35  #include <sys/thread.h>
  37   36  #include <sys/systm.h>
↓ open down ↓ 56 lines elided ↑ open up ↑
  94   93   * 32 bits of %rax, we don't zero them out in %rax.
  95   94   * The following amd64 versions will need to be changed if the above
  96   95   * assumptions are not true.
  97   96   */
  98   97  
  99   98  #if defined(__amd64)
 100   99  
 101  100          .globl  gethrtimef
 102  101          ENTRY_NP(get_hrtime)
 103  102          FAST_INTR_PUSH
 104      -        call    *gethrtimef(%rip)
      103 +        movq    gethrtimef(%rip), %rax
      104 +        INDIRECT_CALL_REG(rax)
 105  105          movq    %rax, %rdx
 106  106          shrq    $32, %rdx                       /* high 32-bit in %edx */
 107  107          FAST_INTR_POP
 108  108          FAST_INTR_RETURN
 109  109          SET_SIZE(get_hrtime)
 110  110  
 111  111  #elif defined(__i386)
 112  112  
 113  113          .globl  gethrtimef
 114  114          ENTRY_NP(get_hrtime)
↓ open down ↓ 5 lines elided ↑ open up ↑
 120  120  
 121  121  #endif  /* __i386 */
 122  122  
 123  123  #if defined(__amd64)
 124  124  
 125  125          .globl  gethrestimef
 126  126          ENTRY_NP(get_hrestime)
 127  127          FAST_INTR_PUSH
 128  128          subq    $TIMESPEC_SIZE, %rsp
 129  129          movq    %rsp, %rdi
 130      -        call    *gethrestimef(%rip)
      130 +        movq    gethrestimef(%rip), %rax
      131 +        INDIRECT_CALL_REG(rax)
 131  132          movl    (%rsp), %eax
 132  133          movl    CLONGSIZE(%rsp), %edx
 133  134          addq    $TIMESPEC_SIZE, %rsp
 134  135          FAST_INTR_POP
 135  136          FAST_INTR_RETURN
 136  137          SET_SIZE(get_hrestime)
 137  138  
 138  139  #elif defined(__i386)
 139  140  
 140  141          .globl  gethrestimef
↓ open down ↓ 87 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX