Print this page
10908 Simplify SMAP relocations with krtld

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/ia32/ml/copy.s
          +++ new/usr/src/uts/intel/ia32/ml/copy.s
↓ open down ↓ 28 lines elided ↑ open up ↑
  29   29   */
  30   30  
  31   31  /*       Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.        */
  32   32  /*       Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T          */
  33   33  /*         All Rights Reserved                                          */
  34   34  
  35   35  /*       Copyright (c) 1987, 1988 Microsoft Corporation                 */
  36   36  /*         All Rights Reserved                                          */
  37   37  
  38   38  /*
  39      - * Copyright 2016 Joyent, Inc.
       39 + * Copyright (c) 2017 Joyent, Inc.
  40   40   */
  41   41  
  42   42  #include <sys/errno.h>
  43   43  #include <sys/asm_linkage.h>
  44   44  
  45   45  #if defined(__lint)
  46   46  #include <sys/types.h>
  47   47  #include <sys/systm.h>
  48   48  #else   /* __lint */
  49   49  #include "assym.h"
↓ open down ↓ 3081 lines elided ↑ open up ↑
3131 3131  .copyoutstr_panic_msg:
3132 3132          .string "copyoutstr: kaddr argument not in kernel address space"
3133 3133  .cpyin_ne_pmsg:
3134 3134          .string "copyin_noerr: argument not in kernel address space"
3135 3135  .cpyout_ne_pmsg:
3136 3136          .string "copyout_noerr: argument not in kernel address space"
3137 3137  #endif
3138 3138  
3139 3139  #endif  /* __lint */
3140 3140  
3141      -/*
3142      - * These functions are used for SMAP, supervisor mode access protection. They
3143      - * are hotpatched to become real instructions when the system starts up which is
3144      - * done in mlsetup() as a part of enabling the other CR4 related features.
3145      - *
3146      - * Generally speaking, smap_disable() is a stac instruction and smap_enable is a
3147      - * clac instruction. It's safe to call these any number of times, and in fact,
3148      - * out of paranoia, the kernel will likely call it at several points.
3149      - */
3150      -
3151      -#if defined(__lint)
3152      -
3153      -void
3154      -smap_enable(void)
3155      -{}
3156      -
3157      -void
3158      -smap_disable(void)
3159      -{}
3160      -
3161      -#else
3162      -
3163      -#if defined (__amd64) || defined(__i386)
3164      -        ENTRY(smap_disable)
3165      -        nop
3166      -        nop
3167      -        nop
3168      -        ret
3169      -        SET_SIZE(smap_disable)
3170      -
3171      -        ENTRY(smap_enable)
3172      -        nop
3173      -        nop
3174      -        nop
3175      -        ret
3176      -        SET_SIZE(smap_enable)
3177      -
3178      -#endif /* __amd64 || __i386 */
3179      -
3180      -#endif /* __lint */
3181      -
3182 3141  #ifndef __lint
3183 3142  
3184 3143  .data
3185 3144  .align  4
3186 3145  .globl  _smap_enable_patch_count
3187 3146  .type   _smap_enable_patch_count,@object
3188 3147  .size   _smap_enable_patch_count, 4
3189 3148  _smap_enable_patch_count:
3190 3149          .long   SMAP_ENABLE_COUNT
3191 3150  
3192 3151  .globl  _smap_disable_patch_count
3193 3152  .type   _smap_disable_patch_count,@object
3194 3153  .size   _smap_disable_patch_count, 4
3195 3154  _smap_disable_patch_count:
3196 3155          .long SMAP_DISABLE_COUNT
3197 3156  
3198 3157  #endif /* __lint */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX