arch/x86/kvm/svm/svm.h
Source file repositories/reference/linux-study-clean/arch/x86/kvm/svm/svm.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kvm/svm/svm.h- Extension
.h- Size
- 31521 bytes
- Lines
- 1091
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kvm_types.hlinux/kvm_host.hlinux/bits.hasm/svm.hasm/sev-common.hcpuid.hregs.hx86.hpmu.h
Detected Declarations
struct kvm_sev_infostruct kvm_svmstruct kvm_vcpustruct kvm_vmcb_infostruct vmcb_save_area_cachedstruct vmcb_ctrl_area_cachedstruct svm_nested_statestruct vcpu_sev_es_statestruct vcpu_svmstruct svm_cpu_datafunction Copyrightfunction ____sev_guestfunction ____sev_es_guestfunction ____sev_snp_guestfunction is_sev_guestfunction is_sev_es_guestfunction is_sev_snp_guestfunction is_sev_guestfunction is_sev_es_guestfunction is_sev_snp_guestfunction ghcb_gpa_is_registeredfunction vmcb_mark_all_dirtyfunction vmcb_mark_all_cleanfunction vmcb_mark_dirtyfunction vmcb12_is_dirtyfunction vmcb_set_gpatfunction svm_is_vmrun_failurefunction __vmcb_set_interceptfunction __vmcb_clr_interceptfunction __vmcb_is_interceptfunction vmcb_set_interceptfunction vmcb_clr_interceptfunction vmcb_is_interceptfunction vmcb12_clr_interceptfunction vmcb12_is_interceptfunction svm_mark_intercepts_dirtyfunction set_exception_interceptfunction clr_exception_interceptfunction svm_set_interceptfunction svm_clr_interceptfunction svm_is_interceptfunction nested_vgif_enabledfunction enable_giffunction disable_giffunction gif_setfunction nested_npt_enabledfunction l2_has_separate_patfunction nested_vnmi_enabled
Annotated Snippet
struct kvm_sev_info {
bool active; /* SEV enabled guest */
bool es_active; /* SEV-ES enabled guest */
bool need_init; /* waiting for SEV_INIT2 */
unsigned int asid; /* ASID used for this guest */
unsigned int handle; /* SEV firmware handle */
int fd; /* SEV device fd */
unsigned long policy;
unsigned long pages_locked; /* Number of pages locked */
struct list_head regions_list; /* List of registered regions */
u64 ap_jump_table; /* SEV-ES AP Jump Table address */
u64 vmsa_features;
u16 ghcb_version; /* Highest guest GHCB protocol version allowed */
struct kvm *enc_context_owner; /* Owner of copied encryption context */
struct list_head mirror_vms; /* List of VMs mirroring */
struct list_head mirror_entry; /* Use as a list entry of mirrors */
struct misc_cg *misc_cg; /* For misc cgroup accounting */
atomic_t migration_in_progress;
void *snp_context; /* SNP guest context page */
void *guest_req_buf; /* Bounce buffer for SNP Guest Request input */
void *guest_resp_buf; /* Bounce buffer for SNP Guest Request output */
struct mutex guest_req_mutex; /* Must acquire before using bounce buffers */
cpumask_var_t have_run_cpus; /* CPUs that have done VMRUN for this VM. */
bool snp_certs_enabled; /* SNP certificate-fetching support. */
};
#endif
struct kvm_svm {
struct kvm kvm;
/* Struct members for AVIC */
u32 avic_vm_id;
u32 *avic_logical_id_table;
u64 *avic_physical_id_table;
struct hlist_node hnode;
#ifdef CONFIG_KVM_AMD_SEV
struct kvm_sev_info sev_info;
#endif
};
struct kvm_vcpu;
struct kvm_vmcb_info {
struct vmcb *ptr;
unsigned long pa;
int cpu;
uint64_t asid_generation;
};
struct vmcb_save_area_cached {
struct vmcb_seg es;
struct vmcb_seg cs;
struct vmcb_seg ss;
struct vmcb_seg ds;
struct vmcb_seg gdtr;
struct vmcb_seg idtr;
u8 cpl;
u64 efer;
u64 cr4;
u64 cr3;
u64 cr0;
u64 dr7;
u64 dr6;
u64 rflags;
u64 rip;
u64 rsp;
u64 s_cet;
u64 ssp;
u64 isst_addr;
u64 rax;
u64 cr2;
u64 g_pat;
u64 dbgctl;
u64 br_from;
u64 br_to;
u64 last_excp_from;
u64 last_excp_to;
};
struct vmcb_ctrl_area_cached {
u32 intercepts[MAX_INTERCEPT];
u16 pause_filter_thresh;
u16 pause_filter_count;
u64 iopm_base_pa;
u64 msrpm_base_pa;
u64 tsc_offset;
u32 asid;
u8 tlb_ctl;
u8 erap_ctl;
Annotation
- Immediate include surface: `linux/kvm_types.h`, `linux/kvm_host.h`, `linux/bits.h`, `asm/svm.h`, `asm/sev-common.h`, `cpuid.h`, `regs.h`, `x86.h`.
- Detected declarations: `struct kvm_sev_info`, `struct kvm_svm`, `struct kvm_vcpu`, `struct kvm_vmcb_info`, `struct vmcb_save_area_cached`, `struct vmcb_ctrl_area_cached`, `struct svm_nested_state`, `struct vcpu_sev_es_state`, `struct vcpu_svm`, `struct svm_cpu_data`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.