arch/x86/kvm/vmx/capabilities.h
Source file repositories/reference/linux-study-clean/arch/x86/kvm/vmx/capabilities.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kvm/vmx/capabilities.h- Extension
.h- Size
- 9824 bytes
- Lines
- 418
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/vmx.h../lapic.h../x86.h../pmu.h../cpuid.h
Detected Declarations
struct nested_vmx_msrsstruct vmcs_configstruct vmx_capabilityfunction cpu_has_vmx_basic_inoutfunction cpu_has_vmx_basic_no_hw_errcode_ccfunction cpu_has_virtual_nmisfunction cpu_has_vmx_preemption_timerfunction cpu_has_vmx_posted_intrfunction cpu_has_load_ia32_eferfunction cpu_has_load_perf_global_ctrlfunction cpu_has_load_cet_ctrlfunction cpu_has_save_perf_global_ctrlfunction cpu_has_vmx_mpxfunction cpu_has_vmx_tpr_shadowfunction cpu_need_tpr_shadowfunction cpu_has_vmx_msr_bitmapfunction cpu_has_secondary_exec_ctrlsfunction cpu_has_tertiary_exec_ctrlsfunction cpu_has_vmx_virtualize_apic_accessesfunction cpu_has_vmx_eptfunction vmx_umip_emulatedfunction cpu_has_vmx_rdtscpfunction cpu_has_vmx_virtualize_x2apic_modefunction cpu_has_vmx_vpidfunction cpu_has_vmx_wbinvd_exitfunction cpu_has_vmx_unrestricted_guestfunction cpu_has_vmx_apic_register_virtfunction cpu_has_vmx_virtual_intr_deliveryfunction cpu_has_vmx_plefunction cpu_has_vmx_rdrandfunction cpu_has_vmx_invpcidfunction cpu_has_vmx_vmfuncfunction cpu_has_vmx_shadow_vmcsfunction cpu_has_vmx_encls_vmexitfunction cpu_has_vmx_rdseedfunction cpu_has_vmx_pmlfunction cpu_has_vmx_xsavesfunction cpu_has_vmx_waitpkgfunction cpu_has_vmx_tsc_scalingfunction cpu_has_vmx_bus_lock_detectionfunction cpu_has_vmx_apicvfunction cpu_has_vmx_ipivfunction cpu_has_vmx_flexpriorityfunction cpu_has_vmx_ept_4levelsfunction cpu_has_vmx_ept_5levelsfunction cpu_has_vmx_ept_mt_wbfunction cpu_has_vmx_ept_2m_pagefunction cpu_has_vmx_ept_1g_page
Annotated Snippet
struct nested_vmx_msrs {
/*
* We only store the "true" versions of the VMX capability MSRs. We
* generate the "non-true" versions by setting the must-be-1 bits
* according to the SDM.
*/
u32 procbased_ctls_low;
u32 procbased_ctls_high;
u32 secondary_ctls_low;
u32 secondary_ctls_high;
u32 pinbased_ctls_low;
u32 pinbased_ctls_high;
u32 exit_ctls_low;
u32 exit_ctls_high;
u32 entry_ctls_low;
u32 entry_ctls_high;
u32 misc_low;
u32 misc_high;
u32 ept_caps;
u32 vpid_caps;
u64 basic;
u64 cr0_fixed0;
u64 cr0_fixed1;
u64 cr4_fixed0;
u64 cr4_fixed1;
u64 vmcs_enum;
u64 vmfunc_controls;
};
struct vmcs_config {
u64 basic;
u32 pin_based_exec_ctrl;
u32 cpu_based_exec_ctrl;
u32 cpu_based_2nd_exec_ctrl;
u64 cpu_based_3rd_exec_ctrl;
u32 vmexit_ctrl;
u32 vmentry_ctrl;
u64 misc;
struct nested_vmx_msrs nested;
};
extern struct vmcs_config vmcs_config __ro_after_init;
struct vmx_capability {
u32 ept;
u32 vpid;
};
extern struct vmx_capability vmx_capability __ro_after_init;
static inline bool cpu_has_vmx_basic_inout(void)
{
return vmcs_config.basic & VMX_BASIC_INOUT;
}
static inline bool cpu_has_vmx_basic_no_hw_errcode_cc(void)
{
return vmcs_config.basic & VMX_BASIC_NO_HW_ERROR_CODE_CC;
}
static inline bool cpu_has_virtual_nmis(void)
{
return vmcs_config.pin_based_exec_ctrl & PIN_BASED_VIRTUAL_NMIS &&
vmcs_config.cpu_based_exec_ctrl & CPU_BASED_NMI_WINDOW_EXITING;
}
static inline bool cpu_has_vmx_preemption_timer(void)
{
return vmcs_config.pin_based_exec_ctrl &
PIN_BASED_VMX_PREEMPTION_TIMER;
}
static inline bool cpu_has_vmx_posted_intr(void)
{
return vmcs_config.pin_based_exec_ctrl & PIN_BASED_POSTED_INTR;
}
static inline bool cpu_has_load_ia32_efer(void)
{
return vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_IA32_EFER;
}
static inline bool cpu_has_load_perf_global_ctrl(void)
{
return vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
}
static inline bool cpu_has_load_cet_ctrl(void)
{
return vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_CET_STATE;
}
Annotation
- Immediate include surface: `asm/vmx.h`, `../lapic.h`, `../x86.h`, `../pmu.h`, `../cpuid.h`.
- Detected declarations: `struct nested_vmx_msrs`, `struct vmcs_config`, `struct vmx_capability`, `function cpu_has_vmx_basic_inout`, `function cpu_has_vmx_basic_no_hw_errcode_cc`, `function cpu_has_virtual_nmis`, `function cpu_has_vmx_preemption_timer`, `function cpu_has_vmx_posted_intr`, `function cpu_has_load_ia32_efer`, `function cpu_has_load_perf_global_ctrl`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.