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

1 /*-
4 * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
59 * The last_notify_idx_reserved is used to track the last index handed out - in
73 *------------------------------------------------------------------------------
75 * vmci_doorbell_init --
82 * Side effects:
85 *------------------------------------------------------------------------------
102 *------------------------------------------------------------------------------
104 * vmci_doorbell_exit --
111 * Side effects:
114 *------------------------------------------------------------------------------
125 *------------------------------------------------------------------------------
127 * vmci_doorbell_free_cb --
137 * Side effects:
140 *------------------------------------------------------------------------------
150 vmci_signal_event(&entry->destroy_event); in vmci_doorbell_free_cb()
154 *------------------------------------------------------------------------------
156 * vmci_doorbell_release_cb --
164 * Side effects:
167 *------------------------------------------------------------------------------
177 vmci_resource_release(&entry->resource); in vmci_doorbell_release_cb()
182 *------------------------------------------------------------------------------
184 * vmci_doorbell_get_priv_flags --
187 * given doorbell handle. For guest endpoints, the privileges are determined
196 * Side effects:
199 *------------------------------------------------------------------------------
220 *priv_flags = entry->priv_flags; in vmci_doorbell_get_priv_flags()
232 *------------------------------------------------------------------------------
234 * vmci_doorbell_index_table_find --
241 * Side effects:
244 *------------------------------------------------------------------------------
256 if (idx == iter->idx) in vmci_doorbell_index_table_find()
264 *------------------------------------------------------------------------------
266 * vmci_doorbell_index_table_add --
275 * Side effects:
278 *------------------------------------------------------------------------------
289 vmci_resource_hold(&entry->resource); in vmci_doorbell_index_table_add()
332 entry->idx = new_notify_idx; in vmci_doorbell_index_table_add()
333 bucket = VMCI_DOORBELL_HASH(entry->idx); in vmci_doorbell_index_table_add()
341 *------------------------------------------------------------------------------
343 * vmci_doorbell_index_table_remove --
351 * Side effects:
354 *------------------------------------------------------------------------------
366 notify_idx_count--; in vmci_doorbell_index_table_remove()
367 if (entry->idx == max_notify_idx - 1) { in vmci_doorbell_index_table_remove()
376 !vmci_doorbell_index_table_find(max_notify_idx - 1)) in vmci_doorbell_index_table_remove()
377 max_notify_idx--; in vmci_doorbell_index_table_remove()
379 last_notify_idx_released = entry->idx; in vmci_doorbell_index_table_remove()
383 vmci_resource_release(&entry->resource); in vmci_doorbell_index_table_remove()
387 *------------------------------------------------------------------------------
389 * vmci_doorbell_link --
397 * Side effects:
400 *------------------------------------------------------------------------------
422 link_msg.hdr.payload_size = sizeof(link_msg) - VMCI_DG_HEADERSIZE; in vmci_doorbell_link()
430 *------------------------------------------------------------------------------
432 * vmci_doorbell_unlink --
440 * Side effects:
443 *------------------------------------------------------------------------------
464 unlink_msg.hdr.payload_size = sizeof(unlink_msg) - VMCI_DG_HEADERSIZE; in vmci_doorbell_unlink()
471 *------------------------------------------------------------------------------
473 * vmci_doorbell_create --
477 * callback can be run immediately (potentially with locks held - the
486 * Side effects:
489 *------------------------------------------------------------------------------
528 if (VMCI_INVALID_ID == handle->resource) { in vmci_doorbell_create()
530 "(handle=0x%x:0x%x).\n", handle->context, in vmci_doorbell_create()
531 handle->resource); in vmci_doorbell_create()
538 entry->idx = 0; in vmci_doorbell_create()
539 entry->priv_flags = priv_flags; in vmci_doorbell_create()
540 entry->is_doorbell = true; in vmci_doorbell_create()
541 entry->run_delayed = (flags & VMCI_FLAG_DELAYED_CB) ? true : false; in vmci_doorbell_create()
542 entry->notify_cb = notify_cb; in vmci_doorbell_create()
543 entry->client_data = client_data; in vmci_doorbell_create()
544 atomic_store_int(&entry->active, 0); in vmci_doorbell_create()
545 vmci_create_event(&entry->destroy_event); in vmci_doorbell_create()
547 result = vmci_resource_add(&entry->resource, in vmci_doorbell_create()
561 result = vmci_doorbell_link(new_handle, entry->is_doorbell, entry->idx); in vmci_doorbell_create()
564 atomic_store_int(&entry->active, 1); in vmci_doorbell_create()
575 vmci_destroy_event(&entry->destroy_event); in vmci_doorbell_create()
582 *------------------------------------------------------------------------------
584 * vmci_doorbell_destroy --
592 * Side effects:
595 *------------------------------------------------------------------------------
619 result = vmci_doorbell_unlink(handle, entry->is_doorbell); in vmci_doorbell_destroy()
623 * between guest and hypervisor state, where the guest believes in vmci_doorbell_destroy()
627 * doorbell state hasn't been restored on the hypervisor side in vmci_doorbell_destroy()
628 * yet. Since the handle has now been removed in the guest, in vmci_doorbell_destroy()
634 entry->is_doorbell ? "doorbell" : "queuepair", in vmci_doorbell_destroy()
650 vmci_wait_on_event(&entry->destroy_event, vmci_doorbell_release_cb, in vmci_doorbell_destroy()
658 vmci_destroy_event(&entry->destroy_event); in vmci_doorbell_destroy()
665 *------------------------------------------------------------------------------
667 * vmci_doorbell_notify_as_guest --
669 * Notify another guest or the host. We send a datagram down to the host
675 * Side effects:
678 *------------------------------------------------------------------------------
690 notify_msg.hdr.payload_size = sizeof(notify_msg) - VMCI_DG_HEADERSIZE; in vmci_doorbell_notify_as_guest()
697 *------------------------------------------------------------------------------
699 * vmci_doorbell_notify --
702 * host side generation of notifications, the caller can specify what the
703 * privilege of the calling side is.
708 * Side effects:
711 *------------------------------------------------------------------------------
725 *------------------------------------------------------------------------------
727 * vmci_doorbell_delayed_dispatch_cb --
734 * Side effects:
737 *------------------------------------------------------------------------------
747 entry->notify_cb(entry->client_data); in vmci_doorbell_delayed_dispatch_cb()
749 vmci_resource_release(&entry->resource); in vmci_doorbell_delayed_dispatch_cb()
753 *------------------------------------------------------------------------------
755 * vmci_doorbell_sync --
763 * Side effects:
766 *------------------------------------------------------------------------------
779 *------------------------------------------------------------------------------
781 * vmci_register_notification_bitmap --
789 * Side effects:
792 *------------------------------------------------------------------------------
802 * Do not ASSERT() on the guest device here. This function can get in vmci_register_notification_bitmap()
811 sizeof(bitmap_set_msg) - VMCI_DG_HEADERSIZE; in vmci_register_notification_bitmap()
825 *------------------------------------------------------------------------------
827 * vmci_doorbell_fire_entries --
834 * Side effects:
835 * Whatever the side effects of the handlers are.
837 *------------------------------------------------------------------------------
849 if (iter->idx == notify_idx && in vmci_doorbell_fire_entries()
850 atomic_load_int(&iter->active) == 1) { in vmci_doorbell_fire_entries()
851 ASSERT(iter->notify_cb); in vmci_doorbell_fire_entries()
852 if (iter->run_delayed) { in vmci_doorbell_fire_entries()
855 vmci_resource_hold(&iter->resource); in vmci_doorbell_fire_entries()
859 vmci_resource_release(&iter->resource); in vmci_doorbell_fire_entries()
863 iter->notify_cb(iter->client_data); in vmci_doorbell_fire_entries()
872 *------------------------------------------------------------------------------
874 * vmci_scan_notification_bitmap --
882 * Side effects:
885 *------------------------------------------------------------------------------