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/ml/locore.s
          +++ new/usr/src/uts/i86pc/ml/locore.s
↓ open down ↓ 15 lines elided ↑ open up ↑
  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 (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  /*
  26      - * Copyright (c) 2016, Joyent, Inc. All rights reserved.
       26 + * Copyright (c) 2018 Joyent, Inc.
  27   27   */
  28   28  
  29   29  /*      Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
  30   30  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T   */
  31   31  /*        All Rights Reserved                                   */
  32   32  
  33   33  /*      Copyright (c) 1987, 1988 Microsoft Corporation          */
  34   34  /*        All Rights Reserved                                   */
  35   35  
  36   36  
↓ open down ↓ 1142 lines elided ↑ open up ↑
1179 1179          movw    %cx, CPUC_DTRACE_FLAGS(%rax)    /* set fault to bad addr */
1180 1180          movq    %r15, CPUC_DTRACE_ILLVAL(%rax)
1181 1181                                              /* fault addr is illegal value */
1182 1182  2:
1183 1183          movq    REGOFF_RIP(%rbp), %rdi
1184 1184          movq    %rdi, %r12
1185 1185          call    dtrace_instr_size
1186 1186          addq    %rax, %r12
1187 1187          movq    %r12, REGOFF_RIP(%rbp)
1188 1188          INTR_POP
1189      -        IRET
     1189 +        jmp     tr_iret_auto
1190 1190          /*NOTREACHED*/
1191 1191  3:
1192 1192          leaq    dtrace_badflags(%rip), %rdi
1193 1193          xorl    %eax, %eax
1194 1194          call    panic
1195 1195  4:
1196 1196          leaq    dtrace_badtrap(%rip), %rdi
1197 1197          xorl    %eax, %eax
1198 1198          call    panic
1199 1199          SET_SIZE(cmntrap)
↓ open down ↓ 392 lines elided ↑ open up ↑
1592 1592           */
1593 1593          ASSERT_UPCALL_MASK_IS_SET
1594 1594          cmpw    $UCS_SEL, REGOFF_CS(%rsp) /* test for native (64-bit) lwp? */
1595 1595          je      sys_rtt_syscall
1596 1596  
1597 1597          /*
1598 1598           * Return to 32-bit userland
1599 1599           */
1600 1600          ALTENTRY(sys_rtt_syscall32)
1601 1601          USER32_POP
1602      -        IRET
     1602 +        jmp     tr_iret_user
1603 1603          /*NOTREACHED*/
1604 1604  
1605 1605          ALTENTRY(sys_rtt_syscall)
1606 1606          /*
1607 1607           * Return to 64-bit userland
1608 1608           */
1609 1609          USER_POP
1610 1610          ALTENTRY(nopop_sys_rtt_syscall)
1611      -        IRET
     1611 +        jmp     tr_iret_user
1612 1612          /*NOTREACHED*/
1613 1613          SET_SIZE(nopop_sys_rtt_syscall)
1614 1614  
1615 1615          /*
1616 1616           * Return to supervisor
1617 1617           * NOTE: to make the check in trap() that tests if we are executing
1618 1618           * segment register fixup/restore code work properly, sr_sup MUST be
1619 1619           * after _sys_rtt .
1620 1620           */
1621 1621          ALTENTRY(sr_sup)
1622 1622          /*
1623 1623           * Restore regs before doing iretq to kernel mode
1624 1624           */
1625 1625          INTR_POP
1626      -        IRET
     1626 +        jmp     tr_iret_kernel
1627 1627          .globl  _sys_rtt_end
1628 1628  _sys_rtt_end:
1629 1629          /*NOTREACHED*/
1630 1630          SET_SIZE(sr_sup)
1631 1631          SET_SIZE(_sys_rtt_end)
1632 1632          SET_SIZE(lwp_rtt)
1633 1633          SET_SIZE(lwp_rtt_initial)
1634 1634          SET_SIZE(_sys_rtt_ints_disabled)
1635 1635          SET_SIZE(_sys_rtt)
1636 1636          SET_SIZE(sys_rtt_syscall)
↓ open down ↓ 733 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX