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

@@ -21,11 +21,11 @@
 
 /*
  * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 /*
- * Copyright (c) 2016, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2018 Joyent, Inc.
  */
 
 /*      Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T   */
 /*        All Rights Reserved                                   */

@@ -1184,11 +1184,11 @@
         movq    %rdi, %r12
         call    dtrace_instr_size
         addq    %rax, %r12
         movq    %r12, REGOFF_RIP(%rbp)
         INTR_POP
-        IRET
+        jmp     tr_iret_auto
         /*NOTREACHED*/
 3:
         leaq    dtrace_badflags(%rip), %rdi
         xorl    %eax, %eax
         call    panic

@@ -1597,20 +1597,20 @@
         /*
          * Return to 32-bit userland
          */
         ALTENTRY(sys_rtt_syscall32)
         USER32_POP
-        IRET
+        jmp     tr_iret_user
         /*NOTREACHED*/
 
         ALTENTRY(sys_rtt_syscall)
         /*
          * Return to 64-bit userland
          */
         USER_POP
         ALTENTRY(nopop_sys_rtt_syscall)
-        IRET
+        jmp     tr_iret_user
         /*NOTREACHED*/
         SET_SIZE(nopop_sys_rtt_syscall)
 
         /*
          * Return to supervisor

@@ -1621,11 +1621,11 @@
         ALTENTRY(sr_sup)
         /*
          * Restore regs before doing iretq to kernel mode
          */
         INTR_POP
-        IRET
+        jmp     tr_iret_kernel
         .globl  _sys_rtt_end
 _sys_rtt_end:
         /*NOTREACHED*/
         SET_SIZE(sr_sup)
         SET_SIZE(_sys_rtt_end)