Lines Matching +full:guest +full:- +full:side

1 /*-
4 * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
15 #pragma GCC diagnostic ignored "-Wcast-qual"
58 * Maximum MSI/MSI-X interrupt vectors in the device.
186 * Well-known context id, a logical context that contains a set of
187 * well-known services. This context ID is now obsolete.
207 *------------------------------------------------------------------------------
211 *------------------------------------------------------------------------------
220 #define VMCI_ERROR_INVALID_RESOURCE (-1)
221 #define VMCI_ERROR_INVALID_ARGS (-2)
222 #define VMCI_ERROR_NO_MEM (-3)
223 #define VMCI_ERROR_DATAGRAM_FAILED (-4)
224 #define VMCI_ERROR_MORE_DATA (-5)
225 #define VMCI_ERROR_NO_MORE_DATAGRAMS (-6)
226 #define VMCI_ERROR_NO_ACCESS (-7)
227 #define VMCI_ERROR_NO_HANDLE (-8)
228 #define VMCI_ERROR_DUPLICATE_ENTRY (-9)
229 #define VMCI_ERROR_DST_UNREACHABLE (-10)
230 #define VMCI_ERROR_PAYLOAD_TOO_LARGE (-11)
231 #define VMCI_ERROR_INVALID_PRIV (-12)
232 #define VMCI_ERROR_GENERIC (-13)
233 #define VMCI_ERROR_PAGE_ALREADY_SHARED (-14)
234 #define VMCI_ERROR_CANNOT_SHARE_PAGE (-15)
235 #define VMCI_ERROR_CANNOT_UNSHARE_PAGE (-16)
236 #define VMCI_ERROR_NO_PROCESS (-17)
237 #define VMCI_ERROR_NO_DATAGRAM (-18)
238 #define VMCI_ERROR_NO_RESOURCES (-19)
239 #define VMCI_ERROR_UNAVAILABLE (-20)
240 #define VMCI_ERROR_NOT_FOUND (-21)
241 #define VMCI_ERROR_ALREADY_EXISTS (-22)
242 #define VMCI_ERROR_NOT_PAGE_ALIGNED (-23)
243 #define VMCI_ERROR_INVALID_SIZE (-24)
244 #define VMCI_ERROR_REGION_ALREADY_SHARED (-25)
245 #define VMCI_ERROR_TIMEOUT (-26)
246 #define VMCI_ERROR_DATAGRAM_INCOMPLETE (-27)
247 #define VMCI_ERROR_INCORRECT_IRQL (-28)
248 #define VMCI_ERROR_EVENT_UNKNOWN (-29)
249 #define VMCI_ERROR_OBSOLETE (-30)
250 #define VMCI_ERROR_QUEUEPAIR_MISMATCH (-31)
251 #define VMCI_ERROR_QUEUEPAIR_NOTSET (-32)
252 #define VMCI_ERROR_QUEUEPAIR_NOTOWNER (-33)
253 #define VMCI_ERROR_QUEUEPAIR_NOTATTACHED (-34)
254 #define VMCI_ERROR_QUEUEPAIR_NOSPACE (-35)
255 #define VMCI_ERROR_QUEUEPAIR_NODATA (-36)
256 #define VMCI_ERROR_BUSMEM_INVALIDATION (-37)
257 #define VMCI_ERROR_MODULE_NOT_LOADED (-38)
258 #define VMCI_ERROR_DEVICE_NOT_FOUND (-39)
259 #define VMCI_ERROR_QUEUEPAIR_NOT_READY (-40)
260 #define VMCI_ERROR_WOULD_BLOCK (-41)
263 #define VMCI_ERROR_CLIENT_MIN (-500)
264 #define VMCI_ERROR_CLIENT_MAX (-550)
267 #define VMCI_SHAREDMEM_ERROR_BAD_CONTEXT (-1000)
274 #define VMCI_EVENT_CTX_ID_UPDATE 0 // Only applicable to guest
276 #define VMCI_EVENT_CTX_REMOVED 1 // Applicable to guest and host
277 #define VMCI_EVENT_QP_RESUMED 2 // Only applicable to guest
279 #define VMCI_EVENT_QP_PEER_ATTACH 3 // Applicable to guest, host
281 #define VMCI_EVENT_QP_PEER_DETACH 4 // Applicable to guest, host
298 * endpoints (guest and host kernel) should not use them. For the rest of the
299 * events, we allow both host and guest endpoints to subscribe to them, to
300 * maintain the same API for host and guest endpoints.
316 /* Reserved guest datagram resource ids. */
320 * VMCI coarse-grained privileges (per context or host process/endpoint. An
347 * The reason for the separation is one of accessibility: Each end-point can
352 * An end-point cannot modify the pointers of its peer (guest to guest; NOTE
353 * that in the host both queue headers are mapped r/w). But, each end-point
355 * much space is used (or left) in the Queue. This is because for an end-point
357 * points into the produce_q but -that- consumer_head is in the Queue header
358 * for that end-points consume_q.
375 * the range [0, size-1].
377 * If produce_q_header->producer_tail == consume_q_header->consumer_head then
391 * is an atomic read-modify-write. This will cause traces to fire when a 32bit
393 * consumer has read-only access to the producer's tail pointer.
428 *------------------------------------------------------------------------------
430 * qp_add_pointer --
438 * Side effects:
441 *------------------------------------------------------------------------------
449 if (new_val >= size - add) in qp_add_pointer()
450 new_val -= size; in qp_add_pointer()
457 *------------------------------------------------------------------------------
459 * vmci_queue_header_producer_tail --
466 * Side effects:
469 *------------------------------------------------------------------------------
476 return (qp_atomic_read_offset(&qh->producer_tail)); in vmci_queue_header_producer_tail()
480 *------------------------------------------------------------------------------
482 * vmci_queue_header_consumer_head --
489 * Side effects:
492 *------------------------------------------------------------------------------
499 return (qp_atomic_read_offset(&qh->consumer_head)); in vmci_queue_header_consumer_head()
503 *------------------------------------------------------------------------------
505 * vmci_queue_header_add_producer_tail --
513 * Side effects:
516 *------------------------------------------------------------------------------
524 qp_add_pointer(&q_header->producer_tail, add, queue_size); in vmci_queue_header_add_producer_tail()
528 *------------------------------------------------------------------------------
530 * vmci_queue_header_add_consumer_head --
538 * Side effects:
541 *------------------------------------------------------------------------------
549 qp_add_pointer(&q_header->consumer_head, add, queue_size); in vmci_queue_header_add_consumer_head()
553 *------------------------------------------------------------------------------
555 * vmci_queue_header_get_pointers --
563 * Side effects:
566 *------------------------------------------------------------------------------
585 *------------------------------------------------------------------------------
587 * vmci_queue_header_reset_pointers --
595 * Side effects:
598 *------------------------------------------------------------------------------
605 qp_atomic_write_offset(&q_header->producer_tail, CONST64U(0)); in vmci_queue_header_reset_pointers()
606 qp_atomic_write_offset(&q_header->consumer_head, CONST64U(0)); in vmci_queue_header_reset_pointers()
610 *------------------------------------------------------------------------------
612 * vmci_queue_header_init --
619 * Side effects:
622 *------------------------------------------------------------------------------
630 q_header->handle = handle; in vmci_queue_header_init()
635 *------------------------------------------------------------------------------
637 * vmci_queue_header_free_space --
645 * Side effects:
648 *------------------------------------------------------------------------------
672 free_space = produce_q_size - (tail - head) - 1; in vmci_queue_header_free_space()
674 free_space = head - tail - 1; in vmci_queue_header_free_space()
680 *------------------------------------------------------------------------------
682 * vmci_queue_header_buf_ready --
693 * Side effects:
696 *------------------------------------------------------------------------------
711 return (consume_q_size - free_space - 1); in vmci_queue_header_buf_ready()