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 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #pragma ident "%Z%%M% %I% %E% SMI"
28
29 #include <sys/asm_linkage.h>
30 #include <sys/hypervisor.h>
31 #include <sys/privregs.h>
32 #include <sys/segments.h>
33 #include <sys/traptrace.h>
34 #include <sys/trap.h>
35 #include <sys/psw.h>
36 #include <sys/x86_archext.h>
37 #include <sys/asm_misc.h>
38 #include <sys/panic.h>
39
40 #if !defined(__lint)
41 #include "assym.h"
42 #endif
43
44 #if defined(__lint)
45
46 void
47 xpv_panic_callback(void)
48 {}
49
50 /* ARGSUSED */
51 void
52 xpv_panic_setcr3(ulong_t cr3)
53 {}
54
55 void
56 xpv_panic_reload_cr3(void)
57 {}
58
59 void
60 xpv_resetgs(void)
61 {}
62
63 #else /* __lint */
64
65 #if defined(__amd64)
66 ENTRY_NP(xpv_panic_getcr3)
67 movq %cr3, %rax
68 ret
69 SET_SIZE(xpv_panic_getcr3)
70
71 ENTRY_NP(xpv_panic_setcr3)
72 movq %rdi, %cr3
73 ret
74 SET_SIZE(xpv_panic_setcr3)
75
76 ENTRY(xpv_panic_reload_cr3)
77 movq %cr3, %rdi
78 movq %rdi, %cr3
79 ret
80 SET_SIZE(xpv_panic_reload_cr3)
81
82 ENTRY_NP(xpv_panic_prep)
83 pushq %rbp
84 movq %rsp, %rbp
375 jmp xpv_panic_prep
376 SET_SIZE(xpv_ndperr)
377
378 ENTRY_NP(xpv_achktrap)
379 push $T_ALIGNMENT
380 jmp xpv_panic_prep
381 SET_SIZE(xpv_achktrap)
382
383 ENTRY_NP(xpv_mcetrap)
384 push $0
385 push $T_MCE
386 jmp xpv_panic_prep
387 SET_SIZE(xpv_mcetrap)
388
389 ENTRY_NP(xpv_xmtrap)
390 push $0
391 push $T_SIMDFPE
392 jmp xpv_panic_prep
393 SET_SIZE(xpv_xmtrap)
394
395 #endif /* __lint */
|
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 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #include <sys/asm_linkage.h>
28 #include <sys/hypervisor.h>
29 #include <sys/privregs.h>
30 #include <sys/segments.h>
31 #include <sys/traptrace.h>
32 #include <sys/trap.h>
33 #include <sys/psw.h>
34 #include <sys/x86_archext.h>
35 #include <sys/asm_misc.h>
36 #include <sys/panic.h>
37
38 #include "assym.h"
39
40 #if defined(__amd64)
41 ENTRY_NP(xpv_panic_getcr3)
42 movq %cr3, %rax
43 ret
44 SET_SIZE(xpv_panic_getcr3)
45
46 ENTRY_NP(xpv_panic_setcr3)
47 movq %rdi, %cr3
48 ret
49 SET_SIZE(xpv_panic_setcr3)
50
51 ENTRY(xpv_panic_reload_cr3)
52 movq %cr3, %rdi
53 movq %rdi, %cr3
54 ret
55 SET_SIZE(xpv_panic_reload_cr3)
56
57 ENTRY_NP(xpv_panic_prep)
58 pushq %rbp
59 movq %rsp, %rbp
350 jmp xpv_panic_prep
351 SET_SIZE(xpv_ndperr)
352
353 ENTRY_NP(xpv_achktrap)
354 push $T_ALIGNMENT
355 jmp xpv_panic_prep
356 SET_SIZE(xpv_achktrap)
357
358 ENTRY_NP(xpv_mcetrap)
359 push $0
360 push $T_MCE
361 jmp xpv_panic_prep
362 SET_SIZE(xpv_mcetrap)
363
364 ENTRY_NP(xpv_xmtrap)
365 push $0
366 push $T_SIMDFPE
367 jmp xpv_panic_prep
368 SET_SIZE(xpv_xmtrap)
369
|