Displaying 20 results from an estimated 58 matches for "vmci_handle".
2019 May 24
0
[PATCH] VMCI: Fix integer overflow in VMCI handle arrays
The VMCI handle array has an integer overflow in
vmci_handle_arr_append_entry when it tries to expand the array. This can be
triggered from a guest, since the doorbell link hypercall doesn't impose a
limit on the number of doorbell handles that a VM can create in the
hypervisor, and these handles are stored in a handle array.
In this change, we introduc...
2012 Aug 30
0
[PATCH 09/11] vmci_resource.patch: VMCI resource hash table implementation.
...sourceID;
+ uint32_t currentRID;
+ bool foundRID = false;
+
+ /*
+ * Generate a unique resource ID. Keep on trying until we wrap around
+ * in the RID space.
+ */
+ ASSERT(oldRID > VMCI_RESERVED_RESOURCE_ID_MAX);
+
+ do {
+ struct vmci_handle handle;
+
+ spin_lock(&resourceIdLock);
+ currentRID = resourceID;
+ handle = vmci_make_handle(contextID, currentRID);
+ resourceID++;
+ if (unlikely(resourceID == VMCI_INVALID_ID)) {
+ /* Skip the reser...
2012 Aug 30
0
[PATCH 09/11] vmci_resource.patch: VMCI resource hash table implementation.
...sourceID;
+ uint32_t currentRID;
+ bool foundRID = false;
+
+ /*
+ * Generate a unique resource ID. Keep on trying until we wrap around
+ * in the RID space.
+ */
+ ASSERT(oldRID > VMCI_RESERVED_RESOURCE_ID_MAX);
+
+ do {
+ struct vmci_handle handle;
+
+ spin_lock(&resourceIdLock);
+ currentRID = resourceID;
+ handle = vmci_make_handle(contextID, currentRID);
+ resourceID++;
+ if (unlikely(resourceID == VMCI_INVALID_ID)) {
+ /* Skip the reser...
2012 Aug 30
0
[PATCH 11/11] vmci_headers.patch: VMCI kernel driver public API.
...##################################################
+
+#
+# Makefile for the VMware VMCI
+#
+
+obj-$(CONFIG_VMWARE_VMCI) += vmw_vmci.o
+
+vmw_vmci-y += vmci_context.o
+vmw_vmci-y += vmci_datagram.o
+vmw_vmci-y += vmci_doorbell.o
+vmw_vmci-y += vmci_driver.o
+vmw_vmci-y += vmci_event.o
+vmw_vmci-y += vmci_handle_array.o
+vmw_vmci-y += vmci_hash_table.o
+vmw_vmci-y += vmci_queue_pair.o
+vmw_vmci-y += vmci_resource.o
+vmw_vmci-y += vmci_route.o
+
+vmci:
+ $(MAKE) -C ../../.. SUBDIRS=$$PWD CONFIG_VMWARE_VMCI=m modules
+
+clean:
+ $(MAKE) -C ../../.. SUBDIRS=$$PWD CONFIG_VMWARE_VMCI=m clean
diff --...
2012 Aug 30
0
[PATCH 11/11] vmci_headers.patch: VMCI kernel driver public API.
...##################################################
+
+#
+# Makefile for the VMware VMCI
+#
+
+obj-$(CONFIG_VMWARE_VMCI) += vmw_vmci.o
+
+vmw_vmci-y += vmci_context.o
+vmw_vmci-y += vmci_datagram.o
+vmw_vmci-y += vmci_doorbell.o
+vmw_vmci-y += vmci_driver.o
+vmw_vmci-y += vmci_event.o
+vmw_vmci-y += vmci_handle_array.o
+vmw_vmci-y += vmci_hash_table.o
+vmw_vmci-y += vmci_queue_pair.o
+vmw_vmci-y += vmci_resource.o
+vmw_vmci-y += vmci_route.o
+
+vmci:
+ $(MAKE) -C ../../.. SUBDIRS=$$PWD CONFIG_VMWARE_VMCI=m modules
+
+clean:
+ $(MAKE) -C ../../.. SUBDIRS=$$PWD CONFIG_VMWARE_VMCI=m clean
diff --...
2012 Aug 30
2
[PATCH 01/11] vmci_context.patch: VMCI context list operations.
...ntext->notify)
+ *context->notify = false;
+}
+
+/*
+ * If nothing requires the attention of the guest, clears both
+ * notify flag and call.
+ */
+static void ctx_clear_notify_call(struct vmci_ctx *context)
+{
+ if (context->pendingDatagrams == 0 &&
+ vmci_handle_arr_get_size(context->pendingDoorbellArray) == 0)
+ ctx_clear_notify(context);
+}
+
+/*
+ * Sets the context's notify flag iff datagrams are pending for this
+ * context. Called from vmci_setup_notify().
+ */
+void vmci_ctx_check_signal_notify(struct vmci_ctx *context)
+{
+...
2012 Aug 30
2
[PATCH 01/11] vmci_context.patch: VMCI context list operations.
...ntext->notify)
+ *context->notify = false;
+}
+
+/*
+ * If nothing requires the attention of the guest, clears both
+ * notify flag and call.
+ */
+static void ctx_clear_notify_call(struct vmci_ctx *context)
+{
+ if (context->pendingDatagrams == 0 &&
+ vmci_handle_arr_get_size(context->pendingDoorbellArray) == 0)
+ ctx_clear_notify(context);
+}
+
+/*
+ * Sets the context's notify flag iff datagrams are pending for this
+ * context. Called from vmci_setup_notify().
+ */
+void vmci_ctx_check_signal_notify(struct vmci_ctx *context)
+{
+...
2012 Aug 30
0
[PATCH 03/11] vmci_doorbell.patch: VMCI doorbell notification handling.
...lege flags associated
+ * with a given doorbell handle. For guest endpoints, the
+ * privileges are determined by the context ID, but for host
+ * endpoints privileges are associated with the complete
+ * handle. Hypervisor endpoints are not yet supported.
+ */
+int vmci_dbell_get_priv_flags(struct vmci_handle handle,
+ uint32_t *privFlags)
+{
+ if (privFlags == NULL || handle.context == VMCI_INVALID_ID)
+ return VMCI_ERROR_INVALID_ARGS;
+
+ if (handle.context == VMCI_HOST_CONTEXT_ID) {
+ struct dbell_entry *entry;
+ struct...
2012 Aug 30
0
[PATCH 03/11] vmci_doorbell.patch: VMCI doorbell notification handling.
...lege flags associated
+ * with a given doorbell handle. For guest endpoints, the
+ * privileges are determined by the context ID, but for host
+ * endpoints privileges are associated with the complete
+ * handle. Hypervisor endpoints are not yet supported.
+ */
+int vmci_dbell_get_priv_flags(struct vmci_handle handle,
+ uint32_t *privFlags)
+{
+ if (privFlags == NULL || handle.context == VMCI_INVALID_ID)
+ return VMCI_ERROR_INVALID_ARGS;
+
+ if (handle.context == VMCI_HOST_CONTEXT_ID) {
+ struct dbell_entry *entry;
+ struct...
2012 Oct 30
29
[PATCH 00/12] VMCI for Linux upstreaming
....h | 53
drivers/misc/vmw_vmci/vmci_driver.c | 159 +
drivers/misc/vmw_vmci/vmci_driver.h | 50
drivers/misc/vmw_vmci/vmci_event.c | 371 +++
drivers/misc/vmw_vmci/vmci_event.h | 25
drivers/misc/vmw_vmci/vmci_guest.c | 765 ++++++
drivers/misc/vmw_vmci/vmci_handle_array.c | 162 +
drivers/misc/vmw_vmci/vmci_handle_array.h | 46
drivers/misc/vmw_vmci/vmci_host.c | 1046 +++++++++
drivers/misc/vmw_vmci/vmci_queue_pair.c | 3556 +++++++++++++++++++++++++++++
drivers/misc/vmw_vmci/vmci_queue_pair.h | 191 ++
drivers/misc/vmw_vmci/vmci_resource.c...
2012 Oct 30
29
[PATCH 00/12] VMCI for Linux upstreaming
....h | 53
drivers/misc/vmw_vmci/vmci_driver.c | 159 +
drivers/misc/vmw_vmci/vmci_driver.h | 50
drivers/misc/vmw_vmci/vmci_event.c | 371 +++
drivers/misc/vmw_vmci/vmci_event.h | 25
drivers/misc/vmw_vmci/vmci_guest.c | 765 ++++++
drivers/misc/vmw_vmci/vmci_handle_array.c | 162 +
drivers/misc/vmw_vmci/vmci_handle_array.h | 46
drivers/misc/vmw_vmci/vmci_host.c | 1046 +++++++++
drivers/misc/vmw_vmci/vmci_queue_pair.c | 3556 +++++++++++++++++++++++++++++
drivers/misc/vmw_vmci/vmci_queue_pair.h | 191 ++
drivers/misc/vmw_vmci/vmci_resource.c...
2012 Aug 30
0
[PATCH 07/11] vmci_hash_table.patch: VMCI hash table implementation.
...ee the GNU General Public License
+ * for more details.
+ */
+
+#include <linux/vmw_vmci_defs.h>
+#include <linux/slab.h>
+
+#include "vmci_common_int.h"
+#include "vmci_hash_table.h"
+#include "vmci_context.h"
+#include "vmci_driver.h"
+
+#define VMCI_HANDLE_TO_CONTEXT_ID(_handle) ((_handle).context)
+#define VMCI_HANDLE_TO_RESOURCE_ID(_handle) ((_handle).resource)
+#define VMCI_HASHTABLE_HASH(_h, _sz) \
+ vmci_hash_calc(VMCI_HANDLE_TO_RESOURCE_ID(_h), (_sz))
+
+struct vmci_hash_table *vmci_hash_create(int size)
+{
+...
2012 Aug 30
0
[PATCH 07/11] vmci_hash_table.patch: VMCI hash table implementation.
...ee the GNU General Public License
+ * for more details.
+ */
+
+#include <linux/vmw_vmci_defs.h>
+#include <linux/slab.h>
+
+#include "vmci_common_int.h"
+#include "vmci_hash_table.h"
+#include "vmci_context.h"
+#include "vmci_driver.h"
+
+#define VMCI_HANDLE_TO_CONTEXT_ID(_handle) ((_handle).context)
+#define VMCI_HANDLE_TO_RESOURCE_ID(_handle) ((_handle).resource)
+#define VMCI_HASHTABLE_HASH(_h, _sz) \
+ vmci_hash_calc(VMCI_HANDLE_TO_RESOURCE_ID(_h), (_sz))
+
+struct vmci_hash_table *vmci_hash_create(int size)
+{
+...
2013 Jan 08
13
[PATCH 00/12] VMCI for Linux upstreaming
...NG.
Remove #define for MODULE_NAME.
Remove #define for pr_fmt and #define ASSERT(x).
Remove inline function VMCI_MAKE_HANDLE and vmci_make_handle which return a
structure on stack. use macro instead and use C99 initialization.
Remove #define for VMCI_HANDLE_TO_CONTEXT_ID and VMCI_HANDLE_TO_RESOURCE_ID
Change macro to inline function for VMCI_HANDLE_EQUAL.
Remove u32 typedefs for vmci_id, vmci_event, vmci_privilege_flags.
Use C99 style initialization for struct VMCI_INVALID_HANDLE.
Use inline function instead of...
2013 Jan 08
13
[PATCH 00/12] VMCI for Linux upstreaming
...NG.
Remove #define for MODULE_NAME.
Remove #define for pr_fmt and #define ASSERT(x).
Remove inline function VMCI_MAKE_HANDLE and vmci_make_handle which return a
structure on stack. use macro instead and use C99 initialization.
Remove #define for VMCI_HANDLE_TO_CONTEXT_ID and VMCI_HANDLE_TO_RESOURCE_ID
Change macro to inline function for VMCI_HANDLE_EQUAL.
Remove u32 typedefs for vmci_id, vmci_event, vmci_privilege_flags.
Use C99 style initialization for struct VMCI_INVALID_HANDLE.
Use inline function instead of...
2012 Oct 16
11
[PATCH 00/10] VMCI for Linux upstreaming
...drivers/misc/vmw_vmci/vmci_doorbell.h | 53
drivers/misc/vmw_vmci/vmci_driver.c | 2187 ++++++++++++++++++
drivers/misc/vmw_vmci/vmci_driver.h | 44
drivers/misc/vmw_vmci/vmci_event.c | 415 +++
drivers/misc/vmw_vmci/vmci_event.h | 25
drivers/misc/vmw_vmci/vmci_handle_array.c | 162 +
drivers/misc/vmw_vmci/vmci_handle_array.h | 46
drivers/misc/vmw_vmci/vmci_queue_pair.c | 3556 +++++++++++++++++++++++++++++
drivers/misc/vmw_vmci/vmci_queue_pair.h | 191 ++
drivers/misc/vmw_vmci/vmci_resource.c | 237 ++
drivers/misc/vmw_vmci/vmci_resource.h |...
2012 Oct 16
11
[PATCH 00/10] VMCI for Linux upstreaming
...drivers/misc/vmw_vmci/vmci_doorbell.h | 53
drivers/misc/vmw_vmci/vmci_driver.c | 2187 ++++++++++++++++++
drivers/misc/vmw_vmci/vmci_driver.h | 44
drivers/misc/vmw_vmci/vmci_event.c | 415 +++
drivers/misc/vmw_vmci/vmci_event.h | 25
drivers/misc/vmw_vmci/vmci_handle_array.c | 162 +
drivers/misc/vmw_vmci/vmci_handle_array.h | 46
drivers/misc/vmw_vmci/vmci_queue_pair.c | 3556 +++++++++++++++++++++++++++++
drivers/misc/vmw_vmci/vmci_queue_pair.h | 191 ++
drivers/misc/vmw_vmci/vmci_resource.c | 237 ++
drivers/misc/vmw_vmci/vmci_resource.h |...
2012 Jun 12
11
[vmw_vmci RFCv2 00/11] VMCI for Linux
...vers/misc/vmw_vmci/vmci_doorbell.h | 57 +
drivers/misc/vmw_vmci/vmci_driver.c | 2297 +++++++++++++++++++
drivers/misc/vmw_vmci/vmci_driver.h | 52 +
drivers/misc/vmw_vmci/vmci_event.c | 453 ++++
drivers/misc/vmw_vmci/vmci_event.h | 29 +
drivers/misc/vmw_vmci/vmci_handle_array.c | 174 ++
drivers/misc/vmw_vmci/vmci_handle_array.h | 50 +
drivers/misc/vmw_vmci/vmci_hash_table.c | 332 +++
drivers/misc/vmw_vmci/vmci_hash_table.h | 56 +
drivers/misc/vmw_vmci/vmci_queue_pair.c | 3549 +++++++++++++++++++++++++++++
drivers/misc/vmw_vmci/vmci_queue_pair.h...
2012 Jun 12
11
[vmw_vmci RFCv2 00/11] VMCI for Linux
...vers/misc/vmw_vmci/vmci_doorbell.h | 57 +
drivers/misc/vmw_vmci/vmci_driver.c | 2297 +++++++++++++++++++
drivers/misc/vmw_vmci/vmci_driver.h | 52 +
drivers/misc/vmw_vmci/vmci_event.c | 453 ++++
drivers/misc/vmw_vmci/vmci_event.h | 29 +
drivers/misc/vmw_vmci/vmci_handle_array.c | 174 ++
drivers/misc/vmw_vmci/vmci_handle_array.h | 50 +
drivers/misc/vmw_vmci/vmci_hash_table.c | 332 +++
drivers/misc/vmw_vmci/vmci_hash_table.h | 56 +
drivers/misc/vmw_vmci/vmci_queue_pair.c | 3549 +++++++++++++++++++++++++++++
drivers/misc/vmw_vmci/vmci_queue_pair.h...
2012 Jul 26
16
[vmw_vmci 00/11] VMCI for Linux
...vers/misc/vmw_vmci/vmci_doorbell.h | 57 +
drivers/misc/vmw_vmci/vmci_driver.c | 2298 +++++++++++++++++++
drivers/misc/vmw_vmci/vmci_driver.h | 52 +
drivers/misc/vmw_vmci/vmci_event.c | 451 ++++
drivers/misc/vmw_vmci/vmci_event.h | 29 +
drivers/misc/vmw_vmci/vmci_handle_array.c | 174 ++
drivers/misc/vmw_vmci/vmci_handle_array.h | 50 +
drivers/misc/vmw_vmci/vmci_hash_table.c | 332 +++
drivers/misc/vmw_vmci/vmci_hash_table.h | 56 +
drivers/misc/vmw_vmci/vmci_queue_pair.c | 3548 +++++++++++++++++++++++++++++
drivers/misc/vmw_vmci/vmci_queue_pair.h...