include/linux/kvm_types.h
Source file repositories/reference/linux-study-clean/include/linux/kvm_types.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/kvm_types.h- Extension
.h- Size
- 3532 bytes
- Lines
- 146
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bits.hlinux/export.hlinux/types.hasm/kvm_types.hlinux/mutex.hlinux/spinlock_types.h
Detected Declarations
struct kvmstruct kvm_async_pfstruct kvm_device_opsstruct kvm_gfn_rangestruct kvm_interruptstruct kvm_irq_routing_tablestruct kvm_memory_slotstruct kvm_one_regstruct kvm_runstruct kvm_userspace_memory_regionstruct kvm_vcpustruct kvm_vcpu_initstruct kvm_memslotsstruct gfn_to_hva_cachestruct gfn_to_pfn_cachestruct kvm_mmu_memory_cachestruct kvm_vm_stat_genericstruct kvm_vcpu_stat_genericenum kvm_mr_change
Annotated Snippet
struct gfn_to_hva_cache {
u64 generation;
gpa_t gpa;
unsigned long hva;
unsigned long len;
struct kvm_memory_slot *memslot;
};
struct gfn_to_pfn_cache {
u64 generation;
gpa_t gpa;
unsigned long uhva;
struct kvm_memory_slot *memslot;
struct kvm *kvm;
struct list_head list;
rwlock_t lock;
struct mutex refresh_lock;
void *khva;
kvm_pfn_t pfn;
bool active;
bool valid;
};
#ifdef KVM_ARCH_NR_OBJS_PER_MEMORY_CACHE
/*
* Memory caches are used to preallocate memory ahead of various MMU flows,
* e.g. page fault handlers. Gracefully handling allocation failures deep in
* MMU flows is problematic, as is triggering reclaim, I/O, etc... while
* holding MMU locks. Note, these caches act more like prefetch buffers than
* classical caches, i.e. objects are not returned to the cache on being freed.
*
* The @capacity field and @objects array are lazily initialized when the cache
* is topped up (__kvm_mmu_topup_memory_cache()).
*/
struct kvm_mmu_memory_cache {
gfp_t gfp_zero;
gfp_t gfp_custom;
u64 init_value;
struct kmem_cache *kmem_cache;
int capacity;
int nobjs;
void **objects;
};
#endif
#define HALT_POLL_HIST_COUNT 32
struct kvm_vm_stat_generic {
u64 remote_tlb_flush;
u64 remote_tlb_flush_requests;
};
struct kvm_vcpu_stat_generic {
u64 halt_successful_poll;
u64 halt_attempted_poll;
u64 halt_poll_invalid;
u64 halt_wakeup;
u64 halt_poll_success_ns;
u64 halt_poll_fail_ns;
u64 halt_wait_ns;
u64 halt_poll_success_hist[HALT_POLL_HIST_COUNT];
u64 halt_poll_fail_hist[HALT_POLL_HIST_COUNT];
u64 halt_wait_hist[HALT_POLL_HIST_COUNT];
u64 blocking;
};
#define KVM_STATS_NAME_SIZE 48
#endif /* !__ASSEMBLER__ */
#endif /* __KVM_TYPES_H__ */
Annotation
- Immediate include surface: `linux/bits.h`, `linux/export.h`, `linux/types.h`, `asm/kvm_types.h`, `linux/mutex.h`, `linux/spinlock_types.h`.
- Detected declarations: `struct kvm`, `struct kvm_async_pf`, `struct kvm_device_ops`, `struct kvm_gfn_range`, `struct kvm_interrupt`, `struct kvm_irq_routing_table`, `struct kvm_memory_slot`, `struct kvm_one_reg`, `struct kvm_run`, `struct kvm_userspace_memory_region`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: integration 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.