xref: /freebsd/sys/amd64/vmm/intel/vmx_controls.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
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 
29 #ifndef _VMX_CONTROLS_H_
30 #define	_VMX_CONTROLS_H_
31 
32 /* Pin-Based VM-Execution Controls */
33 #define	PINBASED_EXTINT_EXITING		(1 << 0)
34 #define	PINBASED_NMI_EXITING		(1 << 3)
35 #define	PINBASED_VIRTUAL_NMI		(1 << 5)
36 #define	PINBASED_PREMPTION_TIMER	(1 << 6)
37 #define	PINBASED_POSTED_INTERRUPT	(1 << 7)
38 
39 /* Primary Processor-Based VM-Execution Controls */
40 #define	PROCBASED_INT_WINDOW_EXITING	(1 << 2)
41 #define	PROCBASED_TSC_OFFSET		(1 << 3)
42 #define	PROCBASED_HLT_EXITING		(1 << 7)
43 #define	PROCBASED_INVLPG_EXITING	(1 << 9)
44 #define	PROCBASED_MWAIT_EXITING		(1 << 10)
45 #define	PROCBASED_RDPMC_EXITING		(1 << 11)
46 #define	PROCBASED_RDTSC_EXITING		(1 << 12)
47 #define	PROCBASED_CR3_LOAD_EXITING	(1 << 15)
48 #define	PROCBASED_CR3_STORE_EXITING	(1 << 16)
49 #define	PROCBASED_CR8_LOAD_EXITING	(1 << 19)
50 #define	PROCBASED_CR8_STORE_EXITING	(1 << 20)
51 #define	PROCBASED_USE_TPR_SHADOW	(1 << 21)
52 #define	PROCBASED_NMI_WINDOW_EXITING	(1 << 22)
53 #define PROCBASED_MOV_DR_EXITING	(1 << 23)
54 #define	PROCBASED_IO_EXITING		(1 << 24)
55 #define	PROCBASED_IO_BITMAPS		(1 << 25)
56 #define	PROCBASED_MTF			(1 << 27)
57 #define	PROCBASED_MSR_BITMAPS		(1 << 28)
58 #define	PROCBASED_MONITOR_EXITING	(1 << 29)
59 #define	PROCBASED_PAUSE_EXITING		(1 << 30)
60 #define	PROCBASED_SECONDARY_CONTROLS	(1U << 31)
61 
62 /* Secondary Processor-Based VM-Execution Controls */
63 #define	PROCBASED2_VIRTUALIZE_APIC_ACCESSES	(1 << 0)
64 #define	PROCBASED2_ENABLE_EPT			(1 << 1)
65 #define	PROCBASED2_DESC_TABLE_EXITING		(1 << 2)
66 #define	PROCBASED2_ENABLE_RDTSCP		(1 << 3)
67 #define	PROCBASED2_VIRTUALIZE_X2APIC_MODE	(1 << 4)
68 #define	PROCBASED2_ENABLE_VPID			(1 << 5)
69 #define	PROCBASED2_WBINVD_EXITING		(1 << 6)
70 #define	PROCBASED2_UNRESTRICTED_GUEST		(1 << 7)
71 #define	PROCBASED2_APIC_REGISTER_VIRTUALIZATION	(1 << 8)
72 #define	PROCBASED2_VIRTUAL_INTERRUPT_DELIVERY	(1 << 9)
73 #define	PROCBASED2_PAUSE_LOOP_EXITING		(1 << 10)
74 #define	PROCBASED2_ENABLE_INVPCID		(1 << 12)
75 
76 /* VM Exit Controls */
77 #define	VM_EXIT_SAVE_DEBUG_CONTROLS	(1 << 2)
78 #define	VM_EXIT_HOST_LMA		(1 << 9)
79 #define	VM_EXIT_LOAD_PERF_GLOBAL_CTRL	(1 << 12)
80 #define	VM_EXIT_ACKNOWLEDGE_INTERRUPT	(1 << 15)
81 #define	VM_EXIT_SAVE_PAT		(1 << 18)
82 #define	VM_EXIT_LOAD_PAT		(1 << 19)
83 #define	VM_EXIT_SAVE_EFER		(1 << 20)
84 #define	VM_EXIT_LOAD_EFER		(1 << 21)
85 #define	VM_EXIT_SAVE_PREEMPTION_TIMER	(1 << 22)
86 
87 /* VM Entry Controls */
88 #define	VM_ENTRY_LOAD_DEBUG_CONTROLS	(1 << 2)
89 #define	VM_ENTRY_GUEST_LMA		(1 << 9)
90 #define	VM_ENTRY_INTO_SMM		(1 << 10)
91 #define	VM_ENTRY_DEACTIVATE_DUAL_MONITOR (1 << 11)
92 #define	VM_ENTRY_LOAD_PERF_GLOBAL_CTRL	(1 << 13)
93 #define	VM_ENTRY_LOAD_PAT		(1 << 14)
94 #define	VM_ENTRY_LOAD_EFER		(1 << 15)
95 
96 #endif
97