arch/x86/kvm/vmx/vmx.h
Source file repositories/reference/linux-study-clean/arch/x86/kvm/vmx/vmx.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kvm/vmx/vmx.h- Extension
.h- Size
- 22499 bytes
- Lines
- 729
- 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
linux/kvm_host.hasm/kvm.hasm/intel_pt.hasm/perf_event.hasm/posted_intr.hcapabilities.h../regs.hpmu_intel.hvmcs.hvmx_ops.h../cpuid.h../mmu.hcommon.h
Detected Declarations
struct vmx_msrsstruct vmx_uret_msrstruct pt_ctxstruct pt_descstruct nested_vmxstruct vcpu_vmxstruct msr_autoloadstruct kvm_save_segmentstruct kvm_vmxenum segment_cache_fieldfunction vmx_get_exit_reasonfunction vmx_get_exit_qualfunction vmx_get_intr_infofunction vmx_disable_intercept_for_msrfunction vmx_enable_intercept_for_msrfunction vmx_guest_debugctl_writefunction vmx_guest_debugctl_readfunction vmx_reload_guest_debugctlfunction vmx_get_rvifunction BITfunction vmx_has_waitpkgfunction vmx_need_pf_interceptfunction is_unrestricted_guestfunction vmx_guest_state_validfunction vmx_get_instr_info_regfunction vmx_get_instr_info_reg2function vmx_can_use_ipivfunction vmx_segment_cache_clear
Annotated Snippet
struct vmx_msrs {
unsigned int nr;
struct vmx_msr_entry val[MAX_NR_LOADSTORE_MSRS];
};
struct vmx_uret_msr {
bool load_into_hardware;
u64 data;
u64 mask;
};
enum segment_cache_field {
SEG_FIELD_SEL = 0,
SEG_FIELD_BASE = 1,
SEG_FIELD_LIMIT = 2,
SEG_FIELD_AR = 3,
SEG_FIELD_NR = 4
};
#define RTIT_ADDR_RANGE 4
struct pt_ctx {
u64 ctl;
u64 status;
u64 output_base;
u64 output_mask;
u64 cr3_match;
u64 addr_a[RTIT_ADDR_RANGE];
u64 addr_b[RTIT_ADDR_RANGE];
};
struct pt_desc {
u64 ctl_bitmask;
u32 num_address_ranges;
u32 caps[PT_CPUID_REGS_NUM * PT_CPUID_LEAVES];
struct pt_ctx host;
struct pt_ctx guest;
};
/*
* The nested_vmx structure is part of vcpu_vmx, and holds information we need
* for correct emulation of VMX (i.e., nested VMX) on this vcpu.
*/
struct nested_vmx {
/* Has the level1 guest done vmxon? */
bool vmxon;
gpa_t vmxon_ptr;
bool pml_full;
/* The guest-physical address of the current VMCS L1 keeps for L2 */
gpa_t current_vmptr;
/*
* Cache of the guest's VMCS, existing outside of guest memory.
* Loaded from guest memory during VMPTRLD. Flushed to guest
* memory during VMCLEAR and VMPTRLD.
*/
struct vmcs12 *cached_vmcs12;
/*
* Cache of the guest's shadow VMCS, existing outside of guest
* memory. Loaded from guest memory during VM entry. Flushed
* to guest memory during VM exit.
*/
struct vmcs12 *cached_shadow_vmcs12;
/*
* GPA to HVA cache for accessing vmcs12->vmcs_link_pointer
*/
struct gfn_to_hva_cache shadow_vmcs12_cache;
/*
* GPA to HVA cache for VMCS12
*/
struct gfn_to_hva_cache vmcs12_cache;
/*
* Indicates if the shadow vmcs or enlightened vmcs must be updated
* with the data held by struct vmcs12.
*/
bool need_vmcs12_to_shadow_sync;
bool dirty_vmcs12;
/*
* Indicates whether MSR bitmap for L2 needs to be rebuilt due to
* changes in MSR bitmap for L1 or switching to a different L2. Note,
* this flag can only be used reliably in conjunction with a paravirt L1
* which informs L0 whether any changes to MSR bitmap for L2 were done
* on its side.
*/
bool force_msr_bitmap_recalc;
Annotation
- Immediate include surface: `linux/kvm_host.h`, `asm/kvm.h`, `asm/intel_pt.h`, `asm/perf_event.h`, `asm/posted_intr.h`, `capabilities.h`, `../regs.h`, `pmu_intel.h`.
- Detected declarations: `struct vmx_msrs`, `struct vmx_uret_msr`, `struct pt_ctx`, `struct pt_desc`, `struct nested_vmx`, `struct vcpu_vmx`, `struct msr_autoload`, `struct kvm_save_segment`, `struct kvm_vmx`, `enum segment_cache_field`.
- 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.