drivers/misc/vmw_vmci/vmci_context.h
Source file repositories/reference/linux-study-clean/drivers/misc/vmw_vmci/vmci_context.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/vmw_vmci/vmci_context.h- Extension
.h- Size
- 5047 bytes
- Lines
- 173
- Domain
- Driver Families
- Bucket
- drivers/misc
- 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/vmw_vmci_defs.hlinux/atomic.hlinux/kref.hlinux/types.hlinux/wait.hvmci_handle_array.hvmci_datagram.h
Detected Declarations
struct vmci_hoststruct vmci_handle_liststruct vmci_ctxstruct vmci_ctx_infostruct vmci_ctx_chkpt_buf_infostruct vmci_ctx_notify_recv_infofunction vmci_deny_interactionfunction vmci_ctx_get_id
Annotated Snippet
struct vmci_host {
wait_queue_head_t wait_queue;
};
struct vmci_handle_list {
struct list_head node;
struct vmci_handle handle;
};
struct vmci_ctx {
struct list_head list_item; /* For global VMCI list. */
u32 cid;
struct kref kref;
struct list_head datagram_queue; /* Head of per VM queue. */
u32 pending_datagrams;
size_t datagram_queue_size; /* Size of datagram queue in bytes. */
/*
* Version of the code that created
* this context; e.g., VMX.
*/
int user_version;
spinlock_t lock; /* Locks callQueue and handle_arrays. */
/*
* queue_pairs attached to. The array of
* handles for queue pairs is accessed
* from the code for QP API, and there
* it is protected by the QP lock. It
* is also accessed from the context
* clean up path, which does not
* require a lock. VMCILock is not
* used to protect the QP array field.
*/
struct vmci_handle_arr *queue_pair_array;
/* Doorbells created by context. */
struct vmci_handle_arr *doorbell_array;
/* Doorbells pending for context. */
struct vmci_handle_arr *pending_doorbell_array;
/* Contexts current context is subscribing to. */
struct list_head notifier_list;
unsigned int n_notifiers;
struct vmci_host host_context;
u32 priv_flags;
const struct cred *cred;
bool *notify; /* Notify flag pointer - hosted only. */
struct page *notify_page; /* Page backing the notify UVA. */
};
/* VMCINotifyAddRemoveInfo: Used to add/remove remote context notifications. */
struct vmci_ctx_info {
u32 remote_cid;
int result;
};
/* VMCICptBufInfo: Used to set/get current context's checkpoint state. */
struct vmci_ctx_chkpt_buf_info {
u64 cpt_buf;
u32 cpt_type;
u32 buf_size;
s32 result;
u32 _pad;
};
/*
* VMCINotificationReceiveInfo: Used to receive pending notifications
* for doorbells and queue pairs.
*/
struct vmci_ctx_notify_recv_info {
u64 db_handle_buf_uva;
u64 db_handle_buf_size;
u64 qp_handle_buf_uva;
u64 qp_handle_buf_size;
s32 result;
u32 _pad;
};
/*
* Utilility function that checks whether two entities are allowed
* to interact. If one of them is restricted, the other one must
* be trusted.
*/
static inline bool vmci_deny_interaction(u32 part_one, u32 part_two)
{
return ((part_one & VMCI_PRIVILEGE_FLAG_RESTRICTED) &&
Annotation
- Immediate include surface: `linux/vmw_vmci_defs.h`, `linux/atomic.h`, `linux/kref.h`, `linux/types.h`, `linux/wait.h`, `vmci_handle_array.h`, `vmci_datagram.h`.
- Detected declarations: `struct vmci_host`, `struct vmci_handle_list`, `struct vmci_ctx`, `struct vmci_ctx_info`, `struct vmci_ctx_chkpt_buf_info`, `struct vmci_ctx_notify_recv_info`, `function vmci_deny_interaction`, `function vmci_ctx_get_id`.
- Atlas domain: Driver Families / drivers/misc.
- 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.