Changeset 84877 in vbox for trunk/src/VBox/Devices/VirtIO
- Timestamp:
- Jun 19, 2020 6:51:21 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VirtIO/VirtioCore.h
r84876 r84877 214 214 uint8_t uConfigGeneration; /**< RO (device changes when changing configs) */ 215 215 216 /* Virtq-specific fields (values reflect (via MMIO 0 the queue indicated with uVirtqSelect)*/216 /* Virtq-specific fields (values reflect (via MMIO) info related to queue indicated by uVirtqSelect. */ 217 217 uint16_t uVirtqSelect; /**< RW (selects queue focus for these fields) */ 218 218 uint16_t uVirtqSize; /**< RW (queue size, 0 - 2^n) */ … … 492 492 493 493 /** 494 * Fetches descriptor chain using avail ring of indicated queue and converts the descriptor 495 * chain into its OUT (to device) and IN to guest components, but does NOT remove it from 496 * the 'avail' queue. I.e. doesn't advance the ring's slot index. This can be used with 497 * virtioCoreVirtqSkip(), which *does* advance the avail index. Together they facilitate 498 * mechanism that allows work with a queue'd buffer (descriptor chain). be aborted if 499 * necessary, by not advancing the pointer, or, upon success calling the skip function 500 * (above) to move to the next element. 501 * 502 * Additionally it converts the OUT desc chain data to a contiguous virtual 503 * memory buffer for easy consumption by the caller. The caller must return the 504 * descriptor chain pointer via virtioCoreR3VirtqUsedBufPut() and then call virtioCoreVirtqSyncUsedRing() 505 * at some point to return the data to the guest and complete the transaction. 494 * This function is identical to virtioCoreR3VirtqAvailBufGet(), except it doesn't 'consume' 495 * the buffer from the avail ring of the virtq. The peek operation becomes identical to a get 496 * operation if virtioCoreR3VirtqAvailRingNext() is called to consume the buffer from the avail ring, 497 * at which point virtioCoreR3VirtqUsedBufPut() must be called to complete the roundtrip 498 * transaction putting the descriptor on the used ring. 499 * 506 500 * 507 501 * @param pDevIns The device instance. … … 520 514 521 515 /** 522 * This function Fetches next buffer (descriptor chain) from the VirtIO "avail" ring of 523 * indicated queue and converts the buffer's s/g vectors into OUT (e.g. to host device) 524 * and IN (e.g. to guest driver) components. 525 * 526 * The caller is responsible for GCPhys to HC Virtual Memory conversions and *must* 527 * return the virtq buffer using virtioCoreR3VirtqUsedBufPut() to complete the roundtrip 528 * virtq transaction if the caller has subsequently called virtioCoreR3VirtqSkip() 529 * to advance the pointer in the virtq's avail ring to the next descriptor chain 530 * (at which point the peek becomes indistinguishable from a get operation) 516 * This functionf fetches the next buffer (descriptor chain) from the VirtIO "avail" ring of 517 * indicated queue, and converts the buf's s/g vectors into OUT (e.g. guest-to-host) 518 * components and and IN (host-to-guest) components. 519 * 520 * The caller is responsible for GCPhys to host virtual memory conversions. If the 521 * virtq buffer being peeked at is "consumed", virtioCoreR3VirtqAvailRingNext() must 522 * be called and in that case virtioCoreR3VirtqUsedBufPut() must be called to 523 * complete the roundtrip virtq transaction. 531 524 * 532 525 * @param pDevIns The device instance. … … 551 544 * chain into its OUT (to device) and IN to guest components. 552 545 * 553 * The caller is responsible for GCPhys to HC Virtual Memory conversions and *must*546 * The caller is responsible for GCPhys to host virtual memory conversions and *must* 554 547 * return the virtq buffer using virtioCoreR3VirtqUsedBufPut() to complete the roundtrip 555 548 * virtq transaction. 556 * 557 * At some some point virtioCoreR3VirtqSync() must be called to return data to the guest, 558 * completing all the virtioCoreR3VirtqAvailBufGet() and virtioCoreR3VirtqAvailBufPeek() 559 * transactions that have accumulated since the last call to virtioCoreR3VirtqSync() 560 * 549 * * 561 550 * @param pDevIns The device instance. 562 551 * @param pVirtio Pointer to the shared virtio state. … … 583 572 * guest, the guest must provide buffers for the host to fill to the avail ring of the 584 573 * virtq. 585 * * 574 * 575 * At some some point virtioCoreR3VirtqUsedRingSync() must be called to return data to the guest, 576 * completing all pending virtioCoreR3VirtqAvailBufPut() transactions that have accumulated since 577 * the last call to virtioCoreR3VirtqUsedRingSync() 578 586 579 * @note This does a write-ahead to the used ring of the guest's queue. The data 587 580 * written won't be seen by the guest until the next call to virtioCoreVirtqSyncUsedRing()
Note:
See TracChangeset
for help on using the changeset viewer.