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>

@@ -19,20 +19,25 @@
  * CDDL HEADER END
  */
 /*
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
- * Copyright 2017 Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
  */
 
 #ifndef _SYS_ASM_MISC_H
 #define _SYS_ASM_MISC_H
 
 #ifdef  __cplusplus
 extern "C" {
 #endif
 
+#define RET_INSTR       0xc3
+#define NOP_INSTR       0x90
+#define STI_INSTR       0xfb
+#define JMP_INSTR       0x00eb
+
 #ifdef _ASM     /* The remainder of this file is only for assembly files */
 
 /* Load reg with pointer to per-CPU structure */
 #if defined(__amd64)
 #define LOADCPU(reg)                    \

@@ -40,16 +45,10 @@
 #else
 #define LOADCPU(reg)                    \
         movl    %gs:CPU_SELF, reg;
 #endif
 
-#define RET_INSTR       0xc3
-#define NOP_INSTR       0x90
-#define STI_INSTR       0xfb
-#define JMP_INSTR       0x00eb
-
-
 #if defined(__i386)
 
 #define _HOT_PATCH_PROLOG                       \
         push    %ebp;                           \
         mov     %esp, %ebp;                     \