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>


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.

  23  */
  24 
  25 /*      Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
  26 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T       */
  27 /*        All Rights Reserved                                   */
  28 
  29 /*      Copyright (c) 1987, 1988 Microsoft Corporation          */
  30 /*        All Rights Reserved                                   */
  31 
  32 #include <sys/asm_linkage.h>
  33 #include <sys/asm_misc.h>
  34 #include <sys/regset.h>
  35 #include <sys/psw.h>
  36 #include <sys/x86_archext.h>
  37 
  38 #if defined(__lint)
  39 
  40 #include <sys/types.h>
  41 #include <sys/thread.h>
  42 #include <sys/systm.h>


  82         TRACE_REGS(%r12, %rsp, %rax, %rbx)      /* Uses label 9 */
  83         TRACE_STAMP(%r12)               /* Clobbers %eax, %edx, uses 9 */
  84 
  85         movq    %rsp, %rbp
  86 
  87         TRACE_STACK(%r12)
  88 
  89 #ifdef TRAPTRACE
  90         LOADCPU(%rbx)                           /* &cpu */
  91         movl    CPU_PRI(%rbx), %r14d            /* old ipl */
  92         movl    $255, TTR_IPL(%r12)
  93         movl    %r14d, %edi
  94         movb    %dil, TTR_PRI(%r12)
  95         movl    CPU_BASE_SPL(%rbx), %edi
  96         movb    %dil, TTR_SPL(%r12)
  97         movb    $255, TTR_VECTOR(%r12)
  98         movq    %r12, %rsi              /* pass traptrace record pointer */
  99 #endif
 100 
 101         movq    %rsp, %rdi              /* pass struct regs pointer */
 102         call    *do_interrupt_common

 103 
 104         jmp     _sys_rtt_ints_disabled
 105         /*NOTREACHED*/
 106 
 107         SET_SIZE(cmnint)
 108         SET_SIZE(_interrupt)
 109 
 110 #elif defined(__i386)
 111 
 112         ENTRY_NP2(cmnint, _interrupt)
 113 
 114         INTR_PUSH
 115         INTGATE_INIT_KERNEL_FLAGS
 116 
 117         /*
 118          * At the end of TRACE_PTR %esi points to the current TRAPTRACE entry
 119          */
 120         TRACE_PTR(%esi, %eax, %eax, %edx, $TT_INTERRUPT)
 121                                                 /* Uses labels 8 and 9 */
 122         TRACE_REGS(%esi, %esp, %eax, %ebx)      /* Uses label 9 */




   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2019 Joyent, Inc.
  24  */
  25 
  26 /*      Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
  27 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T       */
  28 /*        All Rights Reserved                                   */
  29 
  30 /*      Copyright (c) 1987, 1988 Microsoft Corporation          */
  31 /*        All Rights Reserved                                   */
  32 
  33 #include <sys/asm_linkage.h>
  34 #include <sys/asm_misc.h>
  35 #include <sys/regset.h>
  36 #include <sys/psw.h>
  37 #include <sys/x86_archext.h>
  38 
  39 #if defined(__lint)
  40 
  41 #include <sys/types.h>
  42 #include <sys/thread.h>
  43 #include <sys/systm.h>


  83         TRACE_REGS(%r12, %rsp, %rax, %rbx)      /* Uses label 9 */
  84         TRACE_STAMP(%r12)               /* Clobbers %eax, %edx, uses 9 */
  85 
  86         movq    %rsp, %rbp
  87 
  88         TRACE_STACK(%r12)
  89 
  90 #ifdef TRAPTRACE
  91         LOADCPU(%rbx)                           /* &cpu */
  92         movl    CPU_PRI(%rbx), %r14d            /* old ipl */
  93         movl    $255, TTR_IPL(%r12)
  94         movl    %r14d, %edi
  95         movb    %dil, TTR_PRI(%r12)
  96         movl    CPU_BASE_SPL(%rbx), %edi
  97         movb    %dil, TTR_SPL(%r12)
  98         movb    $255, TTR_VECTOR(%r12)
  99         movq    %r12, %rsi              /* pass traptrace record pointer */
 100 #endif
 101 
 102         movq    %rsp, %rdi              /* pass struct regs pointer */
 103         movq    do_interrupt_common, %rax
 104         INDIRECT_CALL_REG(rax)
 105 
 106         jmp     _sys_rtt_ints_disabled
 107         /*NOTREACHED*/
 108 
 109         SET_SIZE(cmnint)
 110         SET_SIZE(_interrupt)
 111 
 112 #elif defined(__i386)
 113 
 114         ENTRY_NP2(cmnint, _interrupt)
 115 
 116         INTR_PUSH
 117         INTGATE_INIT_KERNEL_FLAGS
 118 
 119         /*
 120          * At the end of TRACE_PTR %esi points to the current TRAPTRACE entry
 121          */
 122         TRACE_PTR(%esi, %eax, %eax, %edx, $TT_INTERRUPT)
 123                                                 /* Uses labels 8 and 9 */
 124         TRACE_REGS(%esi, %esp, %eax, %ebx)      /* Uses label 9 */