Index: /trunk/include/VBox/VBoxGuest.h
===================================================================
--- /trunk/include/VBox/VBoxGuest.h	(revision 50536)
+++ /trunk/include/VBox/VBoxGuest.h	(revision 50537)
@@ -378,5 +378,24 @@
 
 /** IOCTL to for setting the mouse driver callback. (kernel only) */
+/** @note The callback will be called in interrupt context with the VBoxGuest
+ * device event spinlock held. */
 #define VBOXGUEST_IOCTL_SET_MOUSE_NOTIFY_CALLBACK   VBOXGUEST_IOCTL_CODE(31, sizeof(VBoxGuestMouseSetNotifyCallback))
+
+typedef DECLCALLBACK(void) FNVBOXGUESTMOUSENOTIFY(void *pfnUser);
+typedef FNVBOXGUESTMOUSENOTIFY *PFNVBOXGUESTMOUSENOTIFY;
+
+/** Input buffer for VBOXGUEST_IOCTL_INTERNAL_SET_MOUSE_NOTIFY_CALLBACK. */
+typedef struct VBoxGuestMouseSetNotifyCallback
+{
+    /**
+     * Mouse notification callback.
+     *
+     * @param   pvUser      The callback argument.
+     */
+    PFNVBOXGUESTMOUSENOTIFY      pfnNotify;
+    /** The callback argument*/
+    void                       *pvUser;
+} VBoxGuestMouseSetNotifyCallback;
+
 
 typedef enum VBOXGUESTCAPSACQUIRE_FLAGS
@@ -433,21 +452,4 @@
 
 
-typedef DECLCALLBACK(void) FNVBOXGUESTMOUSENOTIFY(void *pfnUser);
-typedef FNVBOXGUESTMOUSENOTIFY *PFNVBOXGUESTMOUSENOTIFY;
-
-/** Input buffer for VBOXGUEST_IOCTL_INTERNAL_SET_MOUSE_NOTIFY_CALLBACK. */
-typedef struct VBoxGuestMouseSetNotifyCallback
-{
-    /**
-     * Mouse notification callback.
-     *
-     * @param   pvUser      The callback argument.
-     */
-    PFNVBOXGUESTMOUSENOTIFY      pfnNotify;
-    /** The callback argument*/
-    void                       *pvUser;
-} VBoxGuestMouseSetNotifyCallback;
-
-
 #ifdef RT_OS_OS2
 
Index: /trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp	(revision 50536)
+++ /trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp	(revision 50537)
@@ -927,5 +927,4 @@
     pDevExt->MouseNotifyCallback.pfnNotify = NULL;
     pDevExt->MouseNotifyCallback.pvUser = NULL;
-    pDevExt->cISR = 0;
 
     /*
@@ -1463,11 +1462,4 @@
  * @param   pDevExt         The device extension.
  * @param   pNotify         The new callback information.
- * @note  This function takes the session spinlock to update the callback
- *        information, but the interrupt handler will not do this.  To make
- *        sure that the interrupt handler sees a consistent structure, we
- *        set the function pointer to NULL before updating the data and only
- *        set it to the correct value once the data is updated.  Since the
- *        interrupt handler executes atomically this ensures that the data is
- *        valid if the function pointer is non-NULL.
  */
 int VBoxGuestCommonIOCtl_SetMouseNotifyCallback(PVBOXGUESTDEVEXT pDevExt, VBoxGuestMouseSetNotifyCallback *pNotify)
@@ -1478,10 +1470,4 @@
     pDevExt->MouseNotifyCallback = *pNotify;
     RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
-
-    /* Make sure no active ISR is referencing the old data - hacky but should be
-     * effective. */
-    while (pDevExt->cISR > 0)
-        ASMNopPause();
-
     return VINF_SUCCESS;
 }
@@ -2969,7 +2955,4 @@
 bool VBoxGuestCommonISR(PVBOXGUESTDEVEXT pDevExt)
 {
-#ifndef RT_OS_WINDOWS
-    VBoxGuestMouseSetNotifyCallback MouseNotifyCallback   = { NULL, NULL };
-#endif
     bool                            fMousePositionChanged = false;
     VMMDevEvents volatile          *pReq                  = pDevExt->pIrqAckEvents;
@@ -2984,9 +2967,7 @@
 
     /*
-     * Enter the spinlock, increase the ISR count and check if it's our IRQ or
-     * not.
+     * Enter the spinlock and check if it's our IRQ or not.
      */
     RTSpinlockAcquire(pDevExt->EventSpinlock);
-    ASMAtomicIncU32(&pDevExt->cISR);
     fOurIrq = pDevExt->pVMMDevMemory->V.V1_04.fHaveEvents;
     if (fOurIrq)
@@ -3014,9 +2995,11 @@
             if (fEvents & VMMDEV_EVENT_MOUSE_POSITION_CHANGED)
             {
-#ifndef RT_OS_WINDOWS
-                MouseNotifyCallback = pDevExt->MouseNotifyCallback;
-#endif
                 fMousePositionChanged = true;
                 fEvents &= ~VMMDEV_EVENT_MOUSE_POSITION_CHANGED;
+#ifndef RT_OS_WINDOWS
+                if (pDevExt->MouseNotifyCallback.pfnNotify)
+                    pDevExt->MouseNotifyCallback.pfnNotify
+                                          (pDevExt->MouseNotifyCallback.pvUser);
+#endif
             }
 
@@ -3096,11 +3079,6 @@
         ASMAtomicIncU32(&pDevExt->u32MousePosChangedSeq);
         VBoxGuestNativeISRMousePollEvent(pDevExt);
-#ifndef RT_OS_WINDOWS
-        if (MouseNotifyCallback.pfnNotify)
-            MouseNotifyCallback.pfnNotify(MouseNotifyCallback.pvUser);
-#endif
-    }
-
-    ASMAtomicDecU32(&pDevExt->cISR);
+    }
+
     Assert(rc == 0);
     NOREF(rc);
Index: /trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h	(revision 50536)
+++ /trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h	(revision 50537)
@@ -170,7 +170,4 @@
     /** Memory balloon information for RTR0MemObjAllocPhysNC(). */
     VBOXGUESTMEMBALLOON         MemBalloon;
-    /** Counter of number of active ISRs.  Currently used for safely removing
-     * the mouse handler callback. */
-    uint32_t volatile           cISR;
     /** Callback and user data for a kernel mouse handler. */
     VBoxGuestMouseSetNotifyCallback MouseNotifyCallback;
