include/linux/kvm_host.h
Source file repositories/reference/linux-study-clean/include/linux/kvm_host.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/kvm_host.h- Extension
.h- Size
- 80635 bytes
- Lines
- 2619
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- 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.
- 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/entry-virt.hlinux/types.hlinux/hardirq.hlinux/list.hlinux/mutex.hlinux/spinlock.hlinux/signal.hlinux/sched.hlinux/sched/stat.hlinux/bug.hlinux/minmax.hlinux/mm.hlinux/mmu_notifier.hlinux/preempt.hlinux/msi.hlinux/slab.hlinux/vmalloc.hlinux/rcupdate.hlinux/ratelimit.hlinux/err.hlinux/irqflags.hlinux/context_tracking.hlinux/irqbypass.hlinux/rcuwait.hlinux/refcount.hlinux/nospec.hlinux/notifier.hlinux/ftrace.hlinux/hashtable.hlinux/instrumentation.hlinux/interval_tree.hlinux/rbtree.h
Detected Declarations
struct kvm_io_rangestruct kvm_io_busstruct kvm_async_pfstruct kvm_gfn_rangestruct kvm_host_mapstruct kvm_mmio_fragmentstruct kvm_vcpustruct kvm_memory_slotstruct kvm_s390_adapter_intstruct kvm_hv_sintstruct kvm_xen_evtchnstruct kvm_kernel_irq_routing_entrystruct kvm_irq_routing_tablestruct kvm_memslotsstruct kvmstruct kvm_memslot_iterstruct kvm_irq_ack_notifierstruct kvm_stat_datastruct kvm_devicestruct kvm_device_opsstruct kvm_kernel_irqfdenum kvm_busenum kvm_gfn_range_filterenum kvm_mr_changeenum kvm_stat_kindfunction is_error_pfnfunction is_sigpending_pfnfunction is_error_noslot_pfnfunction is_noslot_pfnfunction PAGE_OFFSETfunction kvm_is_error_gpafunction kvm_vcpu_mappedfunction kvm_vcpu_can_pollfunction guest_timing_enter_irqofffunction guest_context_enter_irqofffunction guest_state_enter_irqofffunction guest_timing_enter_irqofffunction guest_context_enter_irqofffunction guest_timing_exit_irqofffunction guest_timing_exit_irqofffunction guest_exitfunction guest_timing_exit_irqofffunction kvm_vcpu_exiting_guest_modefunction kvm_slot_has_gmemfunction kvm_slot_dirty_track_enabledfunction kvm_dirty_bitmap_bytesfunction kvm_arch_nr_memslot_as_idsfunction kvm_arch_vcpu_memslots_id
Annotated Snippet
struct kvm_io_range {
gpa_t addr;
int len;
struct kvm_io_device *dev;
};
#define NR_IOBUS_DEVS 1000
struct kvm_io_bus {
int dev_count;
int ioeventfd_count;
struct rcu_head rcu;
struct kvm_io_range range[];
};
enum kvm_bus {
KVM_MMIO_BUS,
KVM_PIO_BUS,
KVM_VIRTIO_CCW_NOTIFY_BUS,
KVM_FAST_MMIO_BUS,
KVM_IOCSR_BUS,
KVM_NR_BUSES
};
int kvm_io_bus_write(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx, gpa_t addr,
int len, const void *val);
int kvm_io_bus_write_cookie(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx,
gpa_t addr, int len, const void *val, long cookie);
int kvm_io_bus_read(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx, gpa_t addr,
int len, void *val);
int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
int len, struct kvm_io_device *dev);
int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
struct kvm_io_device *dev);
struct kvm_io_device *kvm_io_bus_get_dev(struct kvm *kvm, enum kvm_bus bus_idx,
gpa_t addr);
#ifdef CONFIG_KVM_ASYNC_PF
struct kvm_async_pf {
struct work_struct work;
struct list_head link;
struct list_head queue;
struct kvm_vcpu *vcpu;
gpa_t cr2_or_gpa;
unsigned long addr;
struct kvm_arch_async_pf arch;
bool wakeup_all;
bool notpresent_injected;
};
void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu);
void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu);
bool kvm_setup_async_pf(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
unsigned long hva, struct kvm_arch_async_pf *arch);
int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu);
#endif
union kvm_mmu_notifier_arg {
unsigned long attributes;
};
enum kvm_gfn_range_filter {
KVM_FILTER_SHARED = BIT(0),
KVM_FILTER_PRIVATE = BIT(1),
};
struct kvm_gfn_range {
struct kvm_memory_slot *slot;
gfn_t start;
gfn_t end;
union kvm_mmu_notifier_arg arg;
enum kvm_gfn_range_filter attr_filter;
bool may_block;
bool lockless;
};
bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range);
bool kvm_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range);
bool kvm_test_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range);
enum {
OUTSIDE_GUEST_MODE,
IN_GUEST_MODE,
EXITING_GUEST_MODE,
READING_SHADOW_PAGE_TABLES,
};
struct kvm_host_map {
/*
* Only valid if the 'pfn' is managed by the host kernel (i.e. There is
* a 'struct page' for it. When using mem= kernel parameter some memory
Annotation
- Immediate include surface: `linux/entry-virt.h`, `linux/types.h`, `linux/hardirq.h`, `linux/list.h`, `linux/mutex.h`, `linux/spinlock.h`, `linux/signal.h`, `linux/sched.h`.
- Detected declarations: `struct kvm_io_range`, `struct kvm_io_bus`, `struct kvm_async_pf`, `struct kvm_gfn_range`, `struct kvm_host_map`, `struct kvm_mmio_fragment`, `struct kvm_vcpu`, `struct kvm_memory_slot`, `struct kvm_s390_adapter_int`, `struct kvm_hv_sint`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source 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.
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.