arch/x86/kvm/x86.c
Source file repositories/reference/linux-study-clean/arch/x86/kvm/x86.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kvm/x86.c- Extension
.c- Size
- 403091 bytes
- Lines
- 14519
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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_host.hirq.hioapic.hmmu.hi8254.htss.hregs.hkvm_emulate.hmmu/page_track.hx86.hcpuid.hpmu.hhyperv.hlapic.hxen.hsmm.hlinux/clocksource.hlinux/interrupt.hlinux/kvm.hlinux/fs.hlinux/vmalloc.hlinux/export.hlinux/moduleparam.hlinux/mman.hlinux/highmem.hlinux/iommu.hlinux/cpufreq.hlinux/user-return-notifier.hlinux/srcu.hlinux/slab.hlinux/perf_event.hlinux/uaccess.h
Detected Declarations
struct kvm_user_return_msrsstruct kvm_user_return_msr_valuesstruct pvclock_clockstruct pvclock_gtod_datastruct kvm_x86_reg_idstruct kvm_msr_filter_range_compatstruct kvm_msr_filter_compatstruct read_write_emulator_opsfunction kvm_is_immutable_feature_msrfunction kvm_is_advertised_msrfunction kvm_do_msr_accessfunction kvm_destroy_user_return_msrsfunction kvm_on_user_returnfunction kvm_probe_user_return_msrfunction kvm_add_user_return_msrfunction kvm_find_user_return_msrfunction kvm_user_return_msr_cpu_onlinefunction kvm_user_return_register_notifierfunction kvm_set_user_return_msrfunction kvm_get_user_return_msrfunction drop_user_return_notifiersfunction kvm_spurious_faultfunction exception_classfunction exception_typefunction kvm_deliver_exception_payloadfunction kvm_queue_exception_vmexitfunction kvm_multiple_exceptionfunction kvm_queue_exceptionfunction kvm_queue_exception_pfunction kvm_queue_exception_e_pfunction kvm_requeue_exceptionfunction kvm_complete_insn_gpfunction complete_emulated_insn_gpfunction kvm_inject_page_faultfunction __kvm_inject_emulated_page_faultfunction kvm_inject_nmifunction kvm_queue_exception_efunction kvm_require_drfunction pdptr_rsvd_bitsfunction load_pdptrsfunction kvm_is_valid_cr0function kvm_post_set_cr0function kvm_set_cr0function kvm_lmswfunction kvm_load_xfeaturesfunction kvm_load_guest_pkrufunction kvm_load_host_pkrufunction kvm_guest_supported_xfd
Annotated Snippet
module_init(kvm_x86_init);
static void __exit kvm_x86_exit(void)
{
WARN_ON_ONCE(static_branch_unlikely(&kvm_has_noapic_vcpu));
}
module_exit(kvm_x86_exit);
Annotation
- Immediate include surface: `linux/kvm_host.h`, `irq.h`, `ioapic.h`, `mmu.h`, `i8254.h`, `tss.h`, `regs.h`, `kvm_emulate.h`.
- Detected declarations: `struct kvm_user_return_msrs`, `struct kvm_user_return_msr_values`, `struct pvclock_clock`, `struct pvclock_gtod_data`, `struct kvm_x86_reg_id`, `struct kvm_msr_filter_range_compat`, `struct kvm_msr_filter_compat`, `struct read_write_emulator_ops`, `function kvm_is_immutable_feature_msr`, `function kvm_is_advertised_msr`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.