tools/include/uapi/linux/kvm.h
Source file repositories/reference/linux-study-clean/tools/include/uapi/linux/kvm.h
File Facts
- System
- Linux kernel
- Corpus path
tools/include/uapi/linux/kvm.h- Extension
.h- Size
- 51194 bytes
- Lines
- 1664
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/const.hlinux/types.hlinux/compiler.hlinux/ioctl.hasm/kvm.hlinux/kvm_types.h
Detected Declarations
struct kvm_userspace_memory_regionstruct kvm_userspace_memory_region2struct kvm_irq_levelstruct kvm_irqchipstruct kvm_pit_configstruct kvm_hyperv_exitstruct kvm_xen_exitstruct kvm_exit_snp_req_certsstruct kvm_runstruct kvm_coalesced_mmio_zonestruct kvm_coalesced_mmiostruct kvm_coalesced_mmio_ringstruct kvm_translationstruct kvm_interruptstruct kvm_dirty_logstruct kvm_clear_dirty_logstruct kvm_signal_maskstruct kvm_tpr_access_ctlstruct kvm_vapic_addrstruct kvm_mp_statestruct kvm_guest_debugstruct kvm_ioeventfdstruct kvm_enable_capstruct kvm_irq_routing_irqchipstruct kvm_irq_routing_msistruct kvm_irq_routing_s390_adapterstruct kvm_irq_routing_hv_sintstruct kvm_irq_routing_xen_evtchnstruct kvm_irq_routing_entrystruct kvm_irq_routingstruct kvm_irqfdstruct kvm_clock_datastruct kvm_config_tlbstruct kvm_dirty_tlbstruct kvm_reg_liststruct kvm_one_regstruct kvm_msistruct kvm_arm_device_addrstruct kvm_create_devicestruct kvm_device_attrstruct kvm_vfio_spapr_tcestruct kvm_s390_keyopstruct kvm_enc_regionstruct kvm_dirty_gfnstruct kvm_stats_headerstruct kvm_stats_descstruct kvm_memory_attributesstruct kvm_create_guest_memfd
Annotated Snippet
struct kvm_userspace_memory_region {
__u32 slot;
__u32 flags;
__u64 guest_phys_addr;
__u64 memory_size; /* bytes */
__u64 userspace_addr; /* start of the userspace allocated memory */
};
/* for KVM_SET_USER_MEMORY_REGION2 */
struct kvm_userspace_memory_region2 {
__u32 slot;
__u32 flags;
__u64 guest_phys_addr;
__u64 memory_size;
__u64 userspace_addr;
__u64 guest_memfd_offset;
__u32 guest_memfd;
__u32 pad1;
__u64 pad2[14];
};
/*
* The bit 0 ~ bit 15 of kvm_userspace_memory_region::flags are visible for
* userspace, other bits are reserved for kvm internal use which are defined
* in include/linux/kvm_host.h.
*/
#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
#define KVM_MEM_READONLY (1UL << 1)
#define KVM_MEM_GUEST_MEMFD (1UL << 2)
/* for KVM_IRQ_LINE */
struct kvm_irq_level {
/*
* ACPI gsi notion of irq.
* For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47..
* For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23..
* For ARM: See Documentation/virt/kvm/api.rst
*/
union {
__u32 irq;
__s32 status;
};
__u32 level;
};
struct kvm_irqchip {
__u32 chip_id;
__u32 pad;
union {
char dummy[512]; /* reserving space */
#ifdef __KVM_HAVE_PIT
struct kvm_pic_state pic;
#endif
#ifdef __KVM_HAVE_IOAPIC
struct kvm_ioapic_state ioapic;
#endif
} chip;
};
/* for KVM_CREATE_PIT2 */
struct kvm_pit_config {
__u32 flags;
__u32 pad[15];
};
#define KVM_PIT_SPEAKER_DUMMY 1
struct kvm_hyperv_exit {
#define KVM_EXIT_HYPERV_SYNIC 1
#define KVM_EXIT_HYPERV_HCALL 2
#define KVM_EXIT_HYPERV_SYNDBG 3
__u32 type;
__u32 pad1;
union {
struct {
__u32 msr;
__u32 pad2;
__u64 control;
__u64 evt_page;
__u64 msg_page;
} synic;
struct {
__u64 input;
__u64 result;
__u64 params[2];
} hcall;
struct {
__u32 msr;
__u32 pad2;
Annotation
- Immediate include surface: `linux/const.h`, `linux/types.h`, `linux/compiler.h`, `linux/ioctl.h`, `asm/kvm.h`, `linux/kvm_types.h`.
- Detected declarations: `struct kvm_userspace_memory_region`, `struct kvm_userspace_memory_region2`, `struct kvm_irq_level`, `struct kvm_irqchip`, `struct kvm_pit_config`, `struct kvm_hyperv_exit`, `struct kvm_xen_exit`, `struct kvm_exit_snp_req_certs`, `struct kvm_run`, `struct kvm_coalesced_mmio_zone`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
- 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.