drivers/hv/hyperv_vmbus.h
Source file repositories/reference/linux-study-clean/drivers/hv/hyperv_vmbus.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/hv/hyperv_vmbus.h- Extension
.h- Size
- 15375 bytes
- Lines
- 553
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hlinux/bitops.hasm/sync_bitops.hasm/mshyperv.hlinux/atomic.hlinux/hyperv.hlinux/interrupt.hhyperv/hvhdk.hhv_trace.h
Detected Declarations
struct hv_monitor_parameterstruct hv_monitor_pagestruct hv_input_post_messagestruct hv_per_cpu_contextstruct hv_contextstruct vmbus_connectionstruct vmbus_msginfostruct vmbus_channel_message_table_entryenum vmbus_connect_stateenum vmbus_message_handler_typeenum hvutil_device_stateenum delayfunction vmbus_send_interruptfunction vmbus_signal_eomfunction cmpxchgfunction hv_poll_channelfunction hv_is_perf_channelfunction hv_dev_ring_sizefunction hv_is_allocated_cpufunction list_for_each_entryfunction hv_set_allocated_cpufunction hv_clear_allocated_cpufunction hv_update_allocated_cpusfunction hv_debug_rm_dev_dirfunction hv_debug_rm_all_dirfunction hv_debug_delay_testfunction hv_debug_initfunction hv_debug_add_dev_dir
Annotated Snippet
struct hv_monitor_parameter {
union hv_connection_id connectionid;
u16 flagnumber;
u16 rsvdz;
};
union hv_monitor_trigger_state {
u32 asu32;
struct {
u32 group_enable:4;
u32 rsvdz:28;
};
};
/* struct hv_monitor_page Layout */
/* ------------------------------------------------------ */
/* | 0 | TriggerState (4 bytes) | Rsvd1 (4 bytes) | */
/* | 8 | TriggerGroup[0] | */
/* | 10 | TriggerGroup[1] | */
/* | 18 | TriggerGroup[2] | */
/* | 20 | TriggerGroup[3] | */
/* | 28 | Rsvd2[0] | */
/* | 30 | Rsvd2[1] | */
/* | 38 | Rsvd2[2] | */
/* | 40 | NextCheckTime[0][0] | NextCheckTime[0][1] | */
/* | ... | */
/* | 240 | Latency[0][0..3] | */
/* | 340 | Rsvz3[0] | */
/* | 440 | Parameter[0][0] | */
/* | 448 | Parameter[0][1] | */
/* | ... | */
/* | 840 | Rsvd4[0] | */
/* ------------------------------------------------------ */
struct hv_monitor_page {
union hv_monitor_trigger_state trigger_state;
u32 rsvdz1;
union hv_monitor_trigger_group trigger_group[4];
u64 rsvdz2[3];
s32 next_checktime[4][32];
u16 latency[4][32];
u64 rsvdz3[32];
struct hv_monitor_parameter parameter[4][32];
u8 rsvdz4[1984];
};
#define HV_HYPERCALL_PARAM_ALIGN sizeof(u64)
/* Definition of the hv_post_message hypercall input structure. */
struct hv_input_post_message {
union hv_connection_id connectionid;
u32 reserved;
u32 message_type;
u32 payload_size;
u64 payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
};
enum {
VMBUS_MESSAGE_CONNECTION_ID = 1,
VMBUS_MESSAGE_CONNECTION_ID_4 = 4,
VMBUS_MESSAGE_PORT_ID = 1,
VMBUS_EVENT_CONNECTION_ID = 2,
VMBUS_EVENT_PORT_ID = 2,
VMBUS_MONITOR_CONNECTION_ID = 3,
VMBUS_MONITOR_PORT_ID = 3,
VMBUS_MESSAGE_SINT = 2,
};
/*
* Per cpu state for channel handling
*/
struct hv_per_cpu_context {
/*
* SynIC pages for communicating with the host.
*
* These pages are accessible to the host partition and the hypervisor.
* They may be used for exchanging data with the host partition and the
* hypervisor even when they aren't trusted yet the guest partition
* must be prepared to handle the malicious behavior.
*/
void *hyp_synic_message_page;
void *hyp_synic_event_page;
/*
* SynIC pages for communicating with the paravisor.
Annotation
- Immediate include surface: `linux/list.h`, `linux/bitops.h`, `asm/sync_bitops.h`, `asm/mshyperv.h`, `linux/atomic.h`, `linux/hyperv.h`, `linux/interrupt.h`, `hyperv/hvhdk.h`.
- Detected declarations: `struct hv_monitor_parameter`, `struct hv_monitor_page`, `struct hv_input_post_message`, `struct hv_per_cpu_context`, `struct hv_context`, `struct vmbus_connection`, `struct vmbus_msginfo`, `struct vmbus_channel_message_table_entry`, `enum vmbus_connect_state`, `enum vmbus_message_handler_type`.
- Atlas domain: Driver Families / drivers/hv.
- Implementation status: source implementation candidate.
- 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.