162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci#ifndef _ASM_X86_VMXFEATURES_H 362306a36Sopenharmony_ci#define _ASM_X86_VMXFEATURES_H 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci/* 662306a36Sopenharmony_ci * Defines VMX CPU feature bits 762306a36Sopenharmony_ci */ 862306a36Sopenharmony_ci#define NVMXINTS 5 /* N 32-bit words worth of info */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci/* 1162306a36Sopenharmony_ci * Note: If the comment begins with a quoted string, that string is used 1262306a36Sopenharmony_ci * in /proc/cpuinfo instead of the macro name. If the string is "", 1362306a36Sopenharmony_ci * this feature bit is not displayed in /proc/cpuinfo at all. 1462306a36Sopenharmony_ci */ 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci/* Pin-Based VM-Execution Controls, EPT/VPID, APIC and VM-Functions, word 0 */ 1762306a36Sopenharmony_ci#define VMX_FEATURE_INTR_EXITING ( 0*32+ 0) /* "" VM-Exit on vectored interrupts */ 1862306a36Sopenharmony_ci#define VMX_FEATURE_NMI_EXITING ( 0*32+ 3) /* "" VM-Exit on NMIs */ 1962306a36Sopenharmony_ci#define VMX_FEATURE_VIRTUAL_NMIS ( 0*32+ 5) /* "vnmi" NMI virtualization */ 2062306a36Sopenharmony_ci#define VMX_FEATURE_PREEMPTION_TIMER ( 0*32+ 6) /* VMX Preemption Timer */ 2162306a36Sopenharmony_ci#define VMX_FEATURE_POSTED_INTR ( 0*32+ 7) /* Posted Interrupts */ 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci/* EPT/VPID features, scattered to bits 16-23 */ 2462306a36Sopenharmony_ci#define VMX_FEATURE_INVVPID ( 0*32+ 16) /* INVVPID is supported */ 2562306a36Sopenharmony_ci#define VMX_FEATURE_EPT_EXECUTE_ONLY ( 0*32+ 17) /* "ept_x_only" EPT entries can be execute only */ 2662306a36Sopenharmony_ci#define VMX_FEATURE_EPT_AD ( 0*32+ 18) /* EPT Accessed/Dirty bits */ 2762306a36Sopenharmony_ci#define VMX_FEATURE_EPT_1GB ( 0*32+ 19) /* 1GB EPT pages */ 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci/* Aggregated APIC features 24-27 */ 3062306a36Sopenharmony_ci#define VMX_FEATURE_FLEXPRIORITY ( 0*32+ 24) /* TPR shadow + virt APIC */ 3162306a36Sopenharmony_ci#define VMX_FEATURE_APICV ( 0*32+ 25) /* TPR shadow + APIC reg virt + virt intr delivery + posted interrupts */ 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci/* VM-Functions, shifted to bits 28-31 */ 3462306a36Sopenharmony_ci#define VMX_FEATURE_EPTP_SWITCHING ( 0*32+ 28) /* EPTP switching (in guest) */ 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci/* Primary Processor-Based VM-Execution Controls, word 1 */ 3762306a36Sopenharmony_ci#define VMX_FEATURE_INTR_WINDOW_EXITING ( 1*32+ 2) /* "" VM-Exit if INTRs are unblocked in guest */ 3862306a36Sopenharmony_ci#define VMX_FEATURE_USE_TSC_OFFSETTING ( 1*32+ 3) /* "tsc_offset" Offset hardware TSC when read in guest */ 3962306a36Sopenharmony_ci#define VMX_FEATURE_HLT_EXITING ( 1*32+ 7) /* "" VM-Exit on HLT */ 4062306a36Sopenharmony_ci#define VMX_FEATURE_INVLPG_EXITING ( 1*32+ 9) /* "" VM-Exit on INVLPG */ 4162306a36Sopenharmony_ci#define VMX_FEATURE_MWAIT_EXITING ( 1*32+ 10) /* "" VM-Exit on MWAIT */ 4262306a36Sopenharmony_ci#define VMX_FEATURE_RDPMC_EXITING ( 1*32+ 11) /* "" VM-Exit on RDPMC */ 4362306a36Sopenharmony_ci#define VMX_FEATURE_RDTSC_EXITING ( 1*32+ 12) /* "" VM-Exit on RDTSC */ 4462306a36Sopenharmony_ci#define VMX_FEATURE_CR3_LOAD_EXITING ( 1*32+ 15) /* "" VM-Exit on writes to CR3 */ 4562306a36Sopenharmony_ci#define VMX_FEATURE_CR3_STORE_EXITING ( 1*32+ 16) /* "" VM-Exit on reads from CR3 */ 4662306a36Sopenharmony_ci#define VMX_FEATURE_TERTIARY_CONTROLS ( 1*32+ 17) /* "" Enable Tertiary VM-Execution Controls */ 4762306a36Sopenharmony_ci#define VMX_FEATURE_CR8_LOAD_EXITING ( 1*32+ 19) /* "" VM-Exit on writes to CR8 */ 4862306a36Sopenharmony_ci#define VMX_FEATURE_CR8_STORE_EXITING ( 1*32+ 20) /* "" VM-Exit on reads from CR8 */ 4962306a36Sopenharmony_ci#define VMX_FEATURE_VIRTUAL_TPR ( 1*32+ 21) /* "vtpr" TPR virtualization, a.k.a. TPR shadow */ 5062306a36Sopenharmony_ci#define VMX_FEATURE_NMI_WINDOW_EXITING ( 1*32+ 22) /* "" VM-Exit if NMIs are unblocked in guest */ 5162306a36Sopenharmony_ci#define VMX_FEATURE_MOV_DR_EXITING ( 1*32+ 23) /* "" VM-Exit on accesses to debug registers */ 5262306a36Sopenharmony_ci#define VMX_FEATURE_UNCOND_IO_EXITING ( 1*32+ 24) /* "" VM-Exit on *all* IN{S} and OUT{S}*/ 5362306a36Sopenharmony_ci#define VMX_FEATURE_USE_IO_BITMAPS ( 1*32+ 25) /* "" VM-Exit based on I/O port */ 5462306a36Sopenharmony_ci#define VMX_FEATURE_MONITOR_TRAP_FLAG ( 1*32+ 27) /* "mtf" VMX single-step VM-Exits */ 5562306a36Sopenharmony_ci#define VMX_FEATURE_USE_MSR_BITMAPS ( 1*32+ 28) /* "" VM-Exit based on MSR index */ 5662306a36Sopenharmony_ci#define VMX_FEATURE_MONITOR_EXITING ( 1*32+ 29) /* "" VM-Exit on MONITOR (MWAIT's accomplice) */ 5762306a36Sopenharmony_ci#define VMX_FEATURE_PAUSE_EXITING ( 1*32+ 30) /* "" VM-Exit on PAUSE (unconditionally) */ 5862306a36Sopenharmony_ci#define VMX_FEATURE_SEC_CONTROLS ( 1*32+ 31) /* "" Enable Secondary VM-Execution Controls */ 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci/* Secondary Processor-Based VM-Execution Controls, word 2 */ 6162306a36Sopenharmony_ci#define VMX_FEATURE_VIRT_APIC_ACCESSES ( 2*32+ 0) /* "vapic" Virtualize memory mapped APIC accesses */ 6262306a36Sopenharmony_ci#define VMX_FEATURE_EPT ( 2*32+ 1) /* Extended Page Tables, a.k.a. Two-Dimensional Paging */ 6362306a36Sopenharmony_ci#define VMX_FEATURE_DESC_EXITING ( 2*32+ 2) /* "" VM-Exit on {S,L}*DT instructions */ 6462306a36Sopenharmony_ci#define VMX_FEATURE_RDTSCP ( 2*32+ 3) /* "" Enable RDTSCP in guest */ 6562306a36Sopenharmony_ci#define VMX_FEATURE_VIRTUAL_X2APIC ( 2*32+ 4) /* "" Virtualize X2APIC for the guest */ 6662306a36Sopenharmony_ci#define VMX_FEATURE_VPID ( 2*32+ 5) /* Virtual Processor ID (TLB ASID modifier) */ 6762306a36Sopenharmony_ci#define VMX_FEATURE_WBINVD_EXITING ( 2*32+ 6) /* "" VM-Exit on WBINVD */ 6862306a36Sopenharmony_ci#define VMX_FEATURE_UNRESTRICTED_GUEST ( 2*32+ 7) /* Allow Big Real Mode and other "invalid" states */ 6962306a36Sopenharmony_ci#define VMX_FEATURE_APIC_REGISTER_VIRT ( 2*32+ 8) /* "vapic_reg" Hardware emulation of reads to the virtual-APIC */ 7062306a36Sopenharmony_ci#define VMX_FEATURE_VIRT_INTR_DELIVERY ( 2*32+ 9) /* "vid" Evaluation and delivery of pending virtual interrupts */ 7162306a36Sopenharmony_ci#define VMX_FEATURE_PAUSE_LOOP_EXITING ( 2*32+ 10) /* "ple" Conditionally VM-Exit on PAUSE at CPL0 */ 7262306a36Sopenharmony_ci#define VMX_FEATURE_RDRAND_EXITING ( 2*32+ 11) /* "" VM-Exit on RDRAND*/ 7362306a36Sopenharmony_ci#define VMX_FEATURE_INVPCID ( 2*32+ 12) /* "" Enable INVPCID in guest */ 7462306a36Sopenharmony_ci#define VMX_FEATURE_VMFUNC ( 2*32+ 13) /* "" Enable VM-Functions (leaf dependent) */ 7562306a36Sopenharmony_ci#define VMX_FEATURE_SHADOW_VMCS ( 2*32+ 14) /* VMREAD/VMWRITE in guest can access shadow VMCS */ 7662306a36Sopenharmony_ci#define VMX_FEATURE_ENCLS_EXITING ( 2*32+ 15) /* "" VM-Exit on ENCLS (leaf dependent) */ 7762306a36Sopenharmony_ci#define VMX_FEATURE_RDSEED_EXITING ( 2*32+ 16) /* "" VM-Exit on RDSEED */ 7862306a36Sopenharmony_ci#define VMX_FEATURE_PAGE_MOD_LOGGING ( 2*32+ 17) /* "pml" Log dirty pages into buffer */ 7962306a36Sopenharmony_ci#define VMX_FEATURE_EPT_VIOLATION_VE ( 2*32+ 18) /* "" Conditionally reflect EPT violations as #VE exceptions */ 8062306a36Sopenharmony_ci#define VMX_FEATURE_PT_CONCEAL_VMX ( 2*32+ 19) /* "" Suppress VMX indicators in Processor Trace */ 8162306a36Sopenharmony_ci#define VMX_FEATURE_XSAVES ( 2*32+ 20) /* "" Enable XSAVES and XRSTORS in guest */ 8262306a36Sopenharmony_ci#define VMX_FEATURE_MODE_BASED_EPT_EXEC ( 2*32+ 22) /* "ept_mode_based_exec" Enable separate EPT EXEC bits for supervisor vs. user */ 8362306a36Sopenharmony_ci#define VMX_FEATURE_PT_USE_GPA ( 2*32+ 24) /* "" Processor Trace logs GPAs */ 8462306a36Sopenharmony_ci#define VMX_FEATURE_TSC_SCALING ( 2*32+ 25) /* Scale hardware TSC when read in guest */ 8562306a36Sopenharmony_ci#define VMX_FEATURE_USR_WAIT_PAUSE ( 2*32+ 26) /* Enable TPAUSE, UMONITOR, UMWAIT in guest */ 8662306a36Sopenharmony_ci#define VMX_FEATURE_ENCLV_EXITING ( 2*32+ 28) /* "" VM-Exit on ENCLV (leaf dependent) */ 8762306a36Sopenharmony_ci#define VMX_FEATURE_BUS_LOCK_DETECTION ( 2*32+ 30) /* "" VM-Exit when bus lock caused */ 8862306a36Sopenharmony_ci#define VMX_FEATURE_NOTIFY_VM_EXITING ( 2*32+ 31) /* VM-Exit when no event windows after notify window */ 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci/* Tertiary Processor-Based VM-Execution Controls, word 3 */ 9162306a36Sopenharmony_ci#define VMX_FEATURE_IPI_VIRT ( 3*32+ 4) /* Enable IPI virtualization */ 9262306a36Sopenharmony_ci#endif /* _ASM_X86_VMXFEATURES_H */ 93