VirtualBox

Changeset 97530 in vbox


Ignore:
Timestamp:
Nov 14, 2022 12:24:20 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154556
Message:

Devices/VirtioCore.cpp: Add workaround for the legacy virtio-net driver included in FreeBSD up to 12.3 violating the specification leaving the device in a non working state, ticketref:21201

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/user_ChangeLogImpl.xml

    r97494 r97530  
    104104
    105105      <listitem>
     106        <para>virtio-net: Workaround a bug in the virtio-net driver included in FreeBSD version up to 12.3
     107          which renders the device non functional (bug #21201)</para>
     108      </listitem>
     109
     110      <listitem>
    106111        <para>Storage: Fixed I/O errors with the VirtioSCSI controller when the host I/O cache is enabled (bug #19717)</para>
    107112      </listitem>
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.cpp

    r97525 r97530  
    177177                                uint32_t idxDesc, PVIRTQ_DESC_T pDesc)
    178178{
    179     AssertMsg(IS_DRIVER_OK(pVirtio), ("Called with guest driver not ready\n"));
     179    /*
     180     * Shut up assertion for legacy virtio-net driver in FreeBSD up to 12.3 (see virtioCoreR3VirtqUsedBufPut()
     181     * for more information).
     182     */
     183    AssertMsg(   IS_DRIVER_OK(pVirtio)
     184              || (   pVirtio->fLegacyDriver
     185                  && pVirtq->GCPhysVirtqDesc),
     186              ("Called with guest driver not ready\n"));
    180187    uint16_t const cVirtqItems = RT_MAX(pVirtq->uQueueSize, 1); /* Make sure to avoid div-by-zero. */
    181188
     
    9951002    Assert(pVirtqBuf->cRefs > 0);
    9961003
    997     AssertMsgReturn(IS_DRIVER_OK(pVirtio), ("Guest driver not in ready state.\n"), VERR_INVALID_STATE);
     1004    /*
     1005     * Workaround for a bug in FreeBSD's virtio-net driver up until 12.3 which supports only the legacy style devive.
     1006     * When the device is re-initialized from the driver it violates the spec and posts commands to the control queue
     1007     * before setting the DRIVER_OK flag, breaking the following check and rendering the device non-functional.
     1008     * The queues are properly set up at this stage however so no real harm is done and we can safely continue here,
     1009     * for the legacy device only of course after making sure the queue is properly set up.
     1010     */
     1011    AssertMsgReturn(   IS_DRIVER_OK(pVirtio)
     1012                    || (   pVirtio->fLegacyDriver
     1013                        && pVirtq->GCPhysVirtqDesc),
     1014                    ("Guest driver not in ready state.\n"), VERR_INVALID_STATE);
    9981015
    9991016    Log6Func(("    Copying device data to %s, [desc:%u → used ring:%u]\n",
Note: See TracChangeset for help on using the changeset viewer.

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