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/sys/asm_misc.h
          +++ new/usr/src/uts/i86pc/sys/asm_misc.h
↓ 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 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24      - * Copyright 2017 Joyent, Inc.
       24 + * Copyright 2019 Joyent, Inc.
  25   25   */
  26   26  
  27   27  #ifndef _SYS_ASM_MISC_H
  28   28  #define _SYS_ASM_MISC_H
  29   29  
  30   30  #ifdef  __cplusplus
  31   31  extern "C" {
  32   32  #endif
  33   33  
       34 +#define RET_INSTR       0xc3
       35 +#define NOP_INSTR       0x90
       36 +#define STI_INSTR       0xfb
       37 +#define JMP_INSTR       0x00eb
       38 +
  34   39  #ifdef _ASM     /* The remainder of this file is only for assembly files */
  35   40  
  36   41  /* Load reg with pointer to per-CPU structure */
  37   42  #if defined(__amd64)
  38   43  #define LOADCPU(reg)                    \
  39   44          movq    %gs:CPU_SELF, reg;
  40   45  #else
  41   46  #define LOADCPU(reg)                    \
  42   47          movl    %gs:CPU_SELF, reg;
  43   48  #endif
  44   49  
  45      -#define RET_INSTR       0xc3
  46      -#define NOP_INSTR       0x90
  47      -#define STI_INSTR       0xfb
  48      -#define JMP_INSTR       0x00eb
  49      -
  50      -
  51   50  #if defined(__i386)
  52   51  
  53   52  #define _HOT_PATCH_PROLOG                       \
  54   53          push    %ebp;                           \
  55   54          mov     %esp, %ebp;                     \
  56   55          push    %ebx;                           \
  57   56          push    %esi;                           \
  58   57          push    %edi
  59   58  
  60   59  #define _HOT_PATCH(srcaddr, dstaddr, size)      \
↓ open down ↓ 32 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX