]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Remove unused user space support from VMCI guest drivers
authorVMware, Inc <>
Mon, 20 Dec 2010 22:00:03 +0000 (14:00 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 20 Dec 2010 22:00:03 +0000 (14:00 -0800)
In ancient times, there existed a user level library for
VMCI. It talked to the VMCI guest driver through ioctls. Also,
it needed infrastructure in the guest driver to keep track
of user level processes and their datagram handles.

For all of the modules except windows, we should also be able
to get rid of the character device. I'll do that as a separate
change.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/vmci/vmciCommonInt.h [deleted file]
open-vm-tools/modules/linux/vmci/vmciDatagram.c
open-vm-tools/modules/linux/vmci/vmciDatagram.h
open-vm-tools/modules/linux/vmci/vmciInt.h
open-vm-tools/modules/linux/vmci/vmciProcess.c [deleted file]
open-vm-tools/modules/linux/vmci/vmciProcess.h [deleted file]
open-vm-tools/modules/linux/vmci/vmciUtil.c
open-vm-tools/modules/linux/vmci/vmci_drv.c
open-vm-tools/modules/linux/vmci/vmci_version.h

diff --git a/open-vm-tools/modules/linux/vmci/vmciCommonInt.h b/open-vm-tools/modules/linux/vmci/vmciCommonInt.h
deleted file mode 100644 (file)
index bccd228..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*********************************************************
- * Copyright (C) 2006 VMware, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 and no later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- *
- *********************************************************/
-
-/*
- * vmciCommonInt.h --
- *
- * Struct definitions for VMCI internal common code.
- */
-
-#ifndef _VMCI_COMMONINT_H_
-#define _VMCI_COMMONINT_H_
-
-#define INCLUDE_ALLOW_MODULE
-#include "includeCheck.h"
-
-#include "vm_atomic.h"
-#include "vmci_defs.h"
-#include "vmci_call_defs.h"
-#include "vmci_infrastructure.h"
-#include "vmci_handle_array.h"
-#include "vmci_kernel_if.h"
-#include "circList.h"
-
-struct DatagramQueueEntry {
-   ListItem listItem; /* For queuing. */
-   VMCIDatagram *dg;  /* Pending datagram. */
-};
-
-struct VMCIProcess {
-   ListItem         listItem;           /* For global process list. */
-   VMCIId           pid;                /* Process id. */
-};
-
-struct VMCIDatagramProcess {
-   VMCILock   datagramQueueLock;
-   VMCIHandle handle;
-   VMCIHost   host;
-   uint32     pendingDatagrams;
-   size_t     datagramQueueSize;
-   ListItem   *datagramQueue;
-};
-
-#endif /* _VMCI_COMMONINT_H_ */
index 6832813b76fef4dfa4878815c2dd003230058c1b..2afded28cff6e8d995974d44b167f63cc7e36a0e 100644 (file)
@@ -24,9 +24,6 @@
 
 #ifdef __linux__
 #  include "driver-config.h"
-
-#  define EXPORT_SYMTAB
-
 #  include <linux/module.h>
 #  include "compat_kernel.h"
 #  include "compat_pci.h"
 #include "vm_assert.h"
 #include "vmci_defs.h"
 #include "vmci_infrastructure.h"
-#include "vmciInt.h"
-#include "vmciUtil.h"
 #include "vmciDatagram.h"
-#include "vmciCommonInt.h"
+#include "vmciInt.h"
 #include "vmciKernelAPI.h"
+#include "vmciUtil.h"
 
 typedef struct DatagramHashEntry {
    struct DatagramHashEntry  *next;
@@ -94,7 +90,6 @@ static DatagramHashEntry *DatagramHashGetEntry(VMCIHandle handle);
 static DatagramHashEntry *DatagramHashGetEntryAnyCid(VMCIHandle handle);
 static void DatagramHashReleaseEntry(DatagramHashEntry *entry);
 static Bool DatagramHandleUniqueLockedAnyCid(VMCIHandle handle);
-static int DatagramProcessNotify(void *clientData, VMCIDatagram *msg);
 
 DatagramHashTable hashTable;
 
@@ -800,284 +795,3 @@ VMCIDatagram_CheckHostCapabilities(void)
 {
    return TRUE;
 }
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * DatagramProcessNotify --
- *
- *      Callback to send a notificaton to a vmci process. Creates datagram
- *      copy and signals the process.
- *
- * Results:
- *      VMCI_SUCCESS on success, appropriate error code otherwise.
- *
- * Side effects:
- *      None.
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-DatagramProcessNotify(void *clientData,   // IN:
-                      VMCIDatagram *msg)  // IN:
-{
-   VMCIDatagramProcess *dgmProc = (VMCIDatagramProcess *) clientData;
-   size_t dgmSize;
-   VMCIDatagram *dgm;
-   DatagramQueueEntry *dqEntry;
-   VMCILockFlags flags;
-
-   ASSERT(dgmProc != NULL && msg != NULL);
-   dgmSize = VMCI_DG_SIZE(msg);
-   ASSERT(dgmSize <= VMCI_MAX_DG_SIZE);
-
-   dgm = VMCI_AllocKernelMem(dgmSize,
-                            VMCI_MEMORY_NONPAGED | VMCI_MEMORY_ATOMIC);
-   if (!dgm) {
-      VMCI_WARNING((LGPFX"Failed to allocate datagram of size %d bytes.\n",
-                    (uint32)dgmSize));
-      return VMCI_ERROR_NO_MEM;
-   }
-   memcpy(dgm, msg, dgmSize);
-
-   /* Allocate datagram queue entry and add it to the target fd's queue. */
-   dqEntry = VMCI_AllocKernelMem(sizeof *dqEntry,
-                                VMCI_MEMORY_NONPAGED | VMCI_MEMORY_ATOMIC);
-   if (dqEntry == NULL) {
-      VMCI_FreeKernelMem(dgm, dgmSize);
-      VMCI_WARNING((LGPFX"Failed to allocate memory for process datagram.\n"));
-      return VMCI_ERROR_NO_MEM;
-   }
-   dqEntry->dg = dgm;
-
-   VMCI_GrabLock_BH(&dgmProc->datagramQueueLock, &flags);
-   if (dgmProc->datagramQueueSize + dgmSize >= VMCI_MAX_DATAGRAM_QUEUE_SIZE) {
-      VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags);
-      VMCI_FreeKernelMem(dgm, dgmSize);
-      VMCI_FreeKernelMem(dqEntry, sizeof *dqEntry);
-      VMCI_LOG((LGPFX"Datagram process receive queue is full.\n"));
-      return VMCI_ERROR_NO_RESOURCES;
-   }
-
-   LIST_QUEUE(&dqEntry->listItem, &dgmProc->datagramQueue);
-   dgmProc->pendingDatagrams++;
-   dgmProc->datagramQueueSize += dgmSize;
-#ifdef SOLARIS
-   /*
-    * Release the lock here for Solaris. Otherwise, a deadlock
-    * may occur since pollwakeup(9F) (invoked from VMCIHost_SignalCall)
-    * and poll_common (invoked from poll(2)) try to grab a common lock.
-    * The man pages of pollwakeup(9F) and chpoll(9E) talk about this.
-    */
-   VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags);
-#endif
-   VMCIHost_SignalCall(&dgmProc->host);
-#ifndef SOLARIS
-   /* For platforms other than Solaris, release the lock here. */
-   VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags);
-#endif
-
-   VMCI_DEBUG_LOG(10, (LGPFX"Sent datagram with resource id %d and size %u.\n",
-                       msg->dst.resource, (uint32)dgmSize));
-   /* dqEntry and dgm are freed when user reads call.. */
-
-   return VMCI_SUCCESS;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIDatagramProcess_Create --
- *
- *      Creates a new VMCIDatagramProcess object.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-VMCIDatagramProcess_Create(VMCIDatagramProcess **outDgmProc,          // OUT:
-                           VMCIDatagramCreateProcessInfo *createInfo, // IN:
-                           uintptr_t eventHnd)                        // IN:
-{
-   VMCIDatagramProcess *dgmProc;
-
-   ASSERT(createInfo);
-   ASSERT(outDgmProc);
-   dgmProc = VMCI_AllocKernelMem(sizeof *dgmProc, VMCI_MEMORY_NONPAGED);
-   if (dgmProc == NULL) {
-      return VMCI_ERROR_NO_MEM;
-   }
-
-   VMCI_InitLock(&dgmProc->datagramQueueLock, "VMCIDgmProc",
-                VMCI_LOCK_RANK_MIDDLE_BH);
-   VMCIHost_InitContext(&dgmProc->host, eventHnd);
-   dgmProc->pendingDatagrams = 0;
-   dgmProc->datagramQueueSize = 0;
-   dgmProc->datagramQueue = NULL;
-
-   /*
-    * We pass the result and corresponding handle to user level via the
-    * createInfo.
-    */
-   createInfo->result = VMCIDatagram_CreateHnd(createInfo->resourceID,
-                                               createInfo->flags,
-                                               DatagramProcessNotify,
-                                               (void *)dgmProc,
-                                               &dgmProc->handle);
-   if (createInfo->result < VMCI_SUCCESS) {
-      VMCI_FreeKernelMem(dgmProc, sizeof *dgmProc);
-      return createInfo->result;
-   }
-   createInfo->handle = dgmProc->handle;
-
-   *outDgmProc = dgmProc;
-   return VMCI_SUCCESS;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIDatagramProcess_Destroy --
- *
- *      Destroys a VMCIDatagramProcess object.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-void
-VMCIDatagramProcess_Destroy(VMCIDatagramProcess *dgmProc) // IN:
-{
-   ListItem *curr, *next;
-   DatagramQueueEntry *dqEntry;
-   VMCILockFlags flags;
-
-   if (!dgmProc) {
-      return;
-   }
-
-   if (!VMCI_HANDLE_EQUAL(dgmProc->handle, VMCI_INVALID_HANDLE)) {
-
-      /*
-       * We block in destroy so we know that there can be no more
-       * callbacks to DatagramProcessNotifyCB when we return from
-       * this call.
-       */
-      VMCIDatagram_DestroyHnd(dgmProc->handle);
-      dgmProc->handle = VMCI_INVALID_HANDLE;
-   }
-
-   /* Flush dgmProc's call queue. */
-   VMCI_GrabLock_BH(&dgmProc->datagramQueueLock, &flags);
-   LIST_SCAN_SAFE(curr, next, dgmProc->datagramQueue) {
-      dqEntry = LIST_CONTAINER(curr, DatagramQueueEntry, listItem);
-      LIST_DEL(curr, &dgmProc->datagramQueue);
-      ASSERT(dqEntry && dqEntry->dg);
-      VMCI_FreeKernelMem(dqEntry->dg, VMCI_DG_SIZE(dqEntry->dg));
-      VMCI_FreeKernelMem(dqEntry, sizeof *dqEntry);
-   }
-   VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags);
-   VMCIHost_ReleaseContext(&dgmProc->host);
-   VMCI_CleanupLock(&dgmProc->datagramQueueLock);
-   VMCI_FreeKernelMem(dgmProc, sizeof *dgmProc);
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIDatagramProcess_ReadCall --
- *
- *      Dequeues the next guest call and returns it to user level.
- *
- * Results:
- *      0 on success, appropriate error code otherwise.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-VMCIDatagramProcess_ReadCall(VMCIDatagramProcess *dgmProc, // IN:
-                             size_t maxSize,               // IN: max size of dg
-                             VMCIDatagram **dg)            // OUT:
-{
-   DatagramQueueEntry *dqEntry;
-   ListItem *listItem;
-   VMCILockFlags flags;
-
-   ASSERT(dgmProc);
-   ASSERT(dg);
-
-   /* Dequeue the next dgmProc datagram queue entry. */
-   VMCI_GrabLock_BH(&dgmProc->datagramQueueLock, &flags);
-
-   /*
-    * Currently, we do not support blocking read of datagrams on Mac and
-    * Solaris. XXX: This will go away soon.
-    */
-
-#if defined(SOLARIS) || defined(__APPLE__)
-   if (dgmProc->pendingDatagrams == 0) {
-      VMCIHost_ClearCall(&dgmProc->host);
-      VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags);
-      VMCI_DEBUG_LOG(4, (LGPFX"No datagrams pending.\n"));
-      return VMCI_ERROR_NO_MORE_DATAGRAMS;
-   }
-#else
-   while (dgmProc->pendingDatagrams == 0) {
-      VMCIHost_ClearCall(&dgmProc->host);
-      if (!VMCIHost_WaitForCallLocked(&dgmProc->host,
-                                      &dgmProc->datagramQueueLock,
-                                      &flags, TRUE)) {
-         VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags);
-         VMCI_DEBUG_LOG(4, (LGPFX"Blocking read of datagram interrupted.\n"));
-         return VMCI_ERROR_NO_MORE_DATAGRAMS;
-      }
-   }
-#endif
-
-   listItem = LIST_FIRST(dgmProc->datagramQueue);
-   ASSERT (listItem != NULL);
-
-   dqEntry = LIST_CONTAINER(listItem, DatagramQueueEntry, listItem);
-   ASSERT(dqEntry->dg);
-
-   /* Check the size of the userland buffer. */
-   if (maxSize < VMCI_DG_SIZE(dqEntry->dg)) {
-      VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags);
-      VMCI_DEBUG_LOG(4, (LGPFX"Caller's buffer is too small.\n"));
-      return VMCI_ERROR_NO_MEM;
-   }
-
-   LIST_DEL(listItem, &dgmProc->datagramQueue);
-   dgmProc->pendingDatagrams--;
-   dgmProc->datagramQueueSize -= VMCI_DG_SIZE(dqEntry->dg);
-   if (dgmProc->pendingDatagrams == 0) {
-      VMCIHost_ClearCall(&dgmProc->host);
-   }
-   VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags);
-
-   *dg = dqEntry->dg;
-   VMCI_FreeKernelMem(dqEntry, sizeof *dqEntry);
-
-   return VMCI_SUCCESS;
-}
-
index 8907af499c2e956af805e6db05b77acc469123af..299f64456c91bb3103b5528c5f38d1540d5f8579 100644 (file)
 #include "vmci_infrastructure.h"
 #include "vmci_iocontrols.h"
 
-typedef struct DatagramQueueEntry DatagramQueueEntry;
-typedef struct VMCIDatagramProcess VMCIDatagramProcess;
-
 void VMCIDatagram_Init(void);
 Bool VMCIDatagram_CheckHostCapabilities(void);
 int VMCIDatagram_Dispatch(VMCIId contextID, VMCIDatagram *msg);
 
-int VMCIDatagramProcess_Create(VMCIDatagramProcess **outDgmProc,
-                               VMCIDatagramCreateProcessInfo *createInfo,
-                               uintptr_t eventHnd);
-void VMCIDatagramProcess_Destroy(VMCIDatagramProcess *dgmProc);
-int VMCIDatagramProcess_ReadCall(VMCIDatagramProcess *dgmProc,
-                                size_t maxSize, VMCIDatagram **dg);
-
 #endif //__VMCI_DATAGRAM_H__
index 6f5604ac4aadac81721bee2faf53c1b5d62fda22..ce03fda6ed1ad0dea079f92922fda978875319cb 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "vm_basic_types.h"
 #include "vmci_call_defs.h"
-#include "vmciProcess.h"
 
 #define DODEBUGLOG(...) printk(KERN_DEBUG __VA_ARGS__)
 #define DOLOG(...) printk(KERN_INFO __VA_ARGS__)
diff --git a/open-vm-tools/modules/linux/vmci/vmciProcess.c b/open-vm-tools/modules/linux/vmci/vmciProcess.c
deleted file mode 100644 (file)
index 8f4154a..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-/*********************************************************
- * Copyright (C) 2006 VMware, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 and no later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- *
- *********************************************************/
-
-/*
- * vmciProcess.c --
- *
- *     VMCI Process code for guest driver.
- */
-
-#ifdef __linux__
-#  include "driver-config.h"
-
-#  define EXPORT_SYMTAB
-
-#  include <linux/module.h>
-#  include "compat_kernel.h"
-#  include "compat_pci.h"
-#endif // __linux__
-
-#include "vmci_kernel_if.h"
-#include "vmci_defs.h"
-#include "vmciInt.h"
-#include "vmciProcess.h"
-#include "vmciDatagram.h"
-#include "vmci_infrastructure.h"
-#include "circList.h"
-#include "vmciUtil.h"
-#include "vmciCommonInt.h"
-
-static ListItem *processList = NULL;
-static VMCILock processLock;
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIProcess_Init --
- *
- *      General init code.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-void
-VMCIProcess_Init(void)
-{
-   VMCI_InitLock(&processLock, "VMCIProcessListLock", VMCI_LOCK_RANK_HIGH);
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIProcess_Exit --
- *
- *      General init code.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-void
-VMCIProcess_Exit(void)
-{
-   VMCI_CleanupLock(&processLock);
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * VMCIProcess_CheckHostCapabilities --
- *
- *      Verify that the host supports the hypercalls we need. If it does not,
- *      try to find fallback hypercalls and use those instead.
- *
- * Results:
- *      TRUE if required hypercalls (or fallback hypercalls) are
- *      supported by the host, FALSE otherwise.
- *
- * Side effects:
- *      None.
- *
- *-----------------------------------------------------------------------------
- */
-
-Bool
-VMCIProcess_CheckHostCapabilities(void)
-{
-   /* VMCIProcess does not require any hypercalls. */
-   return TRUE;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIProcess_Create --
- *
- *      Creates a new VMCI process.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-VMCIProcess_Create(VMCIProcess **outProcess) // IN
-{
-   VMCIProcess *process;
-   VMCILockFlags flags;
-
-   process = VMCI_AllocKernelMem(sizeof *process, VMCI_MEMORY_NONPAGED);
-   if (process == NULL) {
-      return VMCI_ERROR_NO_MEM;
-   }
-
-   process->pid = (VMCIId)(uintptr_t)process >> 1;
-
-   VMCI_GrabLock(&processLock, &flags);
-   LIST_QUEUE(&process->listItem, &processList);
-   VMCI_ReleaseLock(&processLock, flags);
-
-   *outProcess = process;
-   return 0;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIProcess_Destroy --
- *
- *      Destroys a VMCI process.
- *
- * Results:
- *      None.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-void
-VMCIProcess_Destroy(VMCIProcess *process)
-{
-   VMCILockFlags flags;
-
-   /* Dequeue process. */
-   VMCI_GrabLock(&processLock, &flags);
-   LIST_DEL(&process->listItem, &processList);
-   VMCI_ReleaseLock(&processLock, flags);
-
-   VMCI_FreeKernelMem(process, sizeof *process);
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIProcess_Get --
- *
- *      Get the process corresponding to the pid.
- *
- * Results:
- *      VMCI process on success, NULL otherwise.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-VMCIProcess *
-VMCIProcess_Get(VMCIId processID)  // IN
-{
-   VMCIProcess *process = NULL;
-   ListItem *next;
-   VMCILockFlags flags;
-
-   VMCI_GrabLock(&processLock, &flags);
-   if (processList == NULL) {
-      goto out;
-   }
-
-   LIST_SCAN(next, processList) {
-      process = LIST_CONTAINER(next, VMCIProcess, listItem);
-      if (process->pid == processID) {
-         break;
-      }
-   }
-
-out:
-   VMCI_ReleaseLock(&processLock, flags);
-   return (process && process->pid == processID) ? process : NULL;
-}
diff --git a/open-vm-tools/modules/linux/vmci/vmciProcess.h b/open-vm-tools/modules/linux/vmci/vmciProcess.h
deleted file mode 100644 (file)
index 4b05577..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*********************************************************
- * Copyright (C) 2006 VMware, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 and no later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- *
- *********************************************************/
-
-/* 
- * vmciProcess.h --
- *
- *      Process code for the Linux guest driver
- */
-
-#ifndef __VMCI_PROCESS_H__
-#define __VMCI_PROCESS_H__
-
-#define INCLUDE_ALLOW_MODULE
-#include "includeCheck.h"
-
-#include "vm_basic_types.h"
-
-#include "vmci_defs.h"
-#include "vmci_handle_array.h"
-
-typedef struct VMCIProcess VMCIProcess;
-
-void VMCIProcess_Init(void);
-void VMCIProcess_Exit(void);
-Bool VMCIProcess_CheckHostCapabilities(void);
-int VMCIProcess_Create(VMCIProcess **outProcess);
-void VMCIProcess_Destroy(VMCIProcess *process);
-VMCIProcess *VMCIProcess_Get(VMCIId processID);
-               
-#endif //__VMCI_PROCESS_H__
index e07dc4e3ffba31cb1afe3703ef1ea72ce1fc0c86..6b7add5b9fbd10f745d46bb1fc5124c71f3ed631 100644 (file)
@@ -55,7 +55,6 @@
 #include "vmci_kernel_if.h"
 #include "vmciGuestKernelIf.h"
 #include "vmciInt.h"
-#include "vmciProcess.h"
 #include "vmciDatagram.h"
 #include "vmciUtil.h"
 #include "vmciEvent.h"
@@ -275,7 +274,6 @@ Bool
 VMCI_CheckHostCapabilities(void)
 {
    Bool result = VMCIEvent_CheckHostCapabilities();
-   result &= VMCIProcess_CheckHostCapabilities();
    result &= VMCIDatagram_CheckHostCapabilities();
    result &= VMCIUtil_CheckHostCapabilities();
 
index 1d2ea9e142bba311fbac2294fdc437ff6041fd0d..84c6a7c500ff25ee9e4a5920b8ba8e489d58b0a1 100644 (file)
 #include <linux/moduleparam.h>
 #include <linux/poll.h>
 
-#include "compat_kernel.h"
-#include "compat_module.h"
-#include "compat_pci.h"
 #include "compat_init.h"
-#include "compat_ioport.h"
 #include "compat_interrupt.h"
-#include "compat_page.h"
+#include "compat_ioport.h"
+#include "compat_kernel.h"
+#include "compat_module.h"
 #include "compat_mutex.h"
+#include "compat_page.h"
+#include "compat_pci.h"
+
+#include "kernelStubs.h"
+
 #include "vm_basic_types.h"
 #include "vm_device_version.h"
-#include "kernelStubs.h"
-#include "vmci_iocontrols.h"
+
 #include "vmci_defs.h"
-#include "vmciInt.h"
 #include "vmci_infrastructure.h"
+#include "vmci_iocontrols.h"
+#include "vmci_version.h"
 #include "vmciDatagram.h"
-#include "vmciProcess.h"
-#include "vmciUtil.h"
 #include "vmciEvent.h"
+#include "vmciInt.h"
 #include "vmciNotifications.h"
 #include "vmciQueuePairInt.h"
-#include "vmci_version.h"
-#include "vmciCommonInt.h"
+#include "vmciUtil.h"
 
 #define LGPFX "VMCI: "
 #define VMCI_DEVICE_MINOR_NUM 0
@@ -409,7 +410,6 @@ vmci_probe_device(struct pci_dev *pdev,           // IN: vmci PCI device
     * components, and it may be invoked once request_irq() has
     * registered the handler (as the irq line may be shared).
     */
-   VMCIProcess_Init();
    VMCIDatagram_Init();
    VMCIEvent_Init();
    VMCIUtil_Init();
@@ -479,7 +479,6 @@ vmci_probe_device(struct pci_dev *pdev,           // IN: vmci PCI device
    VMCINotifications_Exit();
    VMCIUtil_Exit();
    VMCIEvent_Exit();
-   VMCIProcess_Exit();
    if (vmci_dev.intr_type == VMCI_INTR_TYPE_MSIX) {
       pci_disable_msix(pdev);
    } else if (vmci_dev.intr_type == VMCI_INTR_TYPE_MSI) {
@@ -531,7 +530,6 @@ vmci_remove_device(struct pci_dev* pdev)
    VMCIUtil_Exit();
    VMCIEvent_Exit();
    //VMCIDatagram_Exit();
-   VMCIProcess_Exit();
 
    compat_mutex_lock(&dev->lock);
    printk(KERN_INFO "Resetting vmci device\n");
@@ -649,11 +647,6 @@ vmci_close(struct inode *inode,  // IN
       (VMCIGuestDeviceHandle *) file->private_data;
 
    if (devHndl) {
-      if (devHndl->objType == VMCIOBJ_PROCESS) {
-         VMCIProcess_Destroy((VMCIProcess *) devHndl->obj);
-      } else if (devHndl->objType == VMCIOBJ_DATAGRAM_PROCESS) {
-         VMCIDatagramProcess_Destroy((VMCIDatagramProcess *) devHndl->obj);
-      }
       VMCI_FreeKernelMem(devHndl, sizeof *devHndl);
       file->private_data = NULL;
    }
@@ -682,183 +675,7 @@ vmci_ioctl(struct file *file,    // IN
            unsigned int cmd,     // IN
            unsigned long arg)    // IN
 {
-#ifndef VMX86_DEVEL
    return -ENOTTY;
-#else
-   int retval;
-   VMCIGuestDeviceHandle *devHndl = file->private_data;
-
-   if (devHndl == NULL) {
-      return -EINVAL;
-   }
-
-   compat_mutex_lock(&vmci_dev.lock);
-
-   /*
-    * When adding new ioctls make sure that their data structures are same
-    * for i386 and x86_64 architectures, as this handler is used for both ia32
-    * and x86_64 ioctls.
-    */
-   switch (cmd) {
-   case IOCTL_VMCI_CREATE_PROCESS: {
-      if (devHndl->objType != VMCIOBJ_NOT_SET) {
-         printk("VMCI: Received IOCTLCMD_VMCI_CREATE_PROCESS on "
-                "initialized handle.\n");
-         retval = -EINVAL;
-         break;
-      }
-      ASSERT(!devHndl->obj);
-      retval = VMCIProcess_Create((VMCIProcess **) &devHndl->obj);
-      if (retval != 0) {
-         printk("VMCI: Failed to create process.\n");
-         break;
-      }
-      devHndl->objType = VMCIOBJ_PROCESS;
-      break;
-   }
-
-   case IOCTL_VMCI_CREATE_DATAGRAM_PROCESS: {
-      VMCIDatagramCreateProcessInfo createInfo;
-      VMCIDatagramProcess *dgmProc;
-
-      if (devHndl->objType != VMCIOBJ_NOT_SET) {
-         printk("VMCI: Received IOCTLCMD_VMCI_CREATE_DATAGRAM_PROCESS on "
-                "initialized handle.\n");
-         retval = -EINVAL;
-         break;
-      }
-      ASSERT(!devHndl->obj);
-
-      retval = copy_from_user(&createInfo, (void *)arg, sizeof createInfo);
-      if (retval != 0) {
-        printk("VMCI: Error getting datagram create info, %d.\n", retval);
-        retval = -EFAULT;
-        break;
-      }
-
-      if (VMCIDatagramProcess_Create(&dgmProc, &createInfo,
-                                     0 /* Unused */) < VMCI_SUCCESS) {
-        retval = -EINVAL;
-        break;
-      }
-
-      retval = copy_to_user((void *)arg, &createInfo, sizeof createInfo);
-      if (retval != 0) {
-         VMCIDatagramProcess_Destroy(dgmProc);
-         printk("VMCI: Failed to create datagram process.\n");
-        retval = -EFAULT;
-         break;
-      }
-      devHndl->obj = dgmProc;
-      devHndl->objType = VMCIOBJ_DATAGRAM_PROCESS;
-      break;
-   }
-
-   case IOCTL_VMCI_DATAGRAM_SEND: {
-      VMCIDatagramSendRecvInfo sendInfo;
-      VMCIDatagram *dg;
-
-      if (devHndl->objType != VMCIOBJ_DATAGRAM_PROCESS) {
-         printk("VMCI: Ioctl %d only valid for process datagram handle.\n",
-               cmd);
-         retval = -EINVAL;
-         break;
-      }
-
-      retval = copy_from_user(&sendInfo, (void *) arg, sizeof sendInfo);
-      if (retval) {
-         printk("VMCI: copy_from_user failed.\n");
-         retval = -EFAULT;
-         break;
-      }
-
-      if (sendInfo.len > VMCI_MAX_DG_SIZE) {
-         printk("VMCI: datagram size too big.\n");
-        retval = -EINVAL;
-        break;
-      }
-
-      dg = VMCI_AllocKernelMem(sendInfo.len, VMCI_MEMORY_NORMAL);
-      if (dg == NULL) {
-         printk("VMCI: Cannot allocate memory to dispatch datagram.\n");
-         retval = -ENOMEM;
-         break;
-      }
-
-      retval = copy_from_user(dg, (char *)(VA)sendInfo.addr, sendInfo.len);
-      if (retval != 0) {
-         printk("VMCI: Error getting datagram: %d\n", retval);
-         VMCI_FreeKernelMem(dg, sendInfo.len);
-         retval = -EFAULT;
-         break;
-      }
-
-      DEBUG_ONLY(printk("VMCI: Datagram dst handle 0x%x:0x%x, src handle "
-                       "0x%x:0x%x, payload size %"FMT64"u.\n",
-                       dg->dst.context, dg->dst.resource,
-                       dg->src.context, dg->src.resource, dg->payloadSize));
-
-      sendInfo.result = VMCIDatagram_Send(dg);
-      VMCI_FreeKernelMem(dg, sendInfo.len);
-
-      retval = copy_to_user((void *)arg, &sendInfo, sizeof sendInfo);
-      break;
-   }
-
-   case IOCTL_VMCI_DATAGRAM_RECEIVE: {
-      VMCIDatagramSendRecvInfo recvInfo;
-      VMCIDatagram *dg = NULL;
-
-      if (devHndl->objType != VMCIOBJ_DATAGRAM_PROCESS) {
-         printk("VMCI: Ioctl %d only valid for process datagram handle.\n",
-               cmd);
-         retval = -EINVAL;
-         break;
-      }
-
-      retval = copy_from_user(&recvInfo, (void *) arg, sizeof recvInfo);
-      if (retval) {
-         printk("VMCI: copy_from_user failed.\n");
-         retval = -EFAULT;
-         break;
-      }
-
-      ASSERT(devHndl->obj);
-      recvInfo.result =
-        VMCIDatagramProcess_ReadCall((VMCIDatagramProcess *)devHndl->obj,
-                                     recvInfo.len, &dg);
-      if (recvInfo.result < VMCI_SUCCESS) {
-        retval = -EINVAL;
-        break;
-      }
-      ASSERT(dg);
-      retval = copy_to_user((void *) ((uintptr_t) recvInfo.addr), dg,
-                           VMCI_DG_SIZE(dg));
-      VMCI_FreeKernelMem(dg, VMCI_DG_SIZE(dg));
-      if (retval != 0) {
-        break;
-      }
-      retval = copy_to_user((void *)arg, &recvInfo, sizeof recvInfo);
-      break;
-   }
-
-   case IOCTL_VMCI_GET_CONTEXT_ID: {
-      VMCIId cid = VMCI_GetContextID();
-
-      retval = copy_to_user((void *)arg, &cid, sizeof cid);
-      break;
-   }
-   default:
-      printk(KERN_DEBUG "vmci_ioctl(): unknown ioctl 0x%x.\n", cmd);
-      retval = -EINVAL;
-      break;
-   }
-
-   compat_mutex_unlock(&vmci_dev.lock);
-
-   return retval;
-#endif
 }
 
 
@@ -910,34 +727,7 @@ static unsigned int
 vmci_poll(struct file *file, // IN
           poll_table *wait)  // IN
 {
-   VMCILockFlags flags;
-   unsigned int mask = 0;
-   VMCIGuestDeviceHandle *devHndl =
-      (VMCIGuestDeviceHandle *) file->private_data;
-
-   /*
-    * Check for call to this VMCI process.
-    */
-
-   if (!devHndl) {
-      return mask;
-   }
-   if (devHndl->objType == VMCIOBJ_DATAGRAM_PROCESS) {
-      VMCIDatagramProcess *dgmProc = (VMCIDatagramProcess *) devHndl->obj;
-      ASSERT(dgmProc);
-
-      if (wait != NULL) {
-         poll_wait(file, &dgmProc->host.waitQueue, wait);
-      }
-
-      VMCI_GrabLock_BH(&dgmProc->datagramQueueLock, &flags);
-      if (dgmProc->pendingDatagrams > 0) {
-         mask = POLLIN;
-      }
-      VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags);
-   }
-
-   return mask;
+   return 0;
 }
 
 
index 394b9fd359a0922074dd2ef42c677411d06204c7..259fd55d02c1fe6b467e78dd17d2a2ce9b558407 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef _VMCI_VERSION_H_
 #define _VMCI_VERSION_H_
 
-#define VMCI_DRIVER_VERSION          9.1.0.0
-#define VMCI_DRIVER_VERSION_COMMAS   9,1,0,0
-#define VMCI_DRIVER_VERSION_STRING   "9.1.0.0"
+#define VMCI_DRIVER_VERSION          9.1.1.0
+#define VMCI_DRIVER_VERSION_COMMAS   9,1,1,0
+#define VMCI_DRIVER_VERSION_STRING   "9.1.1.0"
 
 #endif /* _VMCI_VERSION_H_ */