VirtualBox

Changeset 81051 in vbox


Ignore:
Timestamp:
Sep 27, 2019 12:24:20 PM (5 years ago)
Author:
vboxsync
Message:

DevPciIch9: Always save the MSI-X state size. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r81039 r81051  
    11521152                SSMR3PutMem(pSSM, pDev->abMsixState, pDev->Int.s.cbMsixRegion);
    11531153            }
     1154            else
     1155                SSMR3PutU32(pSSM, 0);
    11541156
    11551157            /* Save the type an size of all the regions. */
     
    16501652
    16511653        /* Load MSI-X page state */
    1652         if (u.DevTmp.Int.s.u8MsixCapOffset != 0)
    1653         {
    1654             uint32_t cbMsixState = _4K;
    1655             if (uVersion >= VBOX_ICH9PCI_SAVED_STATE_VERSION_4KB_CFG_SPACE)
    1656             {
    1657                 rc = SSMR3GetU32(pSSM, &cbMsixState);
    1658                 AssertRCReturn(rc, rc);
    1659                 if (   cbMsixState > (uint32_t)(pDev ? pDev->cbMsixState : _32K + _16K)
    1660                     || cbMsixState > sizeof(u) - RT_UOFFSETOF(PDMPCIDEV, abMsixState))
    1661                     return SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS,
    1662                                              "cbMsixState=%#RX32, expected at most RT_MIN(%#x, %#zx)",
    1663                                              cbMsixState, (pDev ? pDev->cbMsixState : _32K + _16K),
    1664                                              sizeof(u) - RT_UOFFSETOF(PDMPCIDEV, abMsixState));
    1665             }
     1654        uint32_t cbMsixState = u.DevTmp.Int.s.u8MsixCapOffset != 0 ? _4K : 0;
     1655        if (uVersion >= VBOX_ICH9PCI_SAVED_STATE_VERSION_4KB_CFG_SPACE)
     1656        {
     1657            rc = SSMR3GetU32(pSSM, &cbMsixState);
     1658            AssertRCReturn(rc, rc);
     1659        }
     1660        if (cbMsixState)
     1661        {
     1662            if (   cbMsixState > (uint32_t)(pDev ? pDev->cbMsixState : _32K + _16K)
     1663                || cbMsixState > sizeof(u) - RT_UOFFSETOF(PDMPCIDEV, abMsixState))
     1664                return SSMR3SetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS,
     1665                                         "cbMsixState=%#RX32, expected at most RT_MIN(%#x, %#zx)",
     1666                                         cbMsixState, (pDev ? pDev->cbMsixState : _32K + _16K),
     1667                                         sizeof(u) - RT_UOFFSETOF(PDMPCIDEV, abMsixState));
    16661668            rc = SSMR3GetMem(pSSM, u.DevTmp.abMsixState, cbMsixState);
    16671669            AssertRCReturn(rc, rc);
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