]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - sys/amd64/vmm/intel/vmx_genassym.c
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / sys / amd64 / vmm / intel / vmx_genassym.c
1 /*-
2  * Copyright (c) 2011 NetApp, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
31
32 #include <sys/param.h>
33 #include <sys/systm.h>
34 #include <sys/malloc.h>
35 #include <sys/proc.h>
36 #include <sys/assym.h>
37
38 #include <vm/vm.h>
39 #include <vm/pmap.h>
40
41 #include <machine/pmap.h>
42
43 #include <machine/vmm.h>
44 #include "vmx.h"
45 #include "vmx_cpufunc.h"
46
47 ASSYM(VMXCTX_TMPSTKTOP, offsetof(struct vmxctx, tmpstktop));
48 ASSYM(VMXCTX_GUEST_RDI, offsetof(struct vmxctx, guest_rdi));
49 ASSYM(VMXCTX_GUEST_RSI, offsetof(struct vmxctx, guest_rsi));
50 ASSYM(VMXCTX_GUEST_RDX, offsetof(struct vmxctx, guest_rdx));
51 ASSYM(VMXCTX_GUEST_RCX, offsetof(struct vmxctx, guest_rcx));
52 ASSYM(VMXCTX_GUEST_R8, offsetof(struct vmxctx, guest_r8));
53 ASSYM(VMXCTX_GUEST_R9, offsetof(struct vmxctx, guest_r9));
54 ASSYM(VMXCTX_GUEST_RAX, offsetof(struct vmxctx, guest_rax));
55 ASSYM(VMXCTX_GUEST_RBX, offsetof(struct vmxctx, guest_rbx));
56 ASSYM(VMXCTX_GUEST_RBP, offsetof(struct vmxctx, guest_rbp));
57 ASSYM(VMXCTX_GUEST_R10, offsetof(struct vmxctx, guest_r10));
58 ASSYM(VMXCTX_GUEST_R11, offsetof(struct vmxctx, guest_r11));
59 ASSYM(VMXCTX_GUEST_R12, offsetof(struct vmxctx, guest_r12));
60 ASSYM(VMXCTX_GUEST_R13, offsetof(struct vmxctx, guest_r13));
61 ASSYM(VMXCTX_GUEST_R14, offsetof(struct vmxctx, guest_r14));
62 ASSYM(VMXCTX_GUEST_R15, offsetof(struct vmxctx, guest_r15));
63 ASSYM(VMXCTX_GUEST_CR2, offsetof(struct vmxctx, guest_cr2));
64
65 ASSYM(VMXCTX_HOST_R15, offsetof(struct vmxctx, host_r15));
66 ASSYM(VMXCTX_HOST_R14, offsetof(struct vmxctx, host_r14));
67 ASSYM(VMXCTX_HOST_R13, offsetof(struct vmxctx, host_r13));
68 ASSYM(VMXCTX_HOST_R12, offsetof(struct vmxctx, host_r12));
69 ASSYM(VMXCTX_HOST_RBP, offsetof(struct vmxctx, host_rbp));
70 ASSYM(VMXCTX_HOST_RSP, offsetof(struct vmxctx, host_rsp));
71 ASSYM(VMXCTX_HOST_RBX, offsetof(struct vmxctx, host_rbx));
72 ASSYM(VMXCTX_HOST_RIP, offsetof(struct vmxctx, host_rip));
73
74 ASSYM(VMXCTX_LAUNCH_ERROR, offsetof(struct vmxctx, launch_error));
75 ASSYM(VMXCTX_EPTGEN, offsetof(struct vmxctx, eptgen));
76
77 ASSYM(VMXCTX_PMAP, offsetof(struct vmxctx, pmap));
78 ASSYM(VMXCTX_EPTP, offsetof(struct vmxctx, eptp));
79
80 ASSYM(VM_SUCCESS,       VM_SUCCESS);
81 ASSYM(VM_FAIL_INVALID,  VM_FAIL_INVALID);
82 ASSYM(VM_FAIL_VALID,    VM_FAIL_VALID);
83
84 ASSYM(VMX_RETURN_DIRECT,        VMX_RETURN_DIRECT);
85 ASSYM(VMX_RETURN_LONGJMP,       VMX_RETURN_LONGJMP);
86 ASSYM(VMX_RETURN_VMRESUME,      VMX_RETURN_VMRESUME);
87 ASSYM(VMX_RETURN_VMLAUNCH,      VMX_RETURN_VMLAUNCH);
88 ASSYM(VMX_RETURN_AST,           VMX_RETURN_AST);
89 ASSYM(VMX_RETURN_INVEPT,        VMX_RETURN_INVEPT);
90
91 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
92 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
93 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
94 ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
95 ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
96
97 ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
98 ASSYM(PM_EPTGEN, offsetof(struct pmap, pm_eptgen));