Changeset 84504 in vbox
- Timestamp:
- May 25, 2020 2:51:42 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r82968 r84504 5611 5611 else 5612 5612 { 5613 PDMDevHlpPhysRead (pDevIns, GCPhysDesc, &DMADesc, sizeof(BMDMADesc));5613 PDMDevHlpPhysReadMeta(pDevIns, GCPhysDesc, &DMADesc, sizeof(BMDMADesc)); 5614 5614 GCPhysBuffer = RT_LE2H_U32(DMADesc.GCPhysBuffer); 5615 5615 cbBuffer = RT_LE2H_U32(DMADesc.cbBuffer); … … 5632 5632 5633 5633 if (uTxDir == PDMMEDIATXDIR_FROM_DEVICE) 5634 PDMDevHlpPCIPhysWrite (pDevIns, GCPhysBuffer, &s->abIOBuffer[iIOBufferCur], cbXfer);5634 PDMDevHlpPCIPhysWriteUser(pDevIns, GCPhysBuffer, &s->abIOBuffer[iIOBufferCur], cbXfer); 5635 5635 else 5636 PDMDevHlpPCIPhysRead (pDevIns, GCPhysBuffer, &s->abIOBuffer[iIOBufferCur], cbXfer);5636 PDMDevHlpPCIPhysReadUser(pDevIns, GCPhysBuffer, &s->abIOBuffer[iIOBufferCur], cbXfer); 5637 5637 5638 5638 iIOBufferCur += cbXfer; -
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r83141 r84504 1233 1233 1234 1234 /** 1235 * Memory write helper to handle PCI/ISA differences .1235 * Memory write helper to handle PCI/ISA differences - metadata writes. 1236 1236 * 1237 1237 * @returns nothing. … … 1242 1242 * @param cbWrite Number of bytes to write 1243 1243 */ 1244 static void blPhysWrite (PPDMDEVINS pDevIns, PBUSLOGIC pThis, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)1244 static void blPhysWriteMeta(PPDMDEVINS pDevIns, PBUSLOGIC pThis, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite) 1245 1245 { 1246 1246 if (!pThis->uIsaIrq) 1247 PDMDevHlpPCIPhysWrite (pDevIns, GCPhys, pvBuf, cbWrite);1247 PDMDevHlpPCIPhysWriteMeta(pDevIns, GCPhys, pvBuf, cbWrite); 1248 1248 else 1249 PDMDevHlpPhysWrite (pDevIns, GCPhys, pvBuf, cbWrite);1249 PDMDevHlpPhysWriteMeta(pDevIns, GCPhys, pvBuf, cbWrite); 1250 1250 } 1251 1251 1252 1252 #if defined(IN_RING3) 1253 1254 /** 1255 * Memory write helper to handle PCI/ISA differences - userdata writes. 1256 * 1257 * @returns nothing. 1258 * @param pDevIns The device instance. 1259 * @param pThis Pointer to the shared BusLogic instance data. 1260 * @param GCPhys Guest physical memory address 1261 * @param pvBuf Host side buffer address 1262 * @param cbWrite Number of bytes to write 1263 */ 1264 static void blPhysWriteUser(PPDMDEVINS pDevIns, PBUSLOGIC pThis, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite) 1265 { 1266 if (!pThis->uIsaIrq) 1267 PDMDevHlpPCIPhysWriteUser(pDevIns, GCPhys, pvBuf, cbWrite); 1268 else 1269 PDMDevHlpPhysWriteUser(pDevIns, GCPhys, pvBuf, cbWrite); 1270 } 1253 1271 1254 1272 /** … … 1318 1336 pCCBGuest->c.uDeviceStatus = uDeviceStatus; 1319 1337 /* Rewrite CCB up to the CDB; perhaps more than necessary. */ 1320 blPhysWrite (pDevIns, pThis, GCPhysAddrCCB, pCCBGuest, RT_UOFFSETOF(CCBC, abCDB));1338 blPhysWriteMeta(pDevIns, pThis, GCPhysAddrCCB, pCCBGuest, RT_UOFFSETOF(CCBC, abCDB)); 1321 1339 } 1322 1340 … … 1324 1342 uint8_t uCode; 1325 1343 unsigned uCodeOffs = pThis->fMbxIs24Bit ? RT_OFFSETOF(Mailbox24, uCmdState) : RT_OFFSETOF(Mailbox32, u.out.uActionCode); 1326 PDMDevHlpPhysRead (pDevIns, GCPhysAddrMailboxIncoming + uCodeOffs, &uCode, sizeof(uCode));1344 PDMDevHlpPhysReadMeta(pDevIns, GCPhysAddrMailboxIncoming + uCodeOffs, &uCode, sizeof(uCode)); 1327 1345 Assert(uCode == BUSLOGIC_MAILBOX_INCOMING_COMPLETION_FREE); 1328 1346 # endif … … 1336 1354 U32_TO_ADDR(Mbx24.aPhysAddrCCB, MbxIn.u32PhysAddrCCB); 1337 1355 Log(("24-bit mailbox: completion code=%u, CCB at %RGp\n", Mbx24.uCmdState, (RTGCPHYS)ADDR_TO_U32(Mbx24.aPhysAddrCCB))); 1338 blPhysWrite (pDevIns, pThis, GCPhysAddrMailboxIncoming, &Mbx24, sizeof(Mailbox24));1356 blPhysWriteMeta(pDevIns, pThis, GCPhysAddrMailboxIncoming, &Mbx24, sizeof(Mailbox24)); 1339 1357 } 1340 1358 else 1341 1359 { 1342 1360 Log(("32-bit mailbox: completion code=%u, CCB at %RGp\n", MbxIn.u.in.uCompletionCode, GCPhysAddrCCB)); 1343 blPhysWrite (pDevIns, pThis, GCPhysAddrMailboxIncoming, &MbxIn, sizeof(Mailbox32));1361 blPhysWriteMeta(pDevIns, pThis, GCPhysAddrMailboxIncoming, &MbxIn, sizeof(Mailbox32)); 1344 1362 } 1345 1363 … … 1445 1463 1446 1464 Log2(("Converting %u 24-bit S/G entries to 32-bit\n", cEntries)); 1447 PDMDevHlpPhysRead (pDevIns, GCSGList, &aSGE24, cEntries * sizeof(SGE24));1465 PDMDevHlpPhysReadMeta(pDevIns, GCSGList, &aSGE24, cEntries * sizeof(SGE24)); 1448 1466 for (uint32_t i = 0; i < cEntries; ++i) 1449 1467 { … … 1453 1471 } 1454 1472 else 1455 PDMDevHlpPhysRead (pDevIns, GCSGList, pSGEList, cEntries * sizeof(SGE32));1473 PDMDevHlpPhysReadMeta(pDevIns, GCSGList, pSGEList, cEntries * sizeof(SGE32)); 1456 1474 } 1457 1475 … … 1561 1579 1562 1580 AssertPtr(pvSeg); 1563 PDMDevHlpPhysRead (pDevIns, GCPhys, pvSeg, cbSeg);1581 PDMDevHlpPhysReadUser(pDevIns, GCPhys, pvSeg, cbSeg); 1564 1582 GCPhys += cbSeg; 1565 1583 cbCopy -= cbSeg; … … 1586 1604 1587 1605 AssertPtr(pvSeg); 1588 blPhysWrite (pDevIns, pThis, GCPhys, pvSeg, cbSeg);1606 blPhysWriteUser(pDevIns, pThis, GCPhys, pvSeg, cbSeg); 1589 1607 GCPhys += cbSeg; 1590 1608 cbCopy -= cbSeg; … … 1791 1809 1792 1810 Log3(("%s: sense buffer: %.*Rhxs\n", __FUNCTION__, cbSenseBuffer, pReq->pbSenseBuffer)); 1793 blPhysWrite (pDevIns, pThis, GCPhysAddrSenseBuffer, pReq->pbSenseBuffer, cbSenseBuffer);1811 blPhysWriteMeta(pDevIns, pThis, GCPhysAddrSenseBuffer, pReq->pbSenseBuffer, cbSenseBuffer); 1794 1812 } 1795 1813 … … 2318 2336 GCPhysFifoBuf = (RTGCPHYS)ADDR_TO_U32(addr); 2319 2337 Log(("Write busmaster FIFO at: %04X\n", ADDR_TO_U32(addr))); 2320 PDMDevHlpPhysRead (pDevIns, GCPhysFifoBuf,2321 &pThis->LocalRam.u8View[64], 64);2338 PDMDevHlpPhysReadMeta(pDevIns, GCPhysFifoBuf, 2339 &pThis->LocalRam.u8View[64], 64); 2322 2340 break; 2323 2341 } … … 2333 2351 GCPhysFifoBuf = (RTGCPHYS)ADDR_TO_U32(addr); 2334 2352 Log(("Read busmaster FIFO at: %04X\n", ADDR_TO_U32(addr))); 2335 blPhysWrite (pDevIns, pThis, GCPhysFifoBuf, &pThis->LocalRam.u8View[64], 64);2353 blPhysWriteMeta(pDevIns, pThis, GCPhysFifoBuf, &pThis->LocalRam.u8View[64], 64); 2336 2354 break; 2337 2355 } … … 3172 3190 /* Fetch the CCB from guest memory. */ 3173 3191 /** @todo How much do we really have to read? */ 3174 PDMDevHlpPhysRead(pDevIns, GCPhysAddrCCB, 3175 &CCBGuest, sizeof(CCB32)); 3192 PDMDevHlpPhysReadMeta(pDevIns, GCPhysAddrCCB, &CCBGuest, sizeof(CCB32)); 3176 3193 3177 3194 uTargetIdCCB = pThis->fMbxIs24Bit ? CCBGuest.o.uTargetId : CCBGuest.n.uTargetId; … … 3257 3274 CCBU CCBGuest; 3258 3275 3259 PDMDevHlpPhysRead(pDevIns, GCPhysAddrCCB, 3260 &CCBGuest, sizeof(CCB32)); 3276 PDMDevHlpPhysReadMeta(pDevIns, GCPhysAddrCCB, &CCBGuest, sizeof(CCB32)); 3261 3277 3262 3278 uTargetIdCCB = pThis->fMbxIs24Bit ? CCBGuest.o.uTargetId : CCBGuest.n.uTargetId; … … 3293 3309 3294 3310 GCMailbox = pThis->GCPhysAddrMailboxOutgoingBase + (pThis->uMailboxOutgoingPositionCurrent * sizeof(Mailbox24)); 3295 PDMDevHlpPhysRead (pDevIns, GCMailbox, &Mbx24, sizeof(Mailbox24));3311 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx24, sizeof(Mailbox24)); 3296 3312 pMbx->u32PhysAddrCCB = ADDR_TO_U32(Mbx24.aPhysAddrCCB); 3297 3313 pMbx->u.out.uActionCode = Mbx24.uCmdState; … … 3300 3316 { 3301 3317 GCMailbox = pThis->GCPhysAddrMailboxOutgoingBase + (pThis->uMailboxOutgoingPositionCurrent * sizeof(Mailbox32)); 3302 PDMDevHlpPhysRead (pDevIns, GCMailbox, pMbx, sizeof(Mailbox32));3318 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, pMbx, sizeof(Mailbox32)); 3303 3319 } 3304 3320 … … 3361 3377 uint8_t uActionCode = BUSLOGIC_MAILBOX_OUTGOING_ACTION_FREE; 3362 3378 unsigned uCodeOffs = pThis->fMbxIs24Bit ? RT_OFFSETOF(Mailbox24, uCmdState) : RT_OFFSETOF(Mailbox32, u.out.uActionCode); 3363 blPhysWrite (pDevIns, pThis, GCPhysAddrMailboxCurrent + uCodeOffs, &uActionCode, sizeof(uActionCode));3379 blPhysWriteMeta(pDevIns, pThis, GCPhysAddrMailboxCurrent + uCodeOffs, &uActionCode, sizeof(uActionCode)); 3364 3380 3365 3381 if (MailboxGuest.u.out.uActionCode == BUSLOGIC_MAILBOX_OUTGOING_ACTION_START_COMMAND) … … 3823 3839 for (i = 0; i < pThis->cMailbox; ++i) 3824 3840 { 3825 PDMDevHlpPhysRead (pDevIns, GCMailbox, &Mbx24, sizeof(Mailbox24));3841 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx24, sizeof(Mailbox24)); 3826 3842 pHlp->pfnPrintf(pHlp, " slot %03d: CCB at %06X action code %02X", i, ADDR_TO_U32(Mbx24.aPhysAddrCCB), Mbx24.uCmdState); 3827 3843 pHlp->pfnPrintf(pHlp, "%s\n", pThis->uMailboxOutgoingPositionCurrent == i ? " *" : ""); … … 3834 3850 for (i = 0; i < pThis->cMailbox; ++i) 3835 3851 { 3836 PDMDevHlpPhysRead (pDevIns, GCMailbox, &Mbx24, sizeof(Mailbox24));3852 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx24, sizeof(Mailbox24)); 3837 3853 pHlp->pfnPrintf(pHlp, " slot %03d: CCB at %06X completion code %02X", i, ADDR_TO_U32(Mbx24.aPhysAddrCCB), Mbx24.uCmdState); 3838 3854 pHlp->pfnPrintf(pHlp, "%s\n", pThis->uMailboxIncomingPositionCurrent == i ? " *" : ""); … … 3850 3866 for (i = 0; i < pThis->cMailbox; ++i) 3851 3867 { 3852 PDMDevHlpPhysRead (pDevIns, GCMailbox, &Mbx32, sizeof(Mailbox32));3868 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx32, sizeof(Mailbox32)); 3853 3869 pHlp->pfnPrintf(pHlp, " slot %03d: CCB at %08X action code %02X", i, Mbx32.u32PhysAddrCCB, Mbx32.u.out.uActionCode); 3854 3870 pHlp->pfnPrintf(pHlp, "%s\n", pThis->uMailboxOutgoingPositionCurrent == i ? " *" : ""); … … 3861 3877 for (i = 0; i < pThis->cMailbox; ++i) 3862 3878 { 3863 PDMDevHlpPhysRead (pDevIns, GCMailbox, &Mbx32, sizeof(Mailbox32));3879 PDMDevHlpPhysReadMeta(pDevIns, GCMailbox, &Mbx32, sizeof(Mailbox32)); 3864 3880 pHlp->pfnPrintf(pHlp, " slot %03d: CCB at %08X completion code %02X BTSTAT %02X SDSTAT %02X", i, 3865 3881 Mbx32.u32PhysAddrCCB, Mbx32.u.in.uCompletionCode, Mbx32.u.in.uHostAdapterStatus, Mbx32.u.in.uTargetDeviceStatus); -
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
r82968 r84504 747 747 748 748 /* Write reply to guest memory. */ 749 PDMDevHlpPCIPhysWrite (pDevIns, GCPhysReplyMessage, pReply, cbReplyCopied);749 PDMDevHlpPCIPhysWriteMeta(pDevIns, GCPhysReplyMessage, pReply, cbReplyCopied); 750 750 751 751 /* Write low 32bits of reply frame into post reply queue. */ … … 1891 1891 1892 1892 AssertPtr(pvSeg); 1893 PDMDevHlpPhysRead (pDevIns, GCPhys, pvSeg, cbSeg);1893 PDMDevHlpPhysReadUser(pDevIns, GCPhys, pvSeg, cbSeg); 1894 1894 GCPhys += cbSeg; 1895 1895 cbCopy -= cbSeg; … … 1916 1916 1917 1917 AssertPtr(pvSeg); 1918 PDMDevHlpPCIPhysWrite (pDevIns, GCPhys, pvSeg, cbSeg);1918 PDMDevHlpPCIPhysWriteUser(pDevIns, GCPhys, pvSeg, cbSeg); 1919 1919 GCPhys += cbSeg; 1920 1920 cbCopy -= cbSeg; … … 1964 1964 1965 1965 /* Read the entry. */ 1966 PDMDevHlpPhysRead (pDevIns, GCPhysSgEntryNext, &SGEntry, sizeof(MptSGEntryUnion));1966 PDMDevHlpPhysReadMeta(pDevIns, GCPhysSgEntryNext, &SGEntry, sizeof(MptSGEntryUnion)); 1967 1967 1968 1968 # ifdef LOG_ENABLED … … 2009 2009 MptSGEntryChain SGEntryChain; 2010 2010 2011 PDMDevHlpPhysRead (pDevIns, GCPhysSegmentStart + cChainOffsetNext, &SGEntryChain, sizeof(MptSGEntryChain));2011 PDMDevHlpPhysReadMeta(pDevIns, GCPhysSegmentStart + cChainOffsetNext, &SGEntryChain, sizeof(MptSGEntryChain)); 2012 2012 2013 2013 AssertMsg(SGEntryChain.u2ElementType == MPTSGENTRYTYPE_CHAIN, ("Invalid SG entry type\n")); … … 2148 2148 2149 2149 /* Copy the sense buffer over. */ 2150 PDMDevHlpPCIPhysWrite (pDevIns, GCPhysAddrSenseBuffer, pReq->abSenseBuffer,2151 RT_UNLIKELY( pReq->GuestRequest.SCSIIO.u8SenseBufferLength2152 < sizeof(pReq->abSenseBuffer))2153 ? pReq->GuestRequest.SCSIIO.u8SenseBufferLength2154 : sizeof(pReq->abSenseBuffer));2150 PDMDevHlpPCIPhysWriteMeta(pDevIns, GCPhysAddrSenseBuffer, pReq->abSenseBuffer, 2151 RT_UNLIKELY( pReq->GuestRequest.SCSIIO.u8SenseBufferLength 2152 < sizeof(pReq->abSenseBuffer)) 2153 ? pReq->GuestRequest.SCSIIO.u8SenseBufferLength 2154 : sizeof(pReq->abSenseBuffer)); 2155 2155 2156 2156 if (RT_SUCCESS(rcReq) && RT_LIKELY(pReq->u8ScsiSts == SCSI_STATUS_OK)) … … 3241 3241 GCPhysAddrPageBuffer |= (uint64_t)pConfigurationReq->SimpleSGElement.u32DataBufferAddressHigh << 32; 3242 3242 3243 PDMDevHlpPCIPhysWrite (pDevIns, GCPhysAddrPageBuffer, pbPageData, RT_MIN(cbBuffer, cbPage));3243 PDMDevHlpPCIPhysWriteMeta(pDevIns, GCPhysAddrPageBuffer, pbPageData, RT_MIN(cbBuffer, cbPage)); 3244 3244 } 3245 3245 break; … … 3257 3257 LogFlow(("cbBuffer=%u cbPage=%u\n", cbBuffer, cbPage)); 3258 3258 3259 PDMDevHlpPhysRead (pDevIns, GCPhysAddrPageBuffer, pbPageData,3260 RT_MIN(cbBuffer, cbPage));3259 PDMDevHlpPhysReadMeta(pDevIns, GCPhysAddrPageBuffer, pbPageData, 3260 RT_MIN(cbBuffer, cbPage)); 3261 3261 } 3262 3262 break; … … 4141 4141 4142 4142 /* Read the message header from the guest first. */ 4143 PDMDevHlpPhysRead (pDevIns, GCPhysMessageFrameAddr, &GuestRequest, sizeof(MptMessageHdr));4143 PDMDevHlpPhysReadMeta(pDevIns, GCPhysMessageFrameAddr, &GuestRequest, sizeof(MptMessageHdr)); 4144 4144 4145 4145 /* Determine the size of the request. */ … … 4189 4189 { 4190 4190 /* Read the complete message frame from guest memory now. */ 4191 PDMDevHlpPhysRead (pDevIns, GCPhysMessageFrameAddr, &GuestRequest, cbRequest);4191 PDMDevHlpPhysReadMeta(pDevIns, GCPhysMessageFrameAddr, &GuestRequest, cbRequest); 4192 4192 4193 4193 /* Handle SCSI I/O requests now. */ -
trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp
r84468 r84504 1085 1085 cbCopied = RT_MIN(pSgBuf->cbSegLeft, pSgPhysReturn->cbSegLeft); 1086 1086 Assert(cbCopied > 0); 1087 PDMDevHlpPCIPhysWrite (pDevIns, pSgPhysReturn->gcPhysCur, pSgBuf->pvSegCur, cbCopied);1087 PDMDevHlpPCIPhysWriteUser(pDevIns, pSgPhysReturn->gcPhysCur, pSgBuf->pvSegCur, cbCopied); 1088 1088 RTSgBufAdvance(pSgBuf, cbCopied); 1089 1089 virtioCoreSgBufAdvance(pSgPhysReturn, cbCopied); … … 1123 1123 cbCopied = RT_MIN(pSgBuf->cbSegLeft, pSgPhysSend->cbSegLeft); 1124 1124 Assert(cbCopied > 0); 1125 PDMDevHlpPCIPhysRead (pDevIns, pSgPhysSend->gcPhysCur, pSgBuf->pvSegCur, cbCopied);1125 PDMDevHlpPCIPhysReadUser(pDevIns, pSgPhysSend->gcPhysCur, pSgBuf->pvSegCur, cbCopied); 1126 1126 RTSgBufAdvance(pSgBuf, cbCopied); 1127 1127 virtioCoreSgBufAdvance(pSgPhysSend, cbCopied); … … 1180 1180 size_t cbSeg = cbReqHdr - offReq; 1181 1181 RTGCPHYS GCPhys = virtioCoreSgBufGetNextSegment(pDescChain->pSgPhysSend, &cbSeg); 1182 PDMDevHlpPCIPhysRead (pDevIns, GCPhys, &VirtqReq.ab[offReq], cbSeg);1182 PDMDevHlpPCIPhysReadMeta(pDevIns, GCPhys, &VirtqReq.ab[offReq], cbSeg); 1183 1183 offReq += cbSeg; 1184 1184 } … … 1373 1373 size_t cbSeg = cbCtrl - offCtrl; 1374 1374 RTGCPHYS GCPhys = virtioCoreSgBufGetNextSegment(pDescChain->pSgPhysSend, &cbSeg); 1375 PDMDevHlpPCIPhysRead (pDevIns, GCPhys, &ScsiCtrlUnion.ab[offCtrl], cbSeg);1375 PDMDevHlpPCIPhysReadMeta(pDevIns, GCPhys, &ScsiCtrlUnion.ab[offCtrl], cbSeg); 1376 1376 offCtrl += cbSeg; 1377 1377 } … … 2624 2624 * Status driver (optional). 2625 2625 */ 2626 PPDMIBASE pUpBase ;2626 PPDMIBASE pUpBase = NULL; 2627 2627 AssertCompile(PDM_STATUS_LUN >= VIRTIOSCSI_MAX_TARGETS); 2628 2628 rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThisCC->IBase, &pUpBase, "Status Port"); 2629 2629 if (RT_FAILURE(rc) && rc != VERR_PDM_NO_ATTACHED_DRIVER) 2630 2630 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the status LUN")); 2631 pThisCC->pMediaNotify = PDMIBASE_QUERY_INTERFACE(pUpBase, PDMIMEDIANOTIFY); 2631 if (RT_SUCCESS(rc) && pUpBase) 2632 pThisCC->pMediaNotify = PDMIBASE_QUERY_INTERFACE(pUpBase, PDMIMEDIANOTIFY); 2632 2633 2633 2634
Note:
See TracChangeset
for help on using the changeset viewer.