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/intel/ia32/sys/trap.h
+++ new/usr/src/uts/intel/ia32/sys/trap.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
22 22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
23 23 /* All Rights Reserved */
24 24
25 25 /*
26 26 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
27 27 * Use is subject to license terms.
28 + *
29 + * Copyright 2018 Joyent, Inc.
28 30 */
29 31
30 32 #ifndef _IA32_SYS_TRAP_H
31 33 #define _IA32_SYS_TRAP_H
32 34
33 35 #ifdef __cplusplus
34 36 extern "C" {
35 37 #endif
36 38
37 39 /*
38 40 * Trap type values
39 41 */
40 42
41 43 #define T_ZERODIV 0x0 /* #de divide by 0 error */
42 44 #define T_SGLSTP 0x1 /* #db single step */
43 45 #define T_NMIFLT 0x2 /* NMI */
44 46 #define T_BPTFLT 0x3 /* #bp breakpoint fault, INT3 insn */
45 47 #define T_OVFLW 0x4 /* #of INTO overflow fault */
↓ open down ↓ |
8 lines elided |
↑ open up ↑ |
46 48 #define T_BOUNDFLT 0x5 /* #br BOUND insn fault */
47 49 #define T_ILLINST 0x6 /* #ud invalid opcode fault */
48 50 #define T_NOEXTFLT 0x7 /* #nm device not available: x87 */
49 51 #define T_DBLFLT 0x8 /* #df double fault */
50 52 #define T_EXTOVRFLT 0x9 /* [not generated: 386 only] */
51 53 #define T_TSSFLT 0xa /* #ts invalid TSS fault */
52 54 #define T_SEGFLT 0xb /* #np segment not present fault */
53 55 #define T_STKFLT 0xc /* #ss stack fault */
54 56 #define T_GPFLT 0xd /* #gp general protection fault */
55 57 #define T_PGFLT 0xe /* #pf page fault */
58 +#define T_RESVTRAP 0xf /* reserved */
56 59 #define T_EXTERRFLT 0x10 /* #mf x87 FPU error fault */
57 60 #define T_ALIGNMENT 0x11 /* #ac alignment check error */
58 61 #define T_MCE 0x12 /* #mc machine check exception */
59 62 #define T_SIMDFPE 0x13 /* #xm SSE/SSE exception */
60 63 #define T_DBGENTR 0x14 /* debugger entry */
64 +#define T_INVALTRAP 0x1e /* invalid */
61 65 #define T_ENDPERR 0x21 /* emulated extension error flt */
62 66 #define T_ENOEXTFLT 0x20 /* emulated ext not present */
63 67 #define T_FASTTRAP 0xd2 /* fast system call */
64 68 #define T_SYSCALLINT 0x91 /* general system call */
65 69 #define T_DTRACE_RET 0x92 /* DTrace pid return */
66 70 #define T_INT80 0x80 /* int80 handler for linux emulation */
67 71 #define T_SOFTINT 0x50fd /* pseudo softint trap type */
68 72
69 73 /*
70 74 * Pseudo traps.
71 75 */
72 76 #define T_INTERRUPT 0x100
73 77 #define T_FAULT 0x200
74 78 #define T_AST 0x400
75 79 #define T_SYSCALL 0x180
76 80
77 81
78 82 /*
79 83 * Values of error code on stack in case of page fault
80 84 */
81 85
82 86 #define PF_ERR_MASK 0x01 /* Mask for error bit */
83 87 #define PF_ERR_PAGE 0x00 /* page not present */
84 88 #define PF_ERR_PROT 0x01 /* protection error */
85 89 #define PF_ERR_WRITE 0x02 /* fault caused by write (else read) */
86 90 #define PF_ERR_USER 0x04 /* processor was in user mode */
87 91 /* (else supervisor) */
88 92 #define PF_ERR_EXEC 0x10 /* attempt to execute a No eXec page (AMD) */
89 93 /* or kernel tried to execute a user page */
90 94 /* (Intel SMEP) */
91 95
92 96 /*
93 97 * Definitions for fast system call subfunctions
94 98 */
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
95 99 #define T_FNULL 0 /* Null trap for testing */
96 100 #define T_FGETFP 1 /* Get emulated FP context */
97 101 #define T_FSETFP 2 /* Set emulated FP context */
98 102 #define T_GETHRTIME 3 /* Get high resolution time */
99 103 #define T_GETHRVTIME 4 /* Get high resolution virtual time */
100 104 #define T_GETHRESTIME 5 /* Get high resolution time */
101 105 #define T_GETLGRP 6 /* Get home lgrpid */
102 106
103 107 #define T_LASTFAST 6 /* Last valid subfunction */
104 108
109 +/*
110 + * Offsets for an interrupt/trap frame.
111 + */
112 +#define T_FRAME_ERR 0
113 +#define T_FRAME_RIP 8
114 +#define T_FRAME_CS 16
115 +#define T_FRAME_RFLAGS 24
116 +#define T_FRAME_RSP 32
117 +#define T_FRAME_SS 40
118 +
119 +#define T_FRAMERET_RIP 0
120 +#define T_FRAMERET_CS 8
121 +#define T_FRAMERET_RFLAGS 16
122 +#define T_FRAMERET_RSP 24
123 +#define T_FRAMERET_SS 32
124 +
105 125 #ifdef __cplusplus
106 126 }
107 127 #endif
108 128
109 129 #endif /* _IA32_SYS_TRAP_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX