Changeset 82183 in vbox
- Timestamp:
- Nov 25, 2019 4:14:33 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp
r82151 r82183 775 775 AssertReturn(pabSenseBuf, VERR_NO_MEMORY); 776 776 777 Log2Func((" status: %s response: %s\n", SCSIStatusText(pRespHdr->uStatus), virtioGetReqRespText(pRespHdr->uResponse))); 777 Log2Func((" status: %s response: %s\n", 778 SCSIStatusText(pRespHdr->uStatus), virtioGetReqRespText(pRespHdr->uResponse))); 778 779 779 780 PRTSGBUF pReqSegBuf = (PRTSGBUF)RTMemAllocZ(sizeof(RTSGBUF)); … … 783 784 AssertReturn(paReqSegs, VERR_NO_MEMORY); 784 785 785 paReqSegs[0].cbSeg = sizeof( pRespHdr);786 paReqSegs[0].cbSeg = sizeof(*pRespHdr); 786 787 paReqSegs[0].pvSeg = pRespHdr; 787 788 paReqSegs[1].cbSeg = pThis->virtioScsiConfig.uSenseSize; … … 842 843 break; 843 844 case SCSI_SENSE_NOT_READY: 844 respHdr->uResponse = VIRTIOSCSI_S_BUSY; /* e.g. re-tryable */ 845 /* Not sure what to return for this. See choices at VirtIO 1.0, 5.6.6.1.1 */ 846 respHdr->uResponse = VIRTIOSCSI_S_FAILURE; 847 /* respHdr->uResponse = VIRTIOSCSI_S_BUSY; */ /* BUSY is VirtIO's 'retryable' response */ 845 848 break; 846 849 default: … … 871 874 AssertRC(rc); 872 875 873 /* Masking used to deal with datatype size differences between APIs (Windows complains otherwise) */ 876 /* Masking deals with data type size discrepancies between 877 * The APIs (virtio and VBox). Windows C-compiler complains otherwise */ 874 878 Assert(!(cbXfer & 0xffffffff00000000)); 875 879 uint32_t cbXfer32 = cbXfer & 0xffffffff; … … 1126 1130 { 1127 1131 LogRel(("* * * REPORT LUNS LU ACCESSED * * * ")); 1128 uScsiLun = 0xff; /* Force rejection. todo: figure out right way to handle, r=paul */ 1132 /* Force rejection. todo: figure out right way to handle. Note this is a very 1133 * vague and confusing part of the VirtIO spec which deviates from the SCSI standard 1134 * as Klaus has pointed out on numerous occasions. I have not been able to determine 1135 * how to implement this properly. Nor do I see any of the guest drivers at this 1136 * point making use of it, hence the loud log message so we can catch it if/when a guest 1137 * does access it and can resume the investigation at that point. r=paul */ 1138 uScsiLun = 0xff; 1129 1139 } 1130 1140 else … … 1166 1176 } 1167 1177 1168 if (RT_LIKELY( uTarget < pThis->cTargets1169 && 1170 && 1178 if (RT_LIKELY( uTarget < pThis->cTargets 1179 && pThisCC->paTargetInstances[uTarget].fPresent 1180 && pThisCC->paTargetInstances[uTarget].pDrvMediaEx)) 1171 1181 { /* likely */ } 1172 1182 else … … 1551 1561 if (RT_UNLIKELY(pThread->enmState != PDMTHREADSTATE_RUNNING)) 1552 1562 return VINF_SUCCESS; 1563 if (rc == VERR_INTERRUPTED) 1564 continue; 1553 1565 Log6Func(("%s worker woken\n", VIRTQNAME(qIdx))); 1554 1566 ASMAtomicWriteBool(&pWorkerR3->fNotified, false); … … 1998 2010 pHlp->pfnSSMGetU32(pSSM, &pThis->fResetting); 1999 2011 2000 /** @todo Ask aeichner about BIOS-related changes */2001 2002 2012 pHlp->pfnSSMGetU32(pSSM, &pThis->cTargets); 2003 2013 … … 2078 2088 pHlp->pfnSSMPutU32(pSSM, pThis->fHasLunChange); 2079 2089 pHlp->pfnSSMPutU32(pSSM, pThis->fResetting); 2080 2081 /** @todo Ask aeichner about BIOS-related changes */2082 2090 2083 2091 AssertMsg(!pThis->cActiveReqs, ("There are still outstanding requests on this device\n")); -
trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp
r82151 r82183 170 170 DECLINLINE(bool) virtqIsEmpty(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue) 171 171 { 172 return virtioReadAvailRingIdx(pDevIns, pVirtio, idxQueue) == pVirtio->virtqState[idxQueue].uAvailIdx; 172 uint16_t uAvailGst = virtioReadAvailRingIdx(pDevIns, pVirtio, idxQueue); 173 bool fEmpty = uAvailGst == pVirtio->virtqState[idxQueue].uAvailIdx; 174 175 LogFlow(("Q<%u>: uAvailGst=%u uAvailIdx=%u -> fEmpty=%RTbool\n", 176 idxQueue, uAvailGst, pVirtio->virtqState[idxQueue].uAvailIdx, fEmpty)); 177 return fEmpty; 173 178 } 174 179
Note:
See TracChangeset
for help on using the changeset viewer.