VirtualBox

Changeset 80499 in vbox for trunk/src/VBox/Devices/VirtIO


Ignore:
Timestamp:
Aug 29, 2019 2:47:17 PM (5 years ago)
Author:
vboxsync
Message:

Storage/DrvVirtioSCSI.cpp: Added code to handle event subscriptions and eventq handling. Various improvements to round-trip I/O with Linux at startup after feature negotiation and setup. Ready to try some preliminary device access from guest. See bugref:9440 Comment #58 for more info

Location:
trunk/src/VBox/Devices/VirtIO
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp

    r80437 r80499  
    11/* $Id$ */
    22/** @file
    3  * Virtio_1_0 - Virtio Common Functions (VirtQ, virtqueue, Virtio PCI)
     3 * Virtio_1_0 - Virtio Common (PCI, feature & config mgt, queue mgt & proxy, notification mgt)
    44 */
    55
     
    259259    RTSgBufInit(&pVirtqProxy->outSgBuf,(PCRTSGSEG)&pDescChain->aSegsOut, pDescChain->cSegsOut);
    260260
    261     *ppInSegs  = &pVirtqProxy->inSgBuf;
    262     *ppOutSegs = &pVirtqProxy->outSgBuf;
     261    if (ppInSegs)
     262        *ppInSegs  = &pVirtqProxy->inSgBuf;
     263    if (ppOutSegs)
     264        *ppOutSegs = &pVirtqProxy->outSgBuf;
    263265
    264266    Log2Func(("%s -- segs out: %u,  segs in: %u --\n",
     
    362364    Log2Func(("%s\n", pVirtqProxy->szVirtqName));
    363365
     366
    364367    /** Inform client */
    365368    pVirtio->virtioCallbacks.pfnVirtioQueueNotified((VIRTIOHANDLE)pVirtio, pVirtio->pClientContext, qIdx);
     
    472475    pVirtQ->uAvailIdx = 0;
    473476    pVirtQ->uUsedIdx  = 0;
     477    pVirtio->uQueueEnable[qIdx] = false;
    474478    pVirtio->uQueueSize[qIdx] = VIRTQ_MAX_SIZE;
    475479    pVirtio->uQueueNotifyOff[qIdx] = qIdx;
    476480}
     481
    477482
    478483static void virtioResetDevice(PVIRTIOSTATE pVirtio)
     
    519524static void virtioGuestResetted(PVIRTIOSTATE pVirtio)
    520525{
    521     LogFunc(("Guest reset the device"));
     526    LogFunc(("Guest reset the device\n"));
    522527
    523528    /** Let the client know */
     
    770775    {
    771776        *(uint8_t *)pv = pVirtio->uISR;
    772         Log2Func(("Read and clear 0x%02x from uISR (interrupt type: virtq: %d, dev config: %d)\n",
    773               pVirtio->uISR, pVirtio->uISR & VIRTIO_ISR_VIRTQ_INTERRUPT,
    774               !!(pVirtio->uISR & VIRTIO_ISR_DEVICE_CONFIG)));
     777        Log2Func(("Read and clear ISR\n"));
    775778        pVirtio->uISR = 0; /** VirtIO specification requires reads of ISR to clear it */
    776779        virtioLowerInterrupt(pVirtio);
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.h

    r80437 r80499  
    215215 * @param pSgBuf    - Caller's sgbuf of one or more virtual memory segments
    216216 *                    to write to the queue. This is useful because some kinds
    217  *                    of transactions involve variable length sub-components
     217 *                    of transactions involve variable length subcomponents
    218218 *                    whose size can only be known near the time of writing.
    219219 * @parame fFence   - If set put up copy fence (memory barrier) after
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0_impl.h

    r80437 r80499  
    4040#define VIRTIO_F_RING_EVENT_IDX             RT_BIT_64(29)        /**< Doc bug: Goes under two names in spec     */
    4141
    42 #define VIRTIO_DEV_INDEPENDENT_FEATURES_OFFERED ( VIRTIO_F_EVENT_IDX ) /**< TBD: Add VIRTIO_F_INDIRECT_DESC     */
     42#define VIRTIO_DEV_INDEPENDENT_FEATURES_OFFERED ( 0 )            /**< TBD: Add VIRTIO_F_INDIRECT_DESC     */
    4343
    4444#define VIRTIO_ISR_VIRTQ_INTERRUPT           RT_BIT_32(0)        /**< Virtq interrupt bit of ISR register       */
     
    364364static void        virtioWriteUsedAvailEvent  (PVIRTIOSTATE pVirtio, uint16_t qIdx, uint32_t uAvailEventIdx);
    365365
     366
    366367DECLINLINE(int) virtqIsEventNeeded(uint16_t uEventIdx, uint16_t uDescIdxNew, uint16_t uDescIdxOld)
    367368{
     
    504505                          &uAvailEventIdx, sizeof(uAvailEventIdx));
    505506}
     507
    506508
    507509/**
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette