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/ml/locore.s
          +++ new/usr/src/uts/i86pc/ml/locore.s
↓ open down ↓ 1183 lines elided ↑ open up ↑
1184 1184          movw    %cx, CPUC_DTRACE_FLAGS(%rax)    /* set fault to bad addr */
1185 1185          movq    %r15, CPUC_DTRACE_ILLVAL(%rax)
1186 1186                                              /* fault addr is illegal value */
1187 1187  2:
1188 1188          movq    REGOFF_RIP(%rbp), %rdi
1189 1189          movq    %rdi, %r12
1190 1190          call    dtrace_instr_size
1191 1191          addq    %rax, %r12
1192 1192          movq    %r12, REGOFF_RIP(%rbp)
1193 1193          INTR_POP
1194      -        call    *x86_md_clear
     1194 +        call    x86_md_clear
1195 1195          jmp     tr_iret_auto
1196 1196          /*NOTREACHED*/
1197 1197  3:
1198 1198          leaq    dtrace_badflags(%rip), %rdi
1199 1199          xorl    %eax, %eax
1200 1200          call    panic
1201 1201  4:
1202 1202          leaq    dtrace_badtrap(%rip), %rdi
1203 1203          xorl    %eax, %eax
1204 1204          call    panic
↓ open down ↓ 385 lines elided ↑ open up ↑
1590 1590           */
1591 1591          ASSERT_UPCALL_MASK_IS_SET
1592 1592          cmpw    $UCS_SEL, REGOFF_CS(%rsp) /* test for native (64-bit) lwp? */
1593 1593          je      sys_rtt_syscall
1594 1594  
1595 1595          /*
1596 1596           * Return to 32-bit userland
1597 1597           */
1598 1598          ALTENTRY(sys_rtt_syscall32)
1599 1599          USER32_POP
1600      -        call    *x86_md_clear
     1600 +        call    x86_md_clear
1601 1601          jmp     tr_iret_user
1602 1602          /*NOTREACHED*/
1603 1603  
1604 1604          ALTENTRY(sys_rtt_syscall)
1605 1605          /*
1606 1606           * Return to 64-bit userland
1607 1607           */
1608 1608          USER_POP
1609 1609          ALTENTRY(nopop_sys_rtt_syscall)
1610      -        call    *x86_md_clear
     1610 +        call    x86_md_clear
1611 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           */
↓ open down ↓ 656 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX