Index: /trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
===================================================================
--- /trunk/src/VBox/Devices/Storage/DevBusLogic.cpp	(revision 82666)
+++ /trunk/src/VBox/Devices/Storage/DevBusLogic.cpp	(revision 82667)
@@ -1174,5 +1174,5 @@
         buslogicR3RegisterISARange(pDevIns, pThis, pThis->uDefaultISABaseCode);
     buslogicR3InitializeLocalRam(pThis);
-    vboxscsiInitialize(&pThisCC->VBoxSCSI);
+    vboxscsiHwReset(&pThisCC->VBoxSCSI);
 
     return VINF_SUCCESS;
@@ -4081,4 +4081,5 @@
     PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns);
     PBUSLOGIC pThis = PDMDEVINS_2_DATA(pDevIns, PBUSLOGIC);
+    PBUSLOGICCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PBUSLOGICCC);
 
     PDMDevHlpCritSectDelete(pDevIns, &pThis->CritSectIntr);
@@ -4089,4 +4090,6 @@
         pThis->hEvtProcess = NIL_SUPSEMEVENT;
     }
+
+    vboxscsiDestroy(&pThisCC->VBoxSCSI);
 
     return VINF_SUCCESS;
@@ -4207,4 +4210,9 @@
         AssertRCReturn(rc, rc);
     }
+
+    /* Initialize the SCSI emulation for the BIOS. */
+    rc = vboxscsiInitialize(&pThisCC->VBoxSCSI);
+    if (RT_FAILURE(rc))
+        return PDMDEV_SET_ERROR(pDevIns, rc, N_("BusLogic failed to initialize BIOS SCSI interface"));
 
     if (fBootable)
Index: /trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
===================================================================
--- /trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp	(revision 82666)
+++ /trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp	(revision 82667)
@@ -5080,5 +5080,5 @@
     AssertRC(rc);
 
-    vboxscsiInitialize(&pThisCC->VBoxSCSI);
+    vboxscsiHwReset(&pThisCC->VBoxSCSI);
 }
 
@@ -5150,4 +5150,5 @@
     lsilogicR3ConfigurationPagesFree(pThis, pThisCC);
     lsilogicR3MemRegionsFree(pThisCC);
+    vboxscsiDestroy(&pThisCC->VBoxSCSI);
 
     return VINF_SUCCESS;
@@ -5485,5 +5486,6 @@
     /* Initialize the SCSI emulation for the BIOS. */
     rc = vboxscsiInitialize(&pThisCC->VBoxSCSI);
-    AssertRC(rc);
+    if (RT_FAILURE(rc))
+        return PDMDEV_SET_ERROR(pDevIns, rc, N_("LsiLogic failed to initialize BIOS SCSI interface"));
 
     /*
Index: /trunk/src/VBox/Devices/Storage/VBoxSCSI.cpp
===================================================================
--- /trunk/src/VBox/Devices/Storage/VBoxSCSI.cpp	(revision 82666)
+++ /trunk/src/VBox/Devices/Storage/VBoxSCSI.cpp	(revision 82667)
@@ -70,8 +70,35 @@
 int vboxscsiInitialize(PVBOXSCSI pVBoxSCSI)
 {
-    pVBoxSCSI->pbBuf = NULL;
+    int rc = RTCritSectInit(&pVBoxSCSI->CritSect);
+    if (RT_SUCCESS(rc))
+    {
+        pVBoxSCSI->pbBuf = NULL;
+        vboxscsiReset(pVBoxSCSI, true /*fEverything*/);
+    }
+
+    return rc;
+}
+
+/**
+ * Frees all allocated resources.
+ *
+ * @returns nothing.
+ * @param   pVBoxSCSI    Pointer to the SCSI state,
+ */
+void vboxscsiDestroy(PVBOXSCSI pVBoxSCSI)
+{
+    if (RTCritSectIsInitialized(&pVBoxSCSI->CritSect))
+        RTCritSectDelete(&pVBoxSCSI->CritSect);
+}
+
+/**
+ * Performs a hardware reset.
+ *
+ * @returns nothing.
+ * @param   pVBoxSCSI    Pointer to the SCSI state,
+ */
+void vboxscsiHwReset(PVBOXSCSI pVBoxSCSI)
+{
     vboxscsiReset(pVBoxSCSI, true /*fEverything*/);
-
-    return VINF_SUCCESS;
 }
 
@@ -88,4 +115,5 @@
     uint8_t uVal = 0;
 
+    RTCritSectEnter(&pVBoxSCSI->CritSect);
     switch (iRegister)
     {
@@ -138,4 +166,5 @@
 
     *pu32Value = uVal;
+    RTCritSectLeave(&pVBoxSCSI->CritSect);
 
     return VINF_SUCCESS;
@@ -156,4 +185,5 @@
     int rc = VINF_SUCCESS;
 
+    RTCritSectEnter(&pVBoxSCSI->CritSect);
     switch (iRegister)
     {
@@ -270,4 +300,5 @@
     }
 
+    RTCritSectLeave(&pVBoxSCSI->CritSect);
     return rc;
 }
@@ -291,4 +322,5 @@
     LogFlowFunc(("pVBoxSCSI=%#p puTargetDevice=%#p\n", pVBoxSCSI, puTargetDevice));
 
+    RTCritSectEnter(&pVBoxSCSI->CritSect);
     AssertMsg(pVBoxSCSI->enmState == VBOXSCSISTATE_COMMAND_READY, ("Invalid state %u\n", pVBoxSCSI->enmState));
 
@@ -311,4 +343,5 @@
     *pcbBuf = pVBoxSCSI->cbBuf;
     *puTargetDevice = pVBoxSCSI->uTargetDevice;
+    RTCritSectLeave(&pVBoxSCSI->CritSect);
 
     return rc;
@@ -323,4 +356,5 @@
     LogFlowFunc(("pVBoxSCSI=%#p\n", pVBoxSCSI));
 
+    RTCritSectEnter(&pVBoxSCSI->CritSect);
     if (pVBoxSCSI->uTxDir == VBOXSCSI_TXDIR_TO_DEVICE)
         vboxscsiReset(pVBoxSCSI, false /*fEverything*/);
@@ -329,4 +363,5 @@
 
     ASMAtomicXchgBool(&pVBoxSCSI->fBusy, false);
+    RTCritSectLeave(&pVBoxSCSI->CritSect);
 
     return VINF_SUCCESS;
@@ -338,6 +373,10 @@
     AssertReturn(cbSkip + cbCopy <= pVBoxSCSI->cbBuf, 0);
 
+    RTCritSectEnter(&pVBoxSCSI->CritSect);
     void *pvBuf = pVBoxSCSI->pbBuf + cbSkip;
-    return RTSgBufCopyToBuf(pSgBuf, pvBuf, cbCopy);
+    size_t cbCopied = RTSgBufCopyToBuf(pSgBuf, pvBuf, cbCopy);
+    RTCritSectLeave(&pVBoxSCSI->CritSect);
+
+    return cbCopied;
 }
 
@@ -347,6 +386,10 @@
     AssertReturn(cbSkip + cbCopy <= pVBoxSCSI->cbBuf, 0);
 
+    RTCritSectEnter(&pVBoxSCSI->CritSect);
     void *pvBuf = pVBoxSCSI->pbBuf + cbSkip;
-    return RTSgBufCopyFromBuf(pSgBuf, pvBuf, cbCopy);
+    size_t cbCopied = RTSgBufCopyFromBuf(pSgBuf, pvBuf, cbCopy);
+    RTCritSectLeave(&pVBoxSCSI->CritSect);
+
+    return cbCopied;
 }
 
@@ -376,4 +419,5 @@
     Assert(!pVBoxSCSI->fBusy);
 
+    RTCritSectEnter(&pVBoxSCSI->CritSect);
     /*
      * Also ignore attempts to read more data than is available.
@@ -407,4 +451,5 @@
     }
     *pcTransfers = 0;
+    RTCritSectLeave(&pVBoxSCSI->CritSect);
 
     return VINF_SUCCESS;
@@ -434,4 +479,5 @@
     AssertReturn(pVBoxSCSI->uTxDir == VBOXSCSI_TXDIR_TO_DEVICE, VINF_SUCCESS);
 
+    RTCritSectEnter(&pVBoxSCSI->CritSect);
     /*
      * Ignore excess data (not supposed to happen).
@@ -457,4 +503,5 @@
         AssertFailed();
     *pcTransfers = 0;
+    RTCritSectLeave(&pVBoxSCSI->CritSect);
 
     return rc;
Index: /trunk/src/VBox/Devices/Storage/VBoxSCSI.h
===================================================================
--- /trunk/src/VBox/Devices/Storage/VBoxSCSI.h	(revision 82666)
+++ /trunk/src/VBox/Devices/Storage/VBoxSCSI.h	(revision 82667)
@@ -73,4 +73,5 @@
 *******************************************************************************/
 //#define DEBUG
+#include <iprt/semaphore.h>
 #include <VBox/vmm/pdmdev.h>
 #include <VBox/vmm/pdmstorageifs.h>
@@ -129,4 +130,6 @@
     /** The state we are in when fetching a command from the BIOS. */
     VBOXSCSISTATE        enmState;
+    /** Critical section protecting the device state. */
+    RTCRITSECT           CritSect;
 } VBOXSCSI, *PVBOXSCSI;
 
@@ -137,4 +140,6 @@
 RT_C_DECLS_BEGIN
 int vboxscsiInitialize(PVBOXSCSI pVBoxSCSI);
+void vboxscsiDestroy(PVBOXSCSI pVBoxSCSI);
+void vboxscsiHwReset(PVBOXSCSI pVBoxSCSI);
 int vboxscsiReadRegister(PVBOXSCSI pVBoxSCSI, uint8_t iRegister, uint32_t *pu32Value);
 int vboxscsiWriteRegister(PVBOXSCSI pVBoxSCSI, uint8_t iRegister, uint8_t uVal);
