VirtualBox

Changeset 80701 in vbox


Ignore:
Timestamp:
Sep 10, 2019 2:42:31 PM (5 years ago)
Author:
vboxsync
Message:

PDM,Devices: Redefined uReserved1 to cMaxPciDevices in the PDMDEVREG structures and added PDM_DEVREG_FLAGS_MSI_X for indicating possible need for MSI-X. bugref:9218

Location:
trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r80679 r80701  
    331331    /** Size of the raw-mode instance data. */
    332332    uint32_t            cbInstanceRC;
    333     /** Reserved, must be zero. */
    334     uint32_t            uReserved1;
     333    /** Max number of PCI devices. */
     334    uint32_t            cMaxPciDevices;
    335335    /** The description of the device. The UTF-8 string pointed to shall, like this structure,
    336336     * remain unchanged from registration till VM destruction. */
     
    411411typedef PDMDEVREGR3 const *PCPDMDEVREGR3;
    412412/** Current DEVREGR3 version number. */
    413 #define PDM_DEVREGR3_VERSION                    PDM_VERSION_MAKE(0xffff, 3, 0)
     413#define PDM_DEVREGR3_VERSION                    PDM_VERSION_MAKE(0xffff, 4, 0)
    414414
    415415
     
    470470/** Indicates that the device needs to be notified before the drivers when resetting. */
    471471#define PDM_DEVREG_FLAGS_FIRST_RESET_NOTIFICATION       UINT32_C(0x00040000)
     472
     473/** MSI-X support (affects PCI device allocation size). */
     474#define PDM_DEVREG_FLAGS_MSI_X                          UINT32_C(0x00100000)
    472475
    473476/** This flag is used to indicate that the device has been converted to the
     
    552555    /** Size of the raw-mode instance data. */
    553556    uint32_t            cbInstanceRC;
    554     /** Reserved, must be zero. */
    555     uint32_t            uReserved1;
     557    /** Max number of PCI devices. */
     558    uint32_t            cMaxPciDevices;
    556559    /** The description of the device. The UTF-8 string pointed to shall, like this structure,
    557560     * remain unchanged from registration till VM destruction. */
     
    660663    /** Size of the raw-mode instance data. */
    661664    uint32_t            cbInstanceRC;
    662     /** Reserved, must be zero. */
    663     uint32_t            uReserved1;
     665    /** Max number of PCI devices. */
     666    uint32_t            cMaxPciDevices;
    664667    /** The description of the device. The UTF-8 string pointed to shall, like this structure,
    665668     * remain unchanged from registration till VM destruction. */
     
    62166219}
    62176220
    6218 /*
     6221/**
    62196222 * Registers the device with the default PCI bus.
    62206223 *
  • trunk/src/VBox/Devices/Audio/DevHDA.cpp

    r80692 r80701  
    53255325    /* .cbInstanceCC = */           0,
    53265326    /* .cbInstanceRC = */           0,
    5327     /* .uReserved1 = */             0,
     5327    /* .cMaxPciDevices = */         1,
    53285328    /* .pszDescription = */         "Intel HD Audio Controller",
    53295329#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r80688 r80701  
    45554555    /* .cbInstanceCC = */           0,
    45564556    /* .cbInstanceRC = */           0,
    4557     /* .uReserved1 = */             0,
     4557    /* .cMaxPciDevices = */         1,
    45584558    /* .pszDescription = */         "ICH AC'97 Audio Controller",
    45594559#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Bus/DevPCI.cpp

    r80531 r80701  
    14111411    /* .cbInstanceCC = */           0,
    14121412    /* .cbInstanceRC = */           0,
    1413     /* .uReserved1 = */             0,
     1413    /* .cMaxPciDevices = */         2,
    14141414    /* .pszDescription = */         "i440FX PCI bridge and PIIX3 ISA bridge.",
    14151415#if defined(IN_RING3)
     
    17541754    /* .cbInstanceCC = */           0,
    17551755    /* .cbInstanceRC = */           0,
    1756     /* .uReserved1 = */             0,
     1756    /* .cMaxPciDevices = */         1,
    17571757    /* .pszDescription = */         "82801 Mobile PCI to PCI bridge",
    17581758#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r80531 r80701  
    36053605    /* .cbInstanceCC = */           0,
    36063606    /* .cbInstanceRC = */           0,
    3607     /* .uReserved1 = */             0,
     3607    /* .cMaxPciDevices = */         1,
    36083608    /* .pszDescription = */         "ICH9 PCI bridge",
    36093609#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r80585 r80701  
    72807280    /* .cbInstanceCC = */           0,
    72817281    /* .cbInstanceRC = */           0,
    7282     /* .uReserved1 = */             0,
     7282    /* .cMaxPciDevices = */         1,
    72837283    /* .pszDescription = */         "VGA Adaptor with VESA extensions.",
    72847284#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r80531 r80701  
    81038103    /* .uReserved0 = */             0,
    81048104    /* .szName = */                 "e1000",
    8105     /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0,
     8105    /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 | PDM_DEVREG_FLAGS_MSI_X,
    81068106    /* .fClass = */                 PDM_DEVREG_CLASS_NETWORK,
    81078107    /* .cMaxInstances = */          ~0U,
     
    81108110    /* .cbInstanceCC = */           0,
    81118111    /* .cbInstanceRC = */           0,
    8112     /* .uReserved1 = */             0,
     8112    /* .cMaxPciDevices = */         1,
    81138113    /* .pszDescription = */         "Intel PRO/1000 MT Desktop Ethernet.",
    81148114#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r80531 r80701  
    55535553    /* .cbInstanceCC = */           0,
    55545554    /* .cbInstanceRC = */           0,
    5555     /* .uReserved1 = */             0,
     5555    /* .cMaxPciDevices = */         1,
    55565556    /* .pszDescription = */         "AMD PCnet Ethernet controller.\n",
    55575557#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Network/DevVirtioNet.cpp

    r80531 r80701  
    23642364    /* .cbInstanceCC = */           0,
    23652365    /* .cbInstanceRC = */           0,
    2366     /* .uReserved1 = */             0,
     2366    /* .cMaxPciDevices = */         1,
    23672367    /* .pszDescription = */         "Virtio Ethernet.\n",
    23682368#if defined(IN_RING3)
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r80585 r80701  
    41954195    /* .cbInstanceCC = */           0,
    41964196    /* .cbInstanceRC = */           0,
    4197     /* .uReserved1 = */             0,
     4197    /* .cMaxPciDevices = */         1,
    41984198    /* .pszDescription = */         "Advanced Configuration and Power Interface",
    41994199#if defined(IN_RING3)
  • trunk/src/VBox/Devices/PC/DevLpc-new.cpp

    r80531 r80701  
    399399    /* .cbInstanceCC = */           0,
    400400    /* .cbInstanceRC = */           0,
    401     /* .uReserved1 = */             0,
     401    /* .cMaxPciDevices = */         1,
    402402    /* .pszDescription = */         "Low Pin Count (LPC) Bus",
    403403#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Samples/DevPlayground.cpp

    r80531 r80701  
    351351    /* .cbInstanceCC = */           0,
    352352    /* .cbInstanceRC = */           0,
    353     /* .uReserved1 = */             0,
     353    /* .cMaxPciDevices = */         1,
    354354    /* .pszDescription = */         "VBox Playground Device.",
    355355#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Serial/DevOxPcie958.cpp

    r80531 r80701  
    632632    /* .uReserved0 = */             0,
    633633    /* .szName = */                 "oxpcie958uart",
    634     /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0,
     634    /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0 | PDM_DEVREG_FLAGS_MSI_X,
    635635    /* .fClass = */                 PDM_DEVREG_CLASS_SERIAL,
    636636    /* .cMaxInstances = */          ~0U,
     
    639639    /* .cbInstanceCC = */           0,
    640640    /* .cbInstanceRC = */           0,
    641     /* .uReserved1 = */             0,
     641    /* .cMaxPciDevices = */         1,
    642642    /* .pszDescription = */         "OXPCIe958 based UART controller.\n",
    643643#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r80589 r80701  
    62436243    /* .cbInstanceCC = */           0,
    62446244    /* .cbInstanceRC = */           0,
    6245     /* .uReserved1 = */             0,
     6245    /* .cMaxPciDevices = */         1,
    62466246    /* .pszDescription = */         "Intel AHCI controller.\n",
    62476247#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r80531 r80701  
    80698069    /* .cbInstanceCC = */           0,
    80708070    /* .cbInstanceRC = */           0,
    8071     /* .uReserved1 = */             0,
     8071    /* .cMaxPciDevices = */         1,
    80728072    /* .pszDescription = */         "Intel PIIX3 ATA controller.\n"
    80738073                                    "  LUN #0 is primary master.\n"
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r80589 r80701  
    45044504    /* .cbInstanceCC = */           0,
    45054505    /* .cbInstanceRC = */           0,
    4506     /* .uReserved1 = */             0,
     4506    /* .cMaxPciDevices = */         1,
    45074507    /* .pszDescription = */         "BusLogic BT-958 SCSI host adapter.\n",
    45084508#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r80589 r80701  
    57515751    /* .cbInstanceCC = */           0,
    57525752    /* .cbInstanceRC = */           0,
    5753     /* .uReserved1 = */             0,
     5753    /* .cMaxPciDevices = */         1,
    57545754    /* .pszDescription = */         "LSI Logic 53c1030 SCSI controller.\n",
    57555755#if defined(IN_RING3)
  • trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp

    r80683 r80701  
    23812381    /* .cbInstanceCC = */           0,
    23822382    /* .cbInstanceRC = */           0,
    2383     /* .uReserved1 = */             0,
     2383    /* .cMaxPciDevices = */         1,
    23842384    /* .pszDescription = */         "Virtio Host SCSI.\n",
    23852385#if defined(IN_RING3)
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r80531 r80701  
    61596159    /* .cbInstanceCC = */           0,
    61606160    /* .cbInstanceRC = */           0,
    6161     /* .uReserved1 = */             0,
     6161    /* .cMaxPciDevices = */         1,
    61626162    /* .pszDescription = */         "OHCI USB controller.\n",
    61636163#if defined(IN_RING3)
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r80531 r80701  
    47524752    /* .cbInstanceCC = */           0,
    47534753    /* .cbInstanceRC = */           0,
    4754     /* .uReserved1 = */             0,
     4754    /* .cMaxPciDevices = */         1,
    47554755    /* .pszDescription = */         "VirtualBox VMM Device\n",
    47564756#if defined(IN_RING3)
  • trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp

    r80674 r80701  
    18081808                              ("pDevReg->u32Version=%#x vs %#x\n", pModReg->u32Version, PDM_DEVREGR0_VERSION), VERR_VERSION_MISMATCH);
    18091809        AssertLogRelMsgReturn(RT_VALID_PTR(pDevReg->pszDescription), ("[%u]: %p\n", i, pDevReg->pszDescription), VERR_INVALID_POINTER);
    1810         AssertLogRelMsgReturn(pDevReg->uReserved0   == 0, ("[%u]: %#x\n", i, pDevReg->uReserved0),    VERR_INVALID_PARAMETER);
    1811         AssertLogRelMsgReturn(pDevReg->uReserved1   == 0, ("[%u]: %#x\n", i, pDevReg->uReserved1),    VERR_INVALID_PARAMETER);
    1812         AssertLogRelMsgReturn(pDevReg->fClass       != 0, ("[%u]: %#x\n", i, pDevReg->fClass),        VERR_INVALID_PARAMETER);
    1813         AssertLogRelMsgReturn(pDevReg->fFlags       != 0, ("[%u]: %#x\n", i, pDevReg->fFlags),        VERR_INVALID_PARAMETER);
    1814         AssertLogRelMsgReturn(pDevReg->cMaxInstances > 0, ("[%u]: %#x\n", i, pDevReg->cMaxInstances), VERR_INVALID_PARAMETER);
     1810        AssertLogRelMsgReturn(pDevReg->uReserved0     == 0, ("[%u]: %#x\n", i, pDevReg->uReserved0),     VERR_INVALID_PARAMETER);
     1811        AssertLogRelMsgReturn(pDevReg->fClass         != 0, ("[%u]: %#x\n", i, pDevReg->fClass),         VERR_INVALID_PARAMETER);
     1812        AssertLogRelMsgReturn(pDevReg->fFlags         != 0, ("[%u]: %#x\n", i, pDevReg->fFlags),         VERR_INVALID_PARAMETER);
     1813        AssertLogRelMsgReturn(pDevReg->cMaxInstances   > 0, ("[%u]: %#x\n", i, pDevReg->cMaxInstances),  VERR_INVALID_PARAMETER);
     1814        AssertLogRelMsgReturn(pDevReg->cMaxPciDevices <= 8, ("[%u]: %#x\n", i, pDevReg->cMaxPciDevices), VERR_INVALID_PARAMETER);
    18151815
    18161816        /* The name must be printable ascii and correctly terminated. */
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r80679 r80701  
    16561656     * Validate input.
    16571657     */
     1658    AssertLogRelMsgReturn(pDevIns->pReg->cMaxPciDevices > 0,
     1659                          ("'%s'/%d: cMaxPciDevices is 0\n", pDevIns->pReg->szName, pDevIns->iInstance),
     1660                          VERR_WRONG_ORDER);
    16581661    AssertLogRelMsgReturn(RT_VALID_PTR(pPciDev),
    16591662                          ("'%s'/%d: Invalid pPciDev value: %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pPciDev),
     
    19211924    LogFlow(("pdmR3DevHlp_PCIRegisterMsi: caller='%s'/%d: pPciDev=%p:{%#x} pMsgReg=%p:{cMsiVectors=%d, cMsixVectors=%d}\n",
    19221925             pDevIns->pReg->szName, pDevIns->iInstance, pPciDev, pPciDev->uDevFn, pMsiReg, pMsiReg->cMsiVectors, pMsiReg->cMsixVectors));
     1926
     1927    AssertLogRelMsgReturn(pDevIns->pReg->cMaxPciDevices > 0,
     1928                          ("'%s'/%d: cMaxPciDevices is 0\n", pDevIns->pReg->szName, pDevIns->iInstance),
     1929                          VERR_WRONG_ORDER);
     1930    AssertLogRelMsgReturn((pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_MSI_X) || pMsiReg->cMsixVectors == 0,
     1931                          ("'%s'/%d: PDM_DEVREG_FLAGS_MSI_X not set and cMsixVectors=%u\n",
     1932                           pDevIns->pReg->szName, pDevIns->iInstance, pMsiReg->cMsixVectors),
     1933                          VERR_INVALID_FLAGS);
    19231934
    19241935    PPDMPCIBUS pBus = pPciDev->Int.s.pPdmBusR3; Assert(pBus);
  • trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp

    r80542 r80701  
    760760                    ("u32VersionEnd=%#x, expected %#x. (szName=%s)\n",
    761761                     pReg->u32VersionEnd, PDM_DEVREG_VERSION, pReg->szName));
     762    AssertLogRelMsgReturn(pReg->cMaxPciDevices <= 8, ("%#x (szName=%s)\n", pReg->cMaxPciDevices, pReg->szName),
     763                          VERR_PDM_INVALID_DEVICE_REGISTRATION);
    762764
    763765    /*
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