VirtualBox

Changeset 82176 in vbox for trunk/src


Ignore:
Timestamp:
Nov 25, 2019 1:41:20 PM (5 years ago)
Author:
vboxsync
Message:

PC/BIOS: The index of the avail queue is supposed to be free running and only clipped to the queue size internally, bugref:9440

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/virtio.c

    r82174 r82176  
    467467
    468468    /* Put it into the queue. */
    469     virtio->Queue.AvailRing.au16Ring[virtio->Queue.AvailRing.idxNextFree] = 0;
     469    virtio->Queue.AvailRing.au16Ring[virtio->Queue.AvailRing.idxNextFree % VIRTIO_SCSI_RING_ELEM] = 0;
    470470    virtio->Queue.AvailRing.idxNextFree++;
    471     virtio->Queue.AvailRing.idxNextFree %= VIRTIO_SCSI_RING_ELEM;
    472471
    473472    /* Notify the device about the new command. */
     
    523522    virtio->Queue.aDescTbl[2].idxNext       = 0;
    524523
    525     /* Put it into the queue. */
    526     virtio->Queue.AvailRing.au16Ring[virtio->Queue.AvailRing.idxNextFree] = 0;
     524    /* Put it into the queue, the index is supposed to be free-running and clipped to the ring size
     525     * internally. The free running index is what the driver sees. */
     526    virtio->Queue.AvailRing.au16Ring[virtio->Queue.AvailRing.idxNextFree % VIRTIO_SCSI_RING_ELEM] = 0;
    527527    virtio->Queue.AvailRing.idxNextFree++;
    528     virtio->Queue.AvailRing.idxNextFree %= VIRTIO_SCSI_RING_ELEM;
    529528
    530529    /* Notify the device about the new command. */
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