search for: vmci_get_context_id

Displaying 20 results from an estimated 49 matches for "vmci_get_context_id".

2019 Oct 23
0
[PATCH net-next 12/14] vsock/vmci: register vmci_transport only when VMCI guest/host are active
.../vmci_driver.c @@ -28,6 +28,9 @@ MODULE_PARM_DESC(disable_guest, static bool vmci_guest_personality_initialized; static bool vmci_host_personality_initialized; +static DEFINE_MUTEX(vmci_vsock_mutex); /* protects vmci_vsock_transport_cb */ +static vmci_vsock_cb vmci_vsock_transport_cb; + /* * vmci_get_context_id() - Gets the current context ID. * @@ -45,6 +48,53 @@ u32 vmci_get_context_id(void) } EXPORT_SYMBOL_GPL(vmci_get_context_id); +/* + * vmci_register_vsock_callback() - Register the VSOCK vmci_transport callback. + * + * The callback will be called every time a new host or guest become active,...
2016 Oct 06
0
[PATCH] VMCI: Doorbell create and destroy fixes
This change consists of two changes: 1) If vmci_doorbell_create is called when neither guest nor host personality as been initialized, vmci_get_context_id will return VMCI_INVALID_ID. In that case, we should fail the create call. 2) In doorbell destroy, we assume that vmci_guest_code_active() has the same return value on create and destroy. That may not be the case, so we may end up with the wrong refcount. Instead, destroy should chec...
2016 Oct 06
0
[PATCH] VMCI: Doorbell create and destroy fixes
This change consists of two changes: 1) If vmci_doorbell_create is called when neither guest nor host personality as been initialized, vmci_get_context_id will return VMCI_INVALID_ID. In that case, we should fail the create call. 2) In doorbell destroy, we assume that vmci_guest_code_active() has the same return value on create and destroy. That may not be the case, so we may end up with the wrong refcount. Instead, destroy should chec...
2012 Aug 30
0
[PATCH 10/11] vmci_route.patch: VMCI routing implementation.
...Y, in which case we + * should set the real context here before passing it + * down. + */ + if (VMCI_INVALID_ID == src->context && + VMCI_INVALID_ID != src->resource) + src->context = vmci_get_context_id(); + + /* Send from local client down to the hypervisor. */ + *route = VMCI_ROUTE_AS_GUEST; + return VMCI_SUCCESS; + } + + /* Anywhere to local client on host. */ + if (VMCI_HOST_CONTEXT_ID == dst->context) { + /* +...
2012 Aug 30
0
[PATCH 10/11] vmci_route.patch: VMCI routing implementation.
...Y, in which case we + * should set the real context here before passing it + * down. + */ + if (VMCI_INVALID_ID == src->context && + VMCI_INVALID_ID != src->resource) + src->context = vmci_get_context_id(); + + /* Send from local client down to the hypervisor. */ + *route = VMCI_ROUTE_AS_GUEST; + return VMCI_SUCCESS; + } + + /* Anywhere to local client on host. */ + if (VMCI_HOST_CONTEXT_ID == dst->context) { + /* +...
2012 Dec 24
0
No subject
...o patch vsock code to hook it up. Having the vsock bits in staging would actually make it a bit easier to add virtio. In the end it is Greg's / Dave's call though as those have to ack & merge the bits. >>> + case IOCTL_VMCI_SOCKETS_GET_LOCAL_CID: >>> + if (put_user(vmci_get_context_id(), p) != 0) >>> + retval = -EFAULT; >> >> What is this? > > A CID, or "context ID" is how we identify a VM. It's also in > the address structure (svm_cid). If you look at vm_sockets.h, > you'll see that we have definitions for various endpoint...
2012 Dec 24
0
No subject
...o patch vsock code to hook it up. Having the vsock bits in staging would actually make it a bit easier to add virtio. In the end it is Greg's / Dave's call though as those have to ack & merge the bits. >>> + case IOCTL_VMCI_SOCKETS_GET_LOCAL_CID: >>> + if (put_user(vmci_get_context_id(), p) != 0) >>> + retval = -EFAULT; >> >> What is this? > > A CID, or "context ID" is how we identify a VM. It's also in > the address structure (svm_cid). If you look at vm_sockets.h, > you'll see that we have definitions for various endpoint...
2012 Aug 30
1
[PATCH 04/11] vmci_driver.patch: VMCI device driver.
...MCI_RESOURCES_QUERY); + checkMsg->src = VMCI_ANON_SRC_HANDLE; + checkMsg->payloadSize = msgSize - VMCI_DG_HEADERSIZE; + msg = (struct vmci_resource_query_msg *)VMCI_DG_PAYLOAD(checkMsg); + + msg->numResources = VMCI_UTIL_NUM_RESOURCES; + msg->resources[0] = VMCI_GET_CONTEXT_ID; + + /* Checks that hyper calls are supported */ + result = (0x1 == vmci_send_datagram(checkMsg)); + kfree(checkMsg); + + pr_info("Host capability check: %s.", + result ? "PASSED" : "FAILED"); + + /* We need the vector. There...
2012 Aug 30
1
[PATCH 04/11] vmci_driver.patch: VMCI device driver.
...MCI_RESOURCES_QUERY); + checkMsg->src = VMCI_ANON_SRC_HANDLE; + checkMsg->payloadSize = msgSize - VMCI_DG_HEADERSIZE; + msg = (struct vmci_resource_query_msg *)VMCI_DG_PAYLOAD(checkMsg); + + msg->numResources = VMCI_UTIL_NUM_RESOURCES; + msg->resources[0] = VMCI_GET_CONTEXT_ID; + + /* Checks that hyper calls are supported */ + result = (0x1 == vmci_send_datagram(checkMsg)); + kfree(checkMsg); + + pr_info("Host capability check: %s.", + result ? "PASSED" : "FAILED"); + + /* We need the vector. There...
2019 Oct 23
33
[PATCH net-next 00/14] vsock: add multi-transports support
This series adds the multi-transports support to vsock, following this proposal: https://www.spinics.net/lists/netdev/msg575792.html With the multi-transports support, we can use VSOCK with nested VMs (using also different hypervisors) loading both guest->host and host->guest transports at the same time. Before this series, vmci-transport supported this behavior but only using VMware
2019 Oct 23
33
[PATCH net-next 00/14] vsock: add multi-transports support
This series adds the multi-transports support to vsock, following this proposal: https://www.spinics.net/lists/netdev/msg575792.html With the multi-transports support, we can use VSOCK with nested VMs (using also different hypervisors) loading both guest->host and host->guest transports at the same time. Before this series, vmci-transport supported this behavior but only using VMware
2019 Nov 14
15
[PATCH net-next v2 00/15] vsock: add multi-transports support
Most of the patches are reviewed by Dexuan, Stefan, and Jorgen. The following patches need reviews: - [11/15] vsock: add multi-transports support - [12/15] vsock/vmci: register vmci_transport only when VMCI guest/host are active - [15/15] vhost/vsock: refuse CID assigned to the guest->host transport RFC: https://patchwork.ozlabs.org/cover/1168442/ v1:
2012 Oct 30
29
[PATCH 00/12] VMCI for Linux upstreaming
* * * This series of VMCI linux upstreaming patches include latest udpate from VMware. -split guest, host and core driver code into different files -use EXPORT_SYMBOLS_GPL -remove vmci_device_get and vmci_device_release APIs -simplify the event deliver mechanism -driver ioctl code cleanup -sparse clean * * * In an effort to improve the out-of-the-box experience with
2012 Oct 30
29
[PATCH 00/12] VMCI for Linux upstreaming
* * * This series of VMCI linux upstreaming patches include latest udpate from VMware. -split guest, host and core driver code into different files -use EXPORT_SYMBOLS_GPL -remove vmci_device_get and vmci_device_release APIs -simplify the event deliver mechanism -driver ioctl code cleanup -sparse clean * * * In an effort to improve the out-of-the-box experience with
2012 Aug 30
0
[PATCH 03/11] vmci_doorbell.patch: VMCI doorbell notification handling.
...+ entry = kmalloc(sizeof(*entry), GFP_KERNEL); + if (entry == NULL) { + pr_warn("Failed allocating memory for datagram entry."); + return VMCI_ERROR_NO_MEM; + } + + if (VMCI_HANDLE_INVALID(*handle)) { + uint32_t contextID = vmci_get_context_id(); + uint32_t resourceID = vmci_resource_get_id(contextID); + if (resourceID == VMCI_INVALID_ID) { + result = VMCI_ERROR_NO_HANDLE; + goto freeMem; + } + newHandle = vmci_make_handle(contextID, resou...
2012 Aug 30
0
[PATCH 03/11] vmci_doorbell.patch: VMCI doorbell notification handling.
...+ entry = kmalloc(sizeof(*entry), GFP_KERNEL); + if (entry == NULL) { + pr_warn("Failed allocating memory for datagram entry."); + return VMCI_ERROR_NO_MEM; + } + + if (VMCI_HANDLE_INVALID(*handle)) { + uint32_t contextID = vmci_get_context_id(); + uint32_t resourceID = vmci_resource_get_id(contextID); + if (resourceID == VMCI_INVALID_ID) { + result = VMCI_ERROR_NO_HANDLE; + goto freeMem; + } + newHandle = vmci_make_handle(contextID, resou...
2019 Oct 23
0
[PATCH net-next 11/14] vsock: add multi-transports support
...eceived the request. + */ + if (err || !vmci_check_transport(vpending)) { + sock_put(pending); + return err; + } + /* If the proposed size fits within our min/max, accept it. Otherwise * propose our own size. */ @@ -2008,7 +2018,7 @@ static u32 vmci_transport_get_local_cid(void) return vmci_get_context_id(); } -static const struct vsock_transport vmci_transport = { +static struct vsock_transport vmci_transport = { .init = vmci_transport_socket_init, .destruct = vmci_transport_destruct, .release = vmci_transport_release, @@ -2038,10 +2048,25 @@ static const struct vsock_transport vmci_transp...
2019 Sep 27
0
[RFC PATCH 10/13] vsock: add multi-transports support
...eceived the request. + */ + if (err || !vmci_check_transport(vpending)) { + sock_put(pending); + return err; + } + /* If the proposed size fits within our min/max, accept it. Otherwise * propose our own size. */ @@ -2009,7 +2019,8 @@ static u32 vmci_transport_get_local_cid(void) return vmci_get_context_id(); } -static const struct vsock_transport vmci_transport = { +static struct vsock_transport vmci_transport = { + .features = VSOCK_TRANSPORT_F_DGRAM | VSOCK_TRANSPORT_F_H2G, .init = vmci_transport_socket_init, .destruct = vmci_transport_destruct, .release = vmci_transport_release, @@ -2039...
2013 Jan 08
13
[PATCH 00/12] VMCI for Linux upstreaming
* * * This series of VMCI linux upstreaming patches include latest udpate from VMware to address Greg's and all other's code review comments. Summary of changes: - Rebase our linux kernel tree from v3.5 to v3.7. - Fix all checkpatch warnings and errors. Fix some checkpatch with -strict errors. This addresses Greg's comment: On 15 Nov 2012
2013 Jan 08
13
[PATCH 00/12] VMCI for Linux upstreaming
* * * This series of VMCI linux upstreaming patches include latest udpate from VMware to address Greg's and all other's code review comments. Summary of changes: - Rebase our linux kernel tree from v3.5 to v3.7. - Fix all checkpatch warnings and errors. Fix some checkpatch with -strict errors. This addresses Greg's comment: On 15 Nov 2012