Print this page
8956 Implement KPTI
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/sys/machprivregs.h
          +++ new/usr/src/uts/i86pc/sys/machprivregs.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  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  /*
  23   23   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + *
       26 + * Copyright 2018 Joyent, Inc.
  25   27   */
  26   28  
  27   29  #ifndef _SYS_MACHPRIVREGS_H
  28   30  #define _SYS_MACHPRIVREGS_H
  29   31  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   32  /*
  33   33   * Platform dependent instruction sequences for manipulating
  34   34   * privileged state
  35   35   */
  36   36  
  37   37  #ifdef __cplusplus
  38   38  extern "C" {
  39   39  #endif
  40   40  
  41   41  #define ASSERT_UPCALL_MASK_IS_SET               /* empty */
↓ open down ↓ 28 lines elided ↑ open up ↑
  70   70  
  71   71  /*
  72   72   * IRET and SWAPGS
  73   73   */
  74   74  #if defined(__amd64)
  75   75  
  76   76  #define IRET    iretq
  77   77  #define SYSRETQ sysretq
  78   78  #define SYSRETL sysretl
  79   79  #define SWAPGS  swapgs
  80      -#define XPV_TRAP_POP    /* empty */
  81      -#define XPV_TRAP_PUSH   /* empty */
  82   80  
  83   81  #elif defined(__i386)
  84   82  
  85   83  #define IRET    iret
  86   84  
  87   85  #endif  /* __i386 */
  88   86  
       87 +#define XPV_TRAP_POP    /* empty */
       88 +#define XPV_TRAP_PUSH   /* empty */
  89   89  #define CLEAN_CS        /* empty */
  90   90  
  91   91  
  92   92  /*
  93   93   * Macros for saving the original segment registers and restoring them
  94   94   * for fast traps.
  95   95   */
  96   96  #if defined(__amd64)
  97   97  
  98   98  /*
↓ open down ↓ 23 lines elided ↑ open up ↑
 122  122          movq    %rsi, REGOFF_RSI(%rsp); \
 123  123          movq    %rdi, REGOFF_RDI(%rsp); \
 124  124          swapgs
 125  125  
 126  126  #define FAST_INTR_POP                   \
 127  127          swapgs;                         \
 128  128          movq    REGOFF_RSI(%rsp), %rsi; \
 129  129          movq    REGOFF_RDI(%rsp), %rdi; \
 130  130          addq    $REGOFF_RIP, %rsp
 131  131  
 132      -#define FAST_INTR_RETURN        iretq
      132 +#define FAST_INTR_RETURN        jmp tr_iret_user
 133  133  
 134  134  #elif defined(__i386)
 135  135  
 136  136  #define FAST_INTR_PUSH          \
 137  137          cld;                    \
 138  138          __SEGREGS_PUSH          \
 139  139          __SEGREGS_LOAD_KERNEL
 140  140  
 141  141  #define FAST_INTR_POP           \
 142  142          __SEGREGS_POP
↓ open down ↓ 35 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX