summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2016-12-09 23:28:41 +0100
committerLars Wendler <polynomial-c@gentoo.org>2016-12-09 23:28:41 +0100
commit2b91777aca23544ebd8de16f9e4f3bc68600bc72 (patch)
treeec84ed1b98d89d0ad012f889ab773f697d8304a9 /app-emulation/virtualbox
parentwww-plugins/chrome-binary-plugins: automated update (56.0.2924.21) (diff)
downloadgentoo-2b91777aca23544ebd8de16f9e4f3bc68600bc72.tar.gz
gentoo-2b91777aca23544ebd8de16f9e4f3bc68600bc72.tar.bz2
gentoo-2b91777aca23544ebd8de16f9e4f3bc68600bc72.zip
app-emulation/virtualbox: Upstream patch to fix some SAS timeouts.
Package-Manager: portage-2.3.3
Diffstat (limited to 'app-emulation/virtualbox')
-rw-r--r--app-emulation/virtualbox/files/virtualbox-5.1.10-sas_timeouts.patch94
-rw-r--r--app-emulation/virtualbox/virtualbox-5.1.10-r1.ebuild (renamed from app-emulation/virtualbox/virtualbox-5.1.10.ebuild)1
2 files changed, 95 insertions, 0 deletions
diff --git a/app-emulation/virtualbox/files/virtualbox-5.1.10-sas_timeouts.patch b/app-emulation/virtualbox/files/virtualbox-5.1.10-sas_timeouts.patch
new file mode 100644
index 000000000000..eeeb4742e9ac
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-5.1.10-sas_timeouts.patch
@@ -0,0 +1,94 @@
+Index: vbox/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
+===================================================================
+--- vbox/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp (revision 64807)
++++ vbox/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp (revision 64808)
+@@ -286,6 +286,12 @@
+ PDMCRITSECT ReplyPostQueueCritSect;
+ /** Critical section protecting the reply free queue. */
+ PDMCRITSECT ReplyFreeQueueCritSect;
++ /** Critical section protecting the request queue against
++ * concurrent access from the guest. */
++ PDMCRITSECT RequestQueueCritSect;
++ /** Critical section protecting the reply free queue against
++ * concurrent write access from the guest. */
++ PDMCRITSECT ReplyFreeQueueWriteCritSect;
+
+ /** Pointer to the start of the reply free queue - R3. */
+ R3PTRTYPE(volatile uint32_t *) pReplyFreeQueueBaseR3;
+@@ -1275,14 +1281,22 @@
+ {
+ case LSILOGIC_REG_REPLY_QUEUE:
+ {
++ int rc = PDMCritSectEnter(&pThis->ReplyFreeQueueWriteCritSect, VINF_IOM_R3_MMIO_WRITE);
++ if (rc != VINF_SUCCESS)
++ return rc;
+ /* Add the entry to the reply free queue. */
+ ASMAtomicWriteU32(&pThis->CTX_SUFF(pReplyFreeQueueBase)[pThis->uReplyFreeQueueNextEntryFreeWrite], u32);
+ pThis->uReplyFreeQueueNextEntryFreeWrite++;
+ pThis->uReplyFreeQueueNextEntryFreeWrite %= pThis->cReplyQueueEntries;
++ PDMCritSectLeave(&pThis->ReplyFreeQueueWriteCritSect);
+ break;
+ }
+ case LSILOGIC_REG_REQUEST_QUEUE:
+ {
++ int rc = PDMCritSectEnter(&pThis->RequestQueueCritSect, VINF_IOM_R3_MMIO_WRITE);
++ if (rc != VINF_SUCCESS)
++ return rc;
++
+ uint32_t uNextWrite = ASMAtomicReadU32(&pThis->uRequestQueueNextEntryFreeWrite);
+
+ ASMAtomicWriteU32(&pThis->CTX_SUFF(pRequestQueueBase)[uNextWrite], u32);
+@@ -1296,6 +1310,7 @@
+ uNextWrite++;
+ uNextWrite %= pThis->cRequestQueueEntries;
+ ASMAtomicWriteU32(&pThis->uRequestQueueNextEntryFreeWrite, uNextWrite);
++ PDMCritSectLeave(&pThis->RequestQueueCritSect);
+
+ /* Send notification to R3 if there is not one sent already. Do this
+ * only if the worker thread is not sleeping or might go sleeping. */
+@@ -1309,7 +1324,7 @@
+ PDMQueueInsert(pThis->CTX_SUFF(pNotificationQueue), pNotificationItem);
+ #else
+ LogFlowFunc(("Signal event semaphore\n"));
+- int rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess);
++ rc = SUPSemEventSignal(pThis->pSupDrvSession, pThis->hEvtProcess);
+ AssertRC(rc);
+ #endif
+ }
+@@ -5304,6 +5319,8 @@
+
+ PDMR3CritSectDelete(&pThis->ReplyFreeQueueCritSect);
+ PDMR3CritSectDelete(&pThis->ReplyPostQueueCritSect);
++ PDMR3CritSectDelete(&pThis->RequestQueueCritSect);
++ PDMR3CritSectDelete(&pThis->ReplyFreeQueueWriteCritSect);
+
+ RTMemFree(pThis->paDeviceStates);
+ pThis->paDeviceStates = NULL;
+@@ -5470,6 +5487,14 @@
+ if (RT_FAILURE(rc))
+ return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic: cannot create critical section for reply post queue"));
+
++ rc = PDMDevHlpCritSectInit(pDevIns, &pThis->RequestQueueCritSect, RT_SRC_POS, "%sRQ", szDevTag);
++ if (RT_FAILURE(rc))
++ return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic: cannot create critical section for request queue"));
++
++ rc = PDMDevHlpCritSectInit(pDevIns, &pThis->ReplyFreeQueueWriteCritSect, RT_SRC_POS, "%sRFQW", szDevTag);
++ if (RT_FAILURE(rc))
++ return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic: cannot create critical section for reply free queue write access"));
++
+ /*
+ * Register the PCI device, it's I/O regions.
+ */
+Index: vbox/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
+===================================================================
+--- vbox/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp (revision 64807)
++++ vbox/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp (revision 64808)
+@@ -1744,6 +1744,8 @@
+ GEN_CHECK_OFF(LSILOGICSCSI, cRequestQueueEntries);
+ GEN_CHECK_OFF(LSILOGICSCSI, ReplyPostQueueCritSect);
+ GEN_CHECK_OFF(LSILOGICSCSI, ReplyFreeQueueCritSect);
++ GEN_CHECK_OFF(LSILOGICSCSI, RequestQueueCritSect);
++ GEN_CHECK_OFF(LSILOGICSCSI, ReplyFreeQueueWriteCritSect);
+ GEN_CHECK_OFF(LSILOGICSCSI, pReplyFreeQueueBaseR3);
+ GEN_CHECK_OFF(LSILOGICSCSI, pReplyPostQueueBaseR3);
+ GEN_CHECK_OFF(LSILOGICSCSI, pRequestQueueBaseR3);
diff --git a/app-emulation/virtualbox/virtualbox-5.1.10.ebuild b/app-emulation/virtualbox/virtualbox-5.1.10-r1.ebuild
index cd60f3e4fbcd..40c2eb33a9aa 100644
--- a/app-emulation/virtualbox/virtualbox-5.1.10.ebuild
+++ b/app-emulation/virtualbox/virtualbox-5.1.10-r1.ebuild
@@ -183,6 +183,7 @@ src_prepare() {
fi
eapply "${WORKDIR}/patches"
+ eapply "${FILESDIR}/${P}-sas_timeouts.patch"
eapply_user
}