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