vbox6: remove redundant ahci/serial patches

The issue alleviated by the patches was fixed by

  5fed1641a4 virtualbox6: reduce 'Vm_connection' priority

Issue #4361
This commit is contained in:
Christian Helmuth 2022-04-06 16:02:58 +02:00
parent ddc83df4b6
commit e345b56719
4 changed files with 1 additions and 174 deletions

View File

@ -1 +1 @@
ee399455b46b3f366f0423567e06608b0bf1a853
db7d6d9b9ab32c34fcfb371dfc9e100b208ee982

View File

@ -1,111 +0,0 @@
Patch for DevAHCI model to really kick the consumer of requests
+++ a/src/virtualbox6/src/VBox/Devices/Storage/DevAHCI.cpp
+++ b/src/virtualbox6/src/VBox/Devices/Storage/DevAHCI.cpp
@@ -384,6 +384,7 @@
/** The event semaphore the processing thread waits on. */
SUPSEMEVENT hEvtProcess;
+ SUPSEMEVENT hEvtProcessAck;
/** The serial numnber to use for IDENTIFY DEVICE commands. */
char szSerialNumber[AHCI_SERIAL_NUMBER_LENGTH+1]; /** < one extra byte for termination */
@@ -1048,6 +1049,7 @@
{
LogFlowFunc(("Signal event semaphore\n"));
int rc = PDMDevHlpSUPSemEventSignal(pDevIns, pAhciPort->hEvtProcess);
+ PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pAhciPort->hEvtProcessAck, 15 /* ms */);
AssertRC(rc);
}
@@ -1324,6 +1326,7 @@
ASMAtomicOrU32(&pAhciPort->u32TasksNew, pAhciPort->regCI);
LogFlowFunc(("Signal event semaphore\n"));
int rc = PDMDevHlpSUPSemEventSignal(pDevIns, pAhciPort->hEvtProcess);
+ PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pAhciPort->hEvtProcessAck, 15 /* ms */);
AssertRC(rc);
}
}
@@ -1480,6 +1483,13 @@
*/
static VBOXSTRICTRC PortIntrSts_r(PPDMDEVINS pDevIns, PAHCI pThis, PAHCIPORT pAhciPort, uint32_t iReg, uint32_t *pu32Value)
{
+ if (pAhciPort->regIS == 0) {
+ if (pAhciPort->hEvtProcess != NIL_SUPSEMEVENT) {
+ PDMDevHlpSUPSemEventSignal(pDevIns, pAhciPort->hEvtProcess);
+ PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pAhciPort->hEvtProcessAck, 15 /* ms */);
+ }
+ }
+
RT_NOREF(pDevIns, pThis, iReg);
ahciLog(("%s: read regIS=%#010x\n", __FUNCTION__, pAhciPort->regIS));
ahciLog(("%s: CPDS=%d TFES=%d HBFS=%d HBDS=%d IFS=%d INFS=%d OFS=%d IPMS=%d PRCS=%d DIS=%d PCS=%d DPS=%d UFS=%d SDBS=%d DSS=%d PSS=%d DHRS=%d\n",
@@ -4518,6 +4528,7 @@
{
Assert(ASMAtomicReadBool(&pAhciPort->fWrkThreadSleeping));
rc = PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pAhciPort->hEvtProcess, RT_INDEFINITE_WAIT);
+ PDMDevHlpSUPSemEventSignal(pDevIns, pAhciPort->hEvtProcessAck);
AssertLogRelMsgReturn(RT_SUCCESS(rc) || rc == VERR_INTERRUPTED, ("%Rrc\n", rc), rc);
if (RT_UNLIKELY(pThread->enmState != PDMTHREADSTATE_RUNNING))
break;
@@ -4639,7 +4650,9 @@
PAHCIPORTR3 pAhciPortR3 = (PAHCIPORTR3)pThread->pvUser;
PAHCI pThis = PDMDEVINS_2_DATA(pDevIns, PAHCI);
PAHCIPORT pAhciPort = &RT_SAFE_SUBSCRIPT(pThis->aPorts, pAhciPortR3->iLUN);
- return PDMDevHlpSUPSemEventSignal(pDevIns, pAhciPort->hEvtProcess);
+ int rc = PDMDevHlpSUPSemEventSignal(pDevIns, pAhciPort->hEvtProcess);
+ PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pAhciPort->hEvtProcessAck, 15 /* ms */);
+ return rc;
}
/* -=-=-=-=- DBGF -=-=-=-=- */
@@ -5339,6 +5352,7 @@
/* Notify the async IO thread. */
int rc = PDMDevHlpSUPSemEventSignal(pDevIns, pAhciPort->hEvtProcess);
+ PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pAhciPort->hEvtProcessAck, 15 /* ms */);
AssertRC(rc);
}
}
@@ -5577,6 +5591,10 @@
if (RT_FAILURE(rc))
return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
N_("AHCI: Failed to create SUP event semaphore"));
+ rc = PDMDevHlpSUPSemEventCreate(pDevIns, &pAhciPort->hEvtProcessAck);
+ if (RT_FAILURE(rc))
+ return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
+ N_("AHCI: Failed to create SUP event semaphore"));
/* Create the async IO thread. */
rc = PDMDevHlpThreadCreate(pDevIns, &pAhciPortR3->pAsyncIOThread, pAhciPortR3, ahciAsyncIOLoop,
@@ -5724,6 +5742,11 @@
PDMDevHlpSUPSemEventClose(pDevIns, pAhciPort->hEvtProcess);
pAhciPort->hEvtProcess = NIL_SUPSEMEVENT;
}
+ if (pAhciPort->hEvtProcessAck != NIL_SUPSEMEVENT)
+ {
+ PDMDevHlpSUPSemEventClose(pDevIns, pAhciPort->hEvtProcessAck);
+ pAhciPort->hEvtProcessAck = NIL_SUPSEMEVENT;
+ }
}
PDMDevHlpCritSectDelete(pDevIns, &pThis->lock);
@@ -5805,6 +5828,7 @@
pAhciPortR3->pDrvBase = NULL;
pAhciPortR3->pAsyncIOThread = NULL;
pAhciPort->hEvtProcess = NIL_SUPSEMEVENT;
+ pAhciPort->hEvtProcessAck = NIL_SUPSEMEVENT;
pAhciPort->fHotpluggable = true;
}
@@ -6009,6 +6033,10 @@
if (RT_FAILURE(rc))
return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
N_("AHCI: Failed to create SUP event semaphore"));
+ rc = PDMDevHlpSUPSemEventCreate(pDevIns, &pAhciPort->hEvtProcessAck);
+ if (RT_FAILURE(rc))
+ return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
+ N_("AHCI: Failed to create SUP event semaphore"));
rc = PDMDevHlpThreadCreate(pDevIns, &pAhciPortR3->pAsyncIOThread, pAhciPortR3, ahciAsyncIOLoop,
ahciAsyncIOLoopWakeUp, 0, RTTHREADTYPE_IO, pAhciPortR3->szDesc);

View File

@ -1,60 +0,0 @@
Patch for serial raw-file backend to really kick the consumer of the FIFO to
consume the (mostly one-byte) content by waiting for an acknowledgement. This
prevents guests that poll the UART LSR.THRE before writing the next character
into the FIFO from redundant exits due to a not processing UART state machine.
The original implementation alleviates this behavior wih RTYield() on LSR read.
--- a/src/virtualbox6/src/VBox/Devices/Serial/DrvRawFile.cpp
+++ b/src/virtualbox6/src/VBox/Devices/Serial/DrvRawFile.cpp
@@ -58,6 +58,7 @@
RTFILE hOutputFile;
/** Event semaphore for the poll interface. */
RTSEMEVENT hSemEvtPoll;
+ RTSEMEVENT hSemEvtPollAck;
} DRVRAWFILE, *PDRVRAWFILE;
@@ -78,7 +79,9 @@
return VINF_SUCCESS;
}
- return RTSemEventWait(pThis->hSemEvtPoll, cMillies);
+ int rc = RTSemEventWait(pThis->hSemEvtPoll, cMillies);
+ RTSemEventSignal(pThis->hSemEvtPollAck);
+ return rc;
}
@@ -86,7 +89,9 @@
static DECLCALLBACK(int) drvRawFilePollInterrupt(PPDMISTREAM pInterface)
{
PDRVRAWFILE pThis = RT_FROM_MEMBER(pInterface, DRVRAWFILE, IStream);
- return RTSemEventSignal(pThis->hSemEvtPoll);
+ int rc = RTSemEventSignal(pThis->hSemEvtPoll);
+ RTSemEventWait(pThis->hSemEvtPollAck, RT_INDEFINITE_WAIT);
+ return rc;
}
@@ -177,6 +182,12 @@
RTSemEventDestroy(pThis->hSemEvtPoll);
pThis->hSemEvtPoll = NIL_RTSEMEVENT;
}
+
+ if (pThis->hSemEvtPollAck != NIL_RTSEMEVENT)
+ {
+ RTSemEventDestroy(pThis->hSemEvtPollAck);
+ pThis->hSemEvtPollAck = NIL_RTSEMEVENT;
+ }
}
@@ -217,6 +228,8 @@
rc = RTSemEventCreate(&pThis->hSemEvtPoll);
AssertRCReturn(rc, rc);
+ rc = RTSemEventCreate(&pThis->hSemEvtPollAck);
+ AssertRCReturn(rc, rc);
/*
* Open the raw file.

View File

@ -1,9 +1,7 @@
serial.patch
drvtap.patch
qemu-xhci.patch
narrowing.patch
network.patch
devahci.patch
smp_sipi.patch
tm_poke.patch
exec_state.patch