/* Used to determine what checkpoint state to get and set. */ enum {
VMCI_NOTIFICATION_CPT_STATE = 1,
VMCI_WELLKNOWN_CPT_STATE = 2,
VMCI_DG_OUT_STATE = 3,
VMCI_DG_IN_STATE = 4,
VMCI_DG_IN_SIZE_STATE = 5,
VMCI_DOORBELL_CPT_STATE = 6,
};
/* Host specific struct used for signalling */ struct vmci_host {
wait_queue_head_t wait_queue;
};
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; unsignedint n_notifiers;
/* 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 recieve 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.
*/ staticinlinebool vmci_deny_interaction(u32 part_one, u32 part_two)
{ return ((part_one & VMCI_PRIVILEGE_FLAG_RESTRICTED) &&
!(part_two & VMCI_PRIVILEGE_FLAG_TRUSTED)) ||
((part_two & VMCI_PRIVILEGE_FLAG_RESTRICTED) &&
!(part_one & VMCI_PRIVILEGE_FLAG_TRUSTED));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.