VirtualBox

Changeset 94275 in vbox for trunk/src


Ignore:
Timestamp:
Mar 16, 2022 5:41:07 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150534
Message:

VirtioCore: "Transitional devices MUST have a PCI Revision ID of 0."
"Non-transitional devices SHOULD have a PCI Revision ID of 1 or
higher." NetBSD (strictly speaking incorrectly) insists on revision
being 1 for non-transitional devices (device id > 0x1040), so obey the
"SHOULD" which we don't really have any reason not to. bugref:9440.

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

Legend:

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

    r93944 r94275  
    23782378    PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev);
    23792379
    2380     PDMPciDevSetRevisionId(pPciDev,         DEVICE_PCI_REVISION_ID_VIRTIO);
    23812380    PDMPciDevSetVendorId(pPciDev,           DEVICE_PCI_VENDOR_ID_VIRTIO);
    23822381    PDMPciDevSetDeviceId(pPciDev,           pPciParams->uDeviceId);
     2382
     2383    if (pPciParams->uDeviceId < DEVICE_PCI_DEVICE_ID_VIRTIO_BASE)
     2384        /* Transitional devices MUST have a PCI Revision ID of 0. */
     2385        PDMPciDevSetRevisionId(pPciDev,     DEVICE_PCI_REVISION_ID_VIRTIO_TRANS);
     2386    else
     2387        /* Non-transitional devices SHOULD have a PCI Revision ID of 1 or higher. */
     2388        PDMPciDevSetRevisionId(pPciDev,     DEVICE_PCI_REVISION_ID_VIRTIO_V1);
     2389
    23832390    PDMPciDevSetSubSystemId(pPciDev,        DEVICE_PCI_NETWORK_SUBSYSTEM);
    23842391    PDMPciDevSetSubSystemVendorId(pPciDev,  DEVICE_PCI_VENDOR_ID_VIRTIO);
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.h

    r93115 r94275  
    183183#define VIRTIO_ISR_DEVICE_CONFIG             RT_BIT_32(1)        /**< Device configuration changed bit of ISR   */
    184184#define DEVICE_PCI_NETWORK_SUBSYSTEM                    1        /**< Network Card, per VirtIO legacy spec.     */
     185#define DEVICE_PCI_REVISION_ID_VIRTIO_TRANS             0        /**< VirtIO Transitional device revision (MBZ) */
     186#define DEVICE_PCI_REVISION_ID_VIRTIO_V1                1        /**< VirtIO device revision (SHOULD be >= 1)   */
     187
    185188#define DEVICE_PCI_VENDOR_ID_VIRTIO                0x1AF4        /**< Guest driver locates dev via (mandatory)  */
    186 #define DEVICE_PCI_REVISION_ID_VIRTIO                   0        /**< VirtIO Modern Transitional driver rev MBZ */
     189
     190/**
     191 * Start of the PCI device id range for non-transitional devices.
     192 *
     193 * "Devices ... have the PCI Device ID calculated by adding 0x1040 to
     194 * the Virtio Device ID, as indicated in section [Device Types]. ...
     195 * Non-transitional devices SHOULD have a PCI Device ID in the range
     196 * 0x1040 to 0x107f.
     197 */
     198#define DEVICE_PCI_DEVICE_ID_VIRTIO_BASE           0x1040
    187199
    188200/** Reserved (*negotiated*) Feature Bits (e.g. device independent features, VirtIO 1.0 spec,section 6) */
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