Index: /trunk/src/VBox/VMM/PDMQueue.cpp
===================================================================
--- /trunk/src/VBox/VMM/PDMQueue.cpp	(revision 29901)
+++ /trunk/src/VBox/VMM/PDMQueue.cpp	(revision 29902)
@@ -666,10 +666,11 @@
 
     /*
-     * Only let one EMT flushing queues at any one time to queue preserve order
+     * Only let one EMT flushing queues at any one time to preserve the order
      * and to avoid wasting time. The FF is always cleared here, because it's
      * only used to get someones attention. Queue inserts occuring during the
      * flush are caught using the pending bit.
      *
-     * Note. The order in which the FF and pending bit are set and cleared is important.
+     * Note! The order in which the FF and pending bit are set and cleared is
+     *       important.
      */
     VM_FF_CLEAR(pVM, VM_FF_PDM_QUEUES);
@@ -856,57 +857,4 @@
 
 /**
- * This is a worker function used by PDMQueueFlush to perform the
- * flush in ring-3.
- *
- * The queue which should be flushed is pointed to by either pQueueFlushRC,
- * pQueueFlushR0, or pQueue. This function will flush that queue and recalc
- * the queue FF.
- *
- * @param   pVM     The VM handle.
- * @param   pQueue  The queue to flush. Only used in Ring-3.
- */
-VMMR3DECL(void) PDMR3QueueFlushWorker(PVM pVM, PPDMQUEUE pQueue)
-{
-    Assert(pVM->pdm.s.pQueueFlushR0 || pVM->pdm.s.pQueueFlushRC || pQueue);
-    VM_ASSERT_EMT(pVM);
-
-    /** @todo This will clash with PDMR3QueueFlushAll (guest SMP)! */
-    Assert(!(pVM->pdm.s.fQueueFlushing & PDM_QUEUE_FLUSH_FLAG_ACTIVE));
-
-    /*
-     * Flush the queue.
-     */
-    if (!pQueue && pVM->pdm.s.pQueueFlushRC)
-    {
-        pQueue = (PPDMQUEUE)MMHyperRCToR3(pVM, pVM->pdm.s.pQueueFlushRC);
-        pVM->pdm.s.pQueueFlushRC = NIL_RTRCPTR;
-    }
-    else if (!pQueue && pVM->pdm.s.pQueueFlushR0)
-    {
-        pQueue = (PPDMQUEUE)MMHyperR0ToR3(pVM, pVM->pdm.s.pQueueFlushR0);
-        pVM->pdm.s.pQueueFlushR0 = NIL_RTR0PTR;
-    }
-    Assert(!pVM->pdm.s.pQueueFlushR0 && !pVM->pdm.s.pQueueFlushRC);
-
-    if (    !pQueue
-        ||  pdmR3QueueFlush(pQueue))
-    {
-        /*
-         * Recalc the FF (for the queues using force action).
-         */
-        VM_FF_CLEAR(pVM, VM_FF_PDM_QUEUES);
-        for (pQueue = pVM->pUVM->pdm.s.pQueuesForced; pQueue; pQueue = pQueue->pNext)
-            if (    pQueue->pPendingRC
-                ||  pQueue->pPendingR0
-                ||  pQueue->pPendingR3)
-            {
-                VM_FF_SET(pVM, VM_FF_PDM_QUEUES);
-                break;
-            }
-    }
-}
-
-
-/**
  * Free an item.
  *
Index: /trunk/src/VBox/VMM/VMM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMM.cpp	(revision 29901)
+++ /trunk/src/VBox/VMM/VMM.cpp	(revision 29902)
@@ -403,5 +403,4 @@
     STAM_REG(pVM, &pVM->vmm.s.StatRZRetCallRing3,           STAMTYPE_COUNTER, "/VMM/RZCallR3/Misc",             STAMUNIT_OCCURENCES, "Number of Other ring-3 calls.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZCallPDMLock,            STAMTYPE_COUNTER, "/VMM/RZCallR3/PDMLock",          STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PDM_LOCK calls.");
-    STAM_REG(pVM, &pVM->vmm.s.StatRZCallPDMQueueFlush,      STAMTYPE_COUNTER, "/VMM/RZCallR3/PDMQueueFlush",    STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PDM_QUEUE_FLUSH calls.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZCallPGMLock,            STAMTYPE_COUNTER, "/VMM/RZCallR3/PGMLock",          STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PGM_LOCK calls.");
     STAM_REG(pVM, &pVM->vmm.s.StatRZCallPGMPoolGrow,        STAMTYPE_COUNTER, "/VMM/RZCallR3/PGMPoolGrow",      STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PGM_POOL_GROW calls.");
@@ -2026,14 +2025,4 @@
         {
             pVCpu->vmm.s.rcCallRing3 = PDMR3LockCall(pVM);
-            break;
-        }
-
-        /*
-         * Flush a PDM queue.
-         */
-        case VMMCALLRING3_PDM_QUEUE_FLUSH:
-        {
-            PDMR3QueueFlushWorker(pVM, NULL);
-            pVCpu->vmm.s.rcCallRing3 = VINF_SUCCESS;
             break;
         }
Index: /trunk/src/VBox/VMM/VMMAll/PDMAllQueue.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/PDMAllQueue.cpp	(revision 29901)
+++ /trunk/src/VBox/VMM/VMMAll/PDMAllQueue.cpp	(revision 29902)
@@ -79,4 +79,12 @@
     Assert(VALID_PTR(pItem));
 
+#if 0 /* the paranoid android version: */
+    void *pvNext;
+    do
+    {
+        pvNext = ASMAtomicUoReadPtr((void * volatile *)&pQueue->CTX_SUFF(pPending));
+        ASMAtomicUoWritePtr((void * volatile *)&pItem->CTX_SUFF(pNext), pvNext);
+    } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pQueue->CTX_SUFF(pPending), pItem, pvNext));
+#else
     PPDMQUEUEITEMCORE pNext;
     do
@@ -85,4 +93,5 @@
         pItem->CTX_SUFF(pNext) = pNext;
     } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pQueue->CTX_SUFF(pPending), pItem, pNext));
+#endif
 
     if (!pQueue->pTimer)
@@ -170,23 +179,2 @@
 }
 
-
-/**
- * Flushes a PDM queue.
- *
- * @param   pQueue          The queue handle.
- */
-VMMDECL(void) PDMQueueFlush(PPDMQUEUE pQueue)
-{
-    Assert(VALID_PTR(pQueue));
-    Assert(pQueue->pVMR3);
-    PVM pVM = pQueue->CTX_SUFF(pVM);
-
-#if defined(IN_RC) || defined(IN_RING0)
-    Assert(pQueue->CTX_SUFF(pVM));
-    pVM->pdm.s.CTX_SUFF(pQueueFlush) = pQueue;
-    VMMRZCallRing3NoCpu(pVM, VMMCALLRING3_PDM_QUEUE_FLUSH, (uintptr_t)pQueue);
-
-#else /* IN_RING3: */
-    VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)PDMR3QueueFlushWorker, 2, pVM, pQueue);
-#endif
-}
Index: /trunk/src/VBox/VMM/VMMGC/VMMGC.def
===================================================================
--- /trunk/src/VBox/VMM/VMMGC/VMMGC.def	(revision 29901)
+++ /trunk/src/VBox/VMM/VMMGC/VMMGC.def	(revision 29902)
@@ -27,5 +27,4 @@
     PDMCritSectIsOwner
     PDMQueueAlloc
-    PDMQueueFlush
     PDMQueueInsert
     PGMHandlerPhysicalPageTempOff
Index: /trunk/src/VBox/VMM/VMMInternal.h
===================================================================
--- /trunk/src/VBox/VMM/VMMInternal.h	(revision 29901)
+++ /trunk/src/VBox/VMM/VMMInternal.h	(revision 29902)
@@ -371,5 +371,4 @@
     STAMCOUNTER                 StatRZCallPDMLock;
     STAMCOUNTER                 StatRZCallLogFlush;
-    STAMCOUNTER                 StatRZCallPDMQueueFlush;
     STAMCOUNTER                 StatRZCallPGMPoolGrow;
     STAMCOUNTER                 StatRZCallPGMMapChunk;
Index: /trunk/src/VBox/VMM/VMMR0/VMMR0.def
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/VMMR0.def	(revision 29901)
+++ /trunk/src/VBox/VMM/VMMR0/VMMR0.def	(revision 29902)
@@ -27,5 +27,4 @@
     PDMCritSectTryEnterDebug
     PDMQueueAlloc
-    PDMQueueFlush
     PDMQueueInsert
     PGMHandlerPhysicalPageTempOff
