Changeset 81628 in vbox for trunk/src/VBox/Devices/VirtIO
- Timestamp:
- Nov 2, 2019 7:40:09 AM (5 years ago)
- Location:
- trunk/src/VBox/Devices/VirtIO
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp
r81402 r81628 278 278 pVirtq->uUsedIdx, QUEUENAME(qIdx), uUsedIdx)); 279 279 280 RTMemFree((void *)pDescChain->pSgPhysSend->paSegs); 281 RTMemFree(pDescChain->pSgPhysSend); 280 282 RTMemFree((void *)pSgPhysReturn->paSegs); 281 283 RTMemFree(pSgPhysReturn); … … 314 316 static void virtioQueueNotified(PVIRTIOSTATE pVirtio, uint16_t qIdx, uint16_t uNotifyIdx) 315 317 { 316 Assert(uNotifyIdx == qIdx); 317 (void)uNotifyIdx; 318 /* See VirtIO 1.0, section 4.1.5.2 It implies that qIdx and uNotifyIdx should match. 319 * Disregarding this notification may cause throughput to stop, however there's no way to know 320 * which was queue was intended for wake-up if the two parameters disagree. */ 321 322 AssertMsg(uNotifyIdx == qIdx, 323 ("Notification param disagreement. Guest kicked virtq %d's notify addr w/non-corresponding virtq idx %d\n", 324 qIdx, uNotifyIdx)); 325 326 // AssertMsgReturn(uNotifyIdx == qIdx, 327 // ("Notification param disagreement. Guest kicked virtq %d's notify addr w/non-corresponding virtq idx %d\n", 328 // qIdx, uNotifyIdx)); 329 RT_NOREF(uNotifyIdx); 318 330 319 331 PVIRTQSTATE pVirtq = &pVirtio->virtqState[qIdx]; 320 332 Log6Func(("%s\n", pVirtq->szVirtqName)); 321 (void)pVirtq;333 RT_NOREF(pVirtq); 322 334 323 335 /** Inform client */ … … 470 482 pVirtio->uISR = 0; 471 483 484 virtioLowerInterrupt(pVirtio); 472 485 473 486 if (!pVirtio->fMsiSupport) /* VirtIO 1.0, 4.1.4.3 and 4.1.5.1.2 */ … … 827 840 uint16_t qIdx = uNotifyBaseOffset / VIRTIO_NOTIFY_OFFSET_MULTIPLIER; 828 841 uint16_t uAvailDescIdx = *(uint16_t *)pv; 842 829 843 virtioQueueNotified(pVirtio, qIdx, uAvailDescIdx); 830 844 } … … 1260 1274 rc = SSMR3PutU32(pSSM, pVirtio->uDriverFeaturesSelect); 1261 1275 rc = SSMR3PutU32(pSSM, pVirtio->uNumQueues); 1262 rc = SSMR3PutU32(pSSM, pVirtio->cbDevSpecificCfg);1263 rc = SSMR3PutU64(pSSM, pVirtio->uDeviceFeatures);1264 1276 rc = SSMR3PutU64(pSSM, pVirtio->uDriverFeatures); 1265 rc = SSMR3PutU64(pSSM, (uint64_t)pVirtio->pDevSpecificCfg);1266 rc = SSMR3PutU64(pSSM, (uint64_t)pVirtio->virtioCallbacks.pfnVirtioStatusChanged);1267 rc = SSMR3PutU64(pSSM, (uint64_t)pVirtio->virtioCallbacks.pfnVirtioQueueNotified);1268 rc = SSMR3PutU64(pSSM, (uint64_t)pVirtio->virtioCallbacks.pfnVirtioDevCapRead);1269 rc = SSMR3PutU64(pSSM, (uint64_t)pVirtio->virtioCallbacks.pfnVirtioDevCapWrite);1270 rc = SSMR3PutU64(pSSM, (uint64_t)pVirtio->virtioCallbacks.pfnSSMDevLiveExec);1271 rc = SSMR3PutU64(pSSM, (uint64_t)pVirtio->virtioCallbacks.pfnSSMDevSaveExec);1272 rc = SSMR3PutU64(pSSM, (uint64_t)pVirtio->virtioCallbacks.pfnSSMDevLoadExec);1273 rc = SSMR3PutU64(pSSM, (uint64_t)pVirtio->virtioCallbacks.pfnSSMDevLoadDone);1274 rc = SSMR3PutGCPhys(pSSM, pVirtio->pGcPhysCommonCfg);1275 rc = SSMR3PutGCPhys(pSSM, pVirtio->pGcPhysNotifyCap);1276 rc = SSMR3PutGCPhys(pSSM, pVirtio->pGcPhysIsrCap);1277 rc = SSMR3PutGCPhys(pSSM, pVirtio->pGcPhysDeviceCap);1278 rc = SSMR3PutGCPhys(pSSM, pVirtio->pGcPhysPciCapBase);1279 1277 1280 1278 for (uint16_t i = 0; i < pVirtio->uNumQueues; i++) … … 1316 1314 rc = SSMR3GetU32(pSSM, &pVirtio->uDriverFeaturesSelect); 1317 1315 rc = SSMR3GetU32(pSSM, &pVirtio->uNumQueues); 1318 rc = SSMR3GetU32(pSSM, &pVirtio->cbDevSpecificCfg);1319 rc = SSMR3GetU64(pSSM, &pVirtio->uDeviceFeatures);1320 1316 rc = SSMR3GetU64(pSSM, &pVirtio->uDriverFeatures); 1321 rc = SSMR3GetU64(pSSM, (uint64_t *)&pVirtio->pDevSpecificCfg); 1322 rc = SSMR3GetU64(pSSM, (uint64_t *)&pVirtio->virtioCallbacks.pfnVirtioStatusChanged); 1323 rc = SSMR3GetU64(pSSM, (uint64_t *)&pVirtio->virtioCallbacks.pfnVirtioQueueNotified); 1324 rc = SSMR3GetU64(pSSM, (uint64_t *)&pVirtio->virtioCallbacks.pfnVirtioDevCapRead); 1325 rc = SSMR3GetU64(pSSM, (uint64_t *)&pVirtio->virtioCallbacks.pfnVirtioDevCapWrite); 1326 rc = SSMR3GetU64(pSSM, (uint64_t *)&pVirtio->virtioCallbacks.pfnSSMDevLiveExec); 1327 rc = SSMR3GetU64(pSSM, (uint64_t *)&pVirtio->virtioCallbacks.pfnSSMDevSaveExec); 1328 rc = SSMR3GetU64(pSSM, (uint64_t *)&pVirtio->virtioCallbacks.pfnSSMDevLoadExec); 1329 rc = SSMR3GetU64(pSSM, (uint64_t *)&pVirtio->virtioCallbacks.pfnSSMDevLoadDone); 1330 rc = SSMR3GetGCPhys(pSSM, &pVirtio->pGcPhysCommonCfg); 1331 rc = SSMR3GetGCPhys(pSSM, &pVirtio->pGcPhysNotifyCap); 1332 rc = SSMR3GetGCPhys(pSSM, &pVirtio->pGcPhysIsrCap); 1333 rc = SSMR3GetGCPhys(pSSM, &pVirtio->pGcPhysDeviceCap); 1334 rc = SSMR3GetGCPhys(pSSM, &pVirtio->pGcPhysPciCapBase); 1317 1335 1318 1336 1319 for (uint16_t i = 0; i < pVirtio->uNumQueues; i++) -
trunk/src/VBox/Devices/VirtIO/Virtio_1_0_impl.h
r81122 r81628 465 465 { 466 466 AssertMsg(pVirtio->uDeviceStatus & VIRTIO_STATUS_DRIVER_OK, ("Called with guest driver not ready\n")); 467 RT_UNTRUSTED_VALIDATED_FENCE(); /* VirtIO 1.0, Section 3.2.1.4.1 */ 467 468 PDMDevHlpPCIPhysWrite(pVirtio->CTX_SUFF(pDevIns), 468 469 pVirtio->pGcPhysQueueUsed[qIdx] + RT_UOFFSETOF(VIRTQ_USED_T, fFlags), … … 473 474 { 474 475 uint16_t uAvailEventIdx; 476 RT_UNTRUSTED_VALIDATED_FENCE(); /* VirtIO 1.0, Section 3.2.1.4.1 */ 475 477 /** VirtIO 1.0 uAvailEventIdx (avail_event) immediately follows ring */ 476 478 AssertMsg(pVirtio->uDeviceStatus & VIRTIO_STATUS_DRIVER_OK, ("Called with guest driver not ready\n"));
Note:
See TracChangeset
for help on using the changeset viewer.