Print this page
9210 remove KMDB branch debugging support
9211 ::crregs could do with cr2/cr3 support
9209 ::ttrace should be able to filter by thread
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/kdi/kdi_idthdl.s
+++ new/usr/src/uts/intel/kdi/kdi_idthdl.s
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
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
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]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 + *
25 + * Copyright 2018 Joyent, Inc.
24 26 */
25 27
26 -#pragma ident "%Z%%M% %I% %E% SMI"
27 -
28 28 /*
29 29 * Companion to kdi_idt.c - the implementation of the trap and interrupt
30 30 * handlers. For the most part, these handlers do the same thing - they
31 31 * push a trap number onto the stack, followed by a jump to kdi_cmnint.
32 32 * Each trap and interrupt has its own handler because each one pushes a
33 33 * different number.
34 34 */
35 35
36 36 #include <sys/asm_linkage.h>
37 37 #include <sys/kdi_regs.h>
38 38
39 39 /* Nothing in this file is of interest to lint. */
40 40 #if !defined(__lint)
41 41
42 -/*
42 +/*
43 43 * The default ASM_ENTRY_ALIGN (16) wastes far too much space. Pay no
44 44 * attention to the fleet of nop's we're adding to each handler.
45 45 */
46 46 #undef ASM_ENTRY_ALIGN
47 47 #define ASM_ENTRY_ALIGN 8
48 48
49 49 /*
50 - * We need the .align in ENTRY_NP (defined to be ASM_ENTRY_ALIGN) to match our
51 - * manual .align (KDI_MSR_PATCHOFF) in order to ensure that the space reserved
52 - * at the beginning of the handler for code is exactly KDI_MSR_PATCHOFF bytes
53 - * long. Note that the #error below isn't supported by the preprocessor invoked
54 - * by as(1), and won't stop the build, but it'll emit a noticeable error message
55 - * which won't escape the filters.
56 - */
57 -#if ASM_ENTRY_ALIGN != KDI_MSR_PATCHOFF
58 -#error "ASM_ENTRY_ALIGN != KDI_MSR_PATCHOFF"
59 -this won't assemble
60 -#endif
61 -
62 -/*
63 - * kdi_idt_patch will, on certain processors, replace the patch points below
64 - * with MSR-clearing code. kdi_id_patch has intimate knowledge of the size of
65 - * the nop hole, as well as the structure of the handlers. Do not change
66 - * anything here without also changing kdi_idt_patch.
67 - */
68 -
69 -/*
70 50 * Generic trap and interrupt handlers.
71 51 */
72 52
73 53 #if defined(__xpv) && defined(__amd64)
74 54
75 55 /*
76 56 * The hypervisor places r11 and rcx on the stack.
77 57 */
78 58
79 59 #define TRAP_NOERR(trapno) \
80 60 popq %rcx; \
81 61 popq %r11; \
82 62 pushq $trapno
83 63
84 64 #define TRAP_ERR(trapno) \
85 65 popq %rcx; \
86 66 popq %r11; \
87 67 pushq $0; \
88 68 pushq $trapno
89 69
90 70 #else
91 71
92 72 #define TRAP_NOERR(trapno) \
93 73 push $trapno
94 74
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
95 75 #define TRAP_ERR(trapno) \
96 76 push $0; \
97 77 push $trapno
98 78
99 79 #endif /* __xpv && __amd64 */
100 80
101 81
102 82 #define MKIVCT(n) \
103 83 ENTRY_NP(kdi_ivct/**/n/**/); \
104 84 TRAP_ERR(n); \
105 - .align KDI_MSR_PATCHOFF; \
106 - KDI_MSR_PATCH; \
107 85 jmp kdi_cmnint; \
108 86 SET_SIZE(kdi_ivct/**/n/**/)
109 87
110 88 #define MKTRAPHDLR(n) \
111 89 ENTRY_NP(kdi_trap/**/n); \
112 90 TRAP_ERR(n); \
113 - .align KDI_MSR_PATCHOFF; \
114 - KDI_MSR_PATCH; \
115 91 jmp kdi_cmnint; \
116 92 SET_SIZE(kdi_trap/**/n/**/)
117 93
118 94 #define MKTRAPERRHDLR(n) \
119 95 ENTRY_NP(kdi_traperr/**/n); \
120 96 TRAP_NOERR(n); \
121 - .align KDI_MSR_PATCHOFF; \
122 - KDI_MSR_PATCH; \
123 97 jmp kdi_cmnint; \
124 98 SET_SIZE(kdi_traperr/**/n)
125 99
126 100 #define MKNMIHDLR \
127 101 ENTRY_NP(kdi_int2); \
128 102 TRAP_NOERR(2); \
129 - .align KDI_MSR_PATCHOFF; \
130 - KDI_MSR_PATCH; \
131 103 jmp kdi_nmiint; \
132 104 SET_SIZE(kdi_int2)
133 105
134 106 #define MKINVALHDLR \
135 107 ENTRY_NP(kdi_invaltrap); \
136 108 TRAP_NOERR(255); \
137 - .align KDI_MSR_PATCHOFF; \
138 - KDI_MSR_PATCH; \
139 109 jmp kdi_cmnint; \
140 110 SET_SIZE(kdi_invaltrap)
141 111
142 112 /*
143 113 * The handlers themselves
144 114 */
145 115
146 116 MKINVALHDLR
147 117 MKTRAPHDLR(0)
148 118 MKTRAPHDLR(1)
149 119 MKNMIHDLR/*2*/
150 120 MKTRAPHDLR(3)
151 121 MKTRAPHDLR(4)
152 122 MKTRAPHDLR(5)
153 123 MKTRAPHDLR(6)
154 124 MKTRAPHDLR(7)
155 125 MKTRAPHDLR(9)
156 126 MKTRAPHDLR(15)
157 127 MKTRAPHDLR(16)
158 128 MKTRAPHDLR(17)
159 129 MKTRAPHDLR(18)
160 130 MKTRAPHDLR(19)
161 131 MKTRAPHDLR(20)
162 132
163 133 MKTRAPERRHDLR(8)
164 134 MKTRAPERRHDLR(10)
165 135 MKTRAPERRHDLR(11)
166 136 MKTRAPERRHDLR(12)
167 137 MKTRAPERRHDLR(13)
168 138 MKTRAPERRHDLR(14)
169 139
170 140 .globl kdi_ivct_size
171 141 kdi_ivct_size:
172 142 .NWORD [kdi_ivct33-kdi_ivct32]
173 143
174 144 /* 10 billion and one interrupt handlers */
175 145 kdi_ivct_base:
176 146 MKIVCT(32); MKIVCT(33); MKIVCT(34); MKIVCT(35);
177 147 MKIVCT(36); MKIVCT(37); MKIVCT(38); MKIVCT(39);
178 148 MKIVCT(40); MKIVCT(41); MKIVCT(42); MKIVCT(43);
179 149 MKIVCT(44); MKIVCT(45); MKIVCT(46); MKIVCT(47);
180 150 MKIVCT(48); MKIVCT(49); MKIVCT(50); MKIVCT(51);
181 151 MKIVCT(52); MKIVCT(53); MKIVCT(54); MKIVCT(55);
182 152 MKIVCT(56); MKIVCT(57); MKIVCT(58); MKIVCT(59);
183 153 MKIVCT(60); MKIVCT(61); MKIVCT(62); MKIVCT(63);
184 154 MKIVCT(64); MKIVCT(65); MKIVCT(66); MKIVCT(67);
185 155 MKIVCT(68); MKIVCT(69); MKIVCT(70); MKIVCT(71);
186 156 MKIVCT(72); MKIVCT(73); MKIVCT(74); MKIVCT(75);
187 157 MKIVCT(76); MKIVCT(77); MKIVCT(78); MKIVCT(79);
188 158 MKIVCT(80); MKIVCT(81); MKIVCT(82); MKIVCT(83);
189 159 MKIVCT(84); MKIVCT(85); MKIVCT(86); MKIVCT(87);
190 160 MKIVCT(88); MKIVCT(89); MKIVCT(90); MKIVCT(91);
191 161 MKIVCT(92); MKIVCT(93); MKIVCT(94); MKIVCT(95);
192 162 MKIVCT(96); MKIVCT(97); MKIVCT(98); MKIVCT(99);
193 163 MKIVCT(100); MKIVCT(101); MKIVCT(102); MKIVCT(103);
194 164 MKIVCT(104); MKIVCT(105); MKIVCT(106); MKIVCT(107);
195 165 MKIVCT(108); MKIVCT(109); MKIVCT(110); MKIVCT(111);
196 166 MKIVCT(112); MKIVCT(113); MKIVCT(114); MKIVCT(115);
197 167 MKIVCT(116); MKIVCT(117); MKIVCT(118); MKIVCT(119);
198 168 MKIVCT(120); MKIVCT(121); MKIVCT(122); MKIVCT(123);
199 169 MKIVCT(124); MKIVCT(125); MKIVCT(126); MKIVCT(127);
200 170 MKIVCT(128); MKIVCT(129); MKIVCT(130); MKIVCT(131);
201 171 MKIVCT(132); MKIVCT(133); MKIVCT(134); MKIVCT(135);
202 172 MKIVCT(136); MKIVCT(137); MKIVCT(138); MKIVCT(139);
203 173 MKIVCT(140); MKIVCT(141); MKIVCT(142); MKIVCT(143);
204 174 MKIVCT(144); MKIVCT(145); MKIVCT(146); MKIVCT(147);
205 175 MKIVCT(148); MKIVCT(149); MKIVCT(150); MKIVCT(151);
206 176 MKIVCT(152); MKIVCT(153); MKIVCT(154); MKIVCT(155);
207 177 MKIVCT(156); MKIVCT(157); MKIVCT(158); MKIVCT(159);
208 178 MKIVCT(160); MKIVCT(161); MKIVCT(162); MKIVCT(163);
209 179 MKIVCT(164); MKIVCT(165); MKIVCT(166); MKIVCT(167);
210 180 MKIVCT(168); MKIVCT(169); MKIVCT(170); MKIVCT(171);
211 181 MKIVCT(172); MKIVCT(173); MKIVCT(174); MKIVCT(175);
212 182 MKIVCT(176); MKIVCT(177); MKIVCT(178); MKIVCT(179);
213 183 MKIVCT(180); MKIVCT(181); MKIVCT(182); MKIVCT(183);
214 184 MKIVCT(184); MKIVCT(185); MKIVCT(186); MKIVCT(187);
215 185 MKIVCT(188); MKIVCT(189); MKIVCT(190); MKIVCT(191);
216 186 MKIVCT(192); MKIVCT(193); MKIVCT(194); MKIVCT(195);
217 187 MKIVCT(196); MKIVCT(197); MKIVCT(198); MKIVCT(199);
218 188 MKIVCT(200); MKIVCT(201); MKIVCT(202); MKIVCT(203);
219 189 MKIVCT(204); MKIVCT(205); MKIVCT(206); MKIVCT(207);
220 190 MKIVCT(208); MKIVCT(209); MKIVCT(210); MKIVCT(211);
221 191 MKIVCT(212); MKIVCT(213); MKIVCT(214); MKIVCT(215);
222 192 MKIVCT(216); MKIVCT(217); MKIVCT(218); MKIVCT(219);
223 193 MKIVCT(220); MKIVCT(221); MKIVCT(222); MKIVCT(223);
224 194 MKIVCT(224); MKIVCT(225); MKIVCT(226); MKIVCT(227);
225 195 MKIVCT(228); MKIVCT(229); MKIVCT(230); MKIVCT(231);
226 196 MKIVCT(232); MKIVCT(233); MKIVCT(234); MKIVCT(235);
227 197 MKIVCT(236); MKIVCT(237); MKIVCT(238); MKIVCT(239);
228 198 MKIVCT(240); MKIVCT(241); MKIVCT(242); MKIVCT(243);
229 199 MKIVCT(244); MKIVCT(245); MKIVCT(246); MKIVCT(247);
230 200 MKIVCT(248); MKIVCT(249); MKIVCT(250); MKIVCT(251);
231 201 MKIVCT(252); MKIVCT(253); MKIVCT(254); MKIVCT(255);
232 202
233 203 #endif
↓ open down ↓ |
85 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX