drivers/hv/mshv_root.h
Source file repositories/reference/linux-study-clean/drivers/hv/mshv_root.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/hv/mshv_root.h- Extension
.h- Size
- 12745 bytes
- Lines
- 382
- Domain
- Driver Families
- Bucket
- drivers/hv
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/spinlock.hlinux/mutex.hlinux/semaphore.hlinux/sched.hlinux/srcu.hlinux/wait.hlinux/hashtable.hlinux/dev_printk.hlinux/build_bug.hlinux/mmu_notifier.huapi/linux/mshv.hmshv_trace.h
Detected Declarations
struct mshv_vpstruct mshv_mem_regionstruct mshv_irq_ack_notifierstruct mshv_partitionstruct mshv_lapic_irqstruct mshv_guest_irq_entstruct mshv_girq_routing_tablestruct hv_synic_pagesstruct mshv_rootstruct port_table_infoenum mshv_region_typefunction mshv_partition_encryptedfunction is_l1vh_parentfunction mshv_debugfs_initfunction mshv_debugfs_exitfunction mshv_debugfs_partition_removefunction mshv_debugfs_vp_remove
Annotated Snippet
struct mshv_vp {
u32 vp_index;
struct mshv_partition *vp_partition;
struct mutex vp_mutex;
struct hv_vp_register_page *vp_register_page;
struct hv_message *vp_intercept_msg_page;
void *vp_ghcb_page;
struct hv_stats_page *vp_stats_pages[2];
struct {
atomic64_t vp_signaled_count;
struct {
u64 intercept_suspend: 1;
u64 root_sched_blocked: 1; /* root scheduler only */
u64 root_sched_dispatched: 1; /* root scheduler only */
u64 reserved: 61;
} flags;
unsigned int kicked_by_hv;
wait_queue_head_t vp_suspend_queue;
} run;
#if IS_ENABLED(CONFIG_DEBUG_FS)
struct dentry *vp_stats_dentry;
#endif
};
#define vp_fmt(fmt) "p%lluvp%u: " fmt
#define vp_devprintk(level, v, fmt, ...) \
do { \
const struct mshv_vp *__vp = (v); \
const struct mshv_partition *__pt = __vp->vp_partition; \
dev_##level(__pt->pt_module_dev, vp_fmt(fmt), __pt->pt_id, \
__vp->vp_index, ##__VA_ARGS__); \
} while (0)
#define vp_emerg(v, fmt, ...) vp_devprintk(emerg, v, fmt, ##__VA_ARGS__)
#define vp_crit(v, fmt, ...) vp_devprintk(crit, v, fmt, ##__VA_ARGS__)
#define vp_alert(v, fmt, ...) vp_devprintk(alert, v, fmt, ##__VA_ARGS__)
#define vp_err(v, fmt, ...) vp_devprintk(err, v, fmt, ##__VA_ARGS__)
#define vp_warn(v, fmt, ...) vp_devprintk(warn, v, fmt, ##__VA_ARGS__)
#define vp_notice(v, fmt, ...) vp_devprintk(notice, v, fmt, ##__VA_ARGS__)
#define vp_info(v, fmt, ...) vp_devprintk(info, v, fmt, ##__VA_ARGS__)
#define vp_dbg(v, fmt, ...) vp_devprintk(dbg, v, fmt, ##__VA_ARGS__)
enum mshv_region_type {
MSHV_REGION_TYPE_MEM_PINNED,
MSHV_REGION_TYPE_MEM_MOVABLE,
MSHV_REGION_TYPE_MMIO
};
struct mshv_mem_region {
struct hlist_node hnode;
struct kref mreg_refcount;
u64 nr_pages;
u64 start_gfn;
u64 start_uaddr;
u32 hv_map_flags;
struct mshv_partition *partition;
enum mshv_region_type mreg_type;
struct mmu_interval_notifier mreg_mni;
struct mutex mreg_mutex; /* protects region pages remapping */
struct page *mreg_pages[];
};
struct mshv_irq_ack_notifier {
struct hlist_node link;
unsigned int irq_ack_gsi;
void (*irq_acked)(struct mshv_irq_ack_notifier *mian);
};
struct mshv_partition {
struct device *pt_module_dev;
struct hlist_node pt_hnode;
u64 pt_id;
refcount_t pt_ref_count;
struct mutex pt_mutex;
spinlock_t pt_mem_regions_lock;
struct hlist_head pt_mem_regions; // not ordered
u32 pt_vp_count;
struct mshv_vp *pt_vp_array[MSHV_MAX_VPS];
struct mutex pt_irq_lock;
struct srcu_struct pt_irq_srcu;
struct hlist_head irq_ack_notifier_list;
struct hlist_head pt_devices;
/*
* MSHV does not support more than one async hypercall in flight
* for a single partition. Thus, it is okay to define per partition
Annotation
- Immediate include surface: `linux/spinlock.h`, `linux/mutex.h`, `linux/semaphore.h`, `linux/sched.h`, `linux/srcu.h`, `linux/wait.h`, `linux/hashtable.h`, `linux/dev_printk.h`.
- Detected declarations: `struct mshv_vp`, `struct mshv_mem_region`, `struct mshv_irq_ack_notifier`, `struct mshv_partition`, `struct mshv_lapic_irq`, `struct mshv_guest_irq_ent`, `struct mshv_girq_routing_table`, `struct hv_synic_pages`, `struct mshv_root`, `struct port_table_info`.
- Atlas domain: Driver Families / drivers/hv.
- Implementation status: source 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.