Path: blob/main/sys/amd64/vmm/intel/vmx_controls.h
39536 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2011 NetApp, Inc.4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728#ifndef _VMX_CONTROLS_H_29#define _VMX_CONTROLS_H_3031/* Pin-Based VM-Execution Controls */32#define PINBASED_EXTINT_EXITING (1 << 0)33#define PINBASED_NMI_EXITING (1 << 3)34#define PINBASED_VIRTUAL_NMI (1 << 5)35#define PINBASED_PREMPTION_TIMER (1 << 6)36#define PINBASED_POSTED_INTERRUPT (1 << 7)3738/* Primary Processor-Based VM-Execution Controls */39#define PROCBASED_INT_WINDOW_EXITING (1 << 2)40#define PROCBASED_TSC_OFFSET (1 << 3)41#define PROCBASED_HLT_EXITING (1 << 7)42#define PROCBASED_INVLPG_EXITING (1 << 9)43#define PROCBASED_MWAIT_EXITING (1 << 10)44#define PROCBASED_RDPMC_EXITING (1 << 11)45#define PROCBASED_RDTSC_EXITING (1 << 12)46#define PROCBASED_CR3_LOAD_EXITING (1 << 15)47#define PROCBASED_CR3_STORE_EXITING (1 << 16)48#define PROCBASED_CR8_LOAD_EXITING (1 << 19)49#define PROCBASED_CR8_STORE_EXITING (1 << 20)50#define PROCBASED_USE_TPR_SHADOW (1 << 21)51#define PROCBASED_NMI_WINDOW_EXITING (1 << 22)52#define PROCBASED_MOV_DR_EXITING (1 << 23)53#define PROCBASED_IO_EXITING (1 << 24)54#define PROCBASED_IO_BITMAPS (1 << 25)55#define PROCBASED_MTF (1 << 27)56#define PROCBASED_MSR_BITMAPS (1 << 28)57#define PROCBASED_MONITOR_EXITING (1 << 29)58#define PROCBASED_PAUSE_EXITING (1 << 30)59#define PROCBASED_SECONDARY_CONTROLS (1U << 31)6061/* Secondary Processor-Based VM-Execution Controls */62#define PROCBASED2_VIRTUALIZE_APIC_ACCESSES (1 << 0)63#define PROCBASED2_ENABLE_EPT (1 << 1)64#define PROCBASED2_DESC_TABLE_EXITING (1 << 2)65#define PROCBASED2_ENABLE_RDTSCP (1 << 3)66#define PROCBASED2_VIRTUALIZE_X2APIC_MODE (1 << 4)67#define PROCBASED2_ENABLE_VPID (1 << 5)68#define PROCBASED2_WBINVD_EXITING (1 << 6)69#define PROCBASED2_UNRESTRICTED_GUEST (1 << 7)70#define PROCBASED2_APIC_REGISTER_VIRTUALIZATION (1 << 8)71#define PROCBASED2_VIRTUAL_INTERRUPT_DELIVERY (1 << 9)72#define PROCBASED2_PAUSE_LOOP_EXITING (1 << 10)73#define PROCBASED2_ENABLE_INVPCID (1 << 12)7475/* VM Exit Controls */76#define VM_EXIT_SAVE_DEBUG_CONTROLS (1 << 2)77#define VM_EXIT_HOST_LMA (1 << 9)78#define VM_EXIT_LOAD_PERF_GLOBAL_CTRL (1 << 12)79#define VM_EXIT_ACKNOWLEDGE_INTERRUPT (1 << 15)80#define VM_EXIT_SAVE_PAT (1 << 18)81#define VM_EXIT_LOAD_PAT (1 << 19)82#define VM_EXIT_SAVE_EFER (1 << 20)83#define VM_EXIT_LOAD_EFER (1 << 21)84#define VM_EXIT_SAVE_PREEMPTION_TIMER (1 << 22)8586/* VM Entry Controls */87#define VM_ENTRY_LOAD_DEBUG_CONTROLS (1 << 2)88#define VM_ENTRY_GUEST_LMA (1 << 9)89#define VM_ENTRY_INTO_SMM (1 << 10)90#define VM_ENTRY_DEACTIVATE_DUAL_MONITOR (1 << 11)91#define VM_ENTRY_LOAD_PERF_GLOBAL_CTRL (1 << 13)92#define VM_ENTRY_LOAD_PAT (1 << 14)93#define VM_ENTRY_LOAD_EFER (1 << 15)9495#endif969798