int VMCI_CopyFromUser(void *dst, VA64 src, size_t len);
#endif
-#if defined(_WIN32)
-void VMCI_InitHelperQueue(void);
-void VMCI_ExitHelperQueue(void);
-#endif // _WIN32
-
typedef void (VMCIWorkFn)(void *data);
Bool VMCI_CanScheduleDelayedWork(void);
int VMCI_ScheduleDelayedWork(VMCIWorkFn *workFn,
void VMCIMutex_Acquire(VMCIMutex *mutex);
void VMCIMutex_Release(VMCIMutex *mutex);
-#if defined(SOLARIS)
+#if defined(SOLARIS) || defined(_WIN32)
int VMCIKernelIf_Init(void);
void VMCIKernelIf_Exit(void);
-#endif /* SOLARIS */
+#endif // SOLARIS || _WIN32
#if !defined(VMKERNEL) && (defined(__linux__) || defined(_WIN32) || \
defined(SOLARIS) || defined(__APPLE__))
void VMCI_RevertToNonLocalQueue(struct VMCIQueue *queueInfo,
void *nonLocalQueue, uint64 size);
void VMCI_FreeQueueBuffer(void *queue, uint64 size);
+void VMCI_DeviceShutdownBegin(void);
+void VMCI_DeviceShutdownEnd(void);
+Bool VMCI_DeviceShutdown(void);
#else // _WIN32
# define VMCI_InitQueueMutex(_pq, _cq)
# define VMCI_AcquireQueueMutex(_q)
# define VMCI_ConvertToLocalQueue(_pq, _cq, _s, _oq, _kc) VMCI_ERROR_UNAVAILABLE
# define VMCI_RevertToNonLocalQueue(_q, _nlq, _s)
# define VMCI_FreeQueueBuffer(_q, _s)
+# define VMCI_DeviceShutdown() FALSE
#endif // !_WIN32
+
#endif // _VMCI_KERNEL_IF_H_
ASSERT(entry);
VMCI_GrabLock_BH(&hashTable.lock, &flags);
+
+ /* Do not allow addition of a new handle if the device is being shutdown. */
+ if (VMCI_DeviceShutdown()) {
+ VMCI_ReleaseLock_BH(&hashTable.lock, flags);
+ return VMCI_ERROR_DEVICE_NOT_FOUND;
+ }
+
if (!VMCI_HANDLE_INVALID(entry->handle) &&
!DatagramHandleUniqueLockedAnyCid(entry->handle)) {
VMCI_ReleaseLock_BH(&hashTable.lock, flags);
}
}
-
if ((flags & VMCI_FLAG_WELLKNOWN_DG_HND) != 0) {
VMCIDatagramWellKnownMapMsg wkMsg;
if (resourceID == VMCI_INVALID_ID) {
{
return TRUE;
}
+
+
+/*
+ * VMCIDatagram_Sync --
+ *
+ * Use this as a synchronization point when setting globals, for example,
+ * during device shutdown.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+VMCIDatagram_Sync(void)
+{
+ VMCILockFlags flags;
+ VMCI_GrabLock_BH(&hashTable.lock, &flags);
+ VMCI_ReleaseLock_BH(&hashTable.lock, flags);
+}
#include "vmci_iocontrols.h"
void VMCIDatagram_Init(void);
+void VMCIDatagram_Sync(void);
Bool VMCIDatagram_CheckHostCapabilities(void);
int VMCIDatagram_Dispatch(VMCIId contextID, VMCIDatagram *msg);
VMCI_CleanupLock(&subscriberLock);
}
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * VMCIEvent_Sync --
+ *
+ * Use this as a synchronization point when setting globals, for example,
+ * during device shutdown.
+ *
+ * Results:
+ * TRUE.
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+VMCIEvent_Sync(void)
+{
+ VMCILockFlags lockFlags;
+ VMCIEventGrabLock(&subscriberLock, &lockFlags);
+ VMCIEventReleaseLock(&subscriberLock, lockFlags);
+}
+
+
#ifdef VMX86_TOOLS
/*
*-----------------------------------------------------------------------------
sub->callbackData = callbackData;
VMCIEventGrabLock(&subscriberLock, &lockFlags);
+
+ /* Do not allow a new subscription if the device is being shutdown. */
+ if (VMCI_DeviceShutdown()) {
+ result = VMCI_ERROR_DEVICE_NOT_FOUND;
+ goto exit;
+ }
+
for (success = FALSE, attempts = 0;
success == FALSE && attempts < VMCI_EVENT_MAX_ATTEMPTS;
attempts++) {
} else {
result = VMCI_ERROR_NO_RESOURCES;
}
- VMCIEventReleaseLock(&subscriberLock, lockFlags);
+exit:
+ VMCIEventReleaseLock(&subscriberLock, lockFlags);
return result;
# undef VMCI_EVENT_MAX_ATTEMPTS
}
void VMCIEvent_Init(void);
void VMCIEvent_Exit(void);
+void VMCIEvent_Sync(void);
int VMCIEvent_Dispatch(VMCIDatagram *msg);
#ifdef VMX86_TOOLS
Bool VMCIEvent_CheckHostCapabilities(void);
}
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * VMCINotifications_Sync --
+ *
+ * Use this as a synchronization point when setting globals, for example,
+ * during device shutdown.
+ *
+ * Results:
+ * TRUE.
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+VMCINotifications_Sync(void)
+{
+ VMCILockFlags flags;
+ VMCI_GrabLock_BH(&vmciNotifyHT.lock, &flags);
+ VMCI_ReleaseLock_BH(&vmciNotifyHT.lock, flags);
+}
+
+
/*
*----------------------------------------------------------------------
*
VMCI_GrabLock_BH(&vmciNotifyHT.lock, &flags);
+ /* Do not allow addition of a new handle if the device is being shutdown. */
+ if (VMCI_DeviceShutdown()) {
+ result = VMCI_ERROR_DEVICE_NOT_FOUND;
+ goto out;
+ }
+
if (VMCI_HANDLE_INVALID(entry->handle)) {
VMCIHandle newHandle;
VMCIId oldRID = notifyRID;
void VMCINotifications_Init(void);
void VMCINotifications_Exit(void);
+void VMCINotifications_Sync(void);
Bool VMCI_RegisterNotificationBitmap(PPN bitmapPPN);
void VMCI_ScanNotificationBitmap(uint8 *bitmap);
}
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * VMCIQueuePair_Sync --
+ *
+ * Use this as a synchronization point when setting globals, for example,
+ * during device shutdown.
+ *
+ * Results:
+ * TRUE.
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+VMCIQueuePair_Sync(void)
+{
+ QueuePairList_Lock();
+ QueuePairList_Unlock();
+}
+
+
/*
*-----------------------------------------------------------------------------
*
QueuePairList_Lock();
+ /* Do not allow alloc/attach if the device is being shutdown. */
+ if (VMCI_DeviceShutdown()) {
+ result = VMCI_ERROR_DEVICE_NOT_FOUND;
+ goto error;
+ }
+
if ((Atomic_Read(&queuePairList.hibernate) == 1) &&
!(flags & VMCI_QPFLAG_LOCAL)) {
/*
* ones.
*/
- QueuePairList_Unlock();
- return VMCI_ERROR_UNAVAILABLE;
+ result = VMCI_ERROR_UNAVAILABLE;
+ goto error;
}
if ((queuePairEntry = QueuePairList_FindEntry(*handle))) {
void VMCIQueuePair_Init(void);
void VMCIQueuePair_Exit(void);
+void VMCIQueuePair_Sync(void);
int VMCIQueuePair_Alloc(VMCIHandle *handle, VMCIQueue **produceQ,
uint64 produceSize, VMCIQueue **consumeQ,
uint64 consumeSize, VMCIId peer, uint32 flags);
#ifndef _VMCI_VERSION_H_
#define _VMCI_VERSION_H_
-#define VMCI_DRIVER_VERSION 9.1.3.0
-#define VMCI_DRIVER_VERSION_COMMAS 9,1,3,0
-#define VMCI_DRIVER_VERSION_STRING "9.1.3.0"
+#define VMCI_DRIVER_VERSION 9.1.4.0
+#define VMCI_DRIVER_VERSION_COMMAS 9,1,4,0
+#define VMCI_DRIVER_VERSION_STRING "9.1.4.0"
#endif /* _VMCI_VERSION_H_ */