VirtualBox

Changeset 75979 in vbox


Ignore:
Timestamp:
Dec 5, 2018 3:50:48 PM (6 years ago)
Author:
vboxsync
Message:

VMMDevHGCM: It is not possible to restore cancelled requests (guest memory no longer valid) and it makes no sense to even save them. Fixes issues like 'VBoxControl guestproperty wait' failing with VERR_HGCM_INVALID_CLIENT_ID on restore.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp

    r75853 r75979  
    18121812            AssertRCReturn(rc, rc);
    18131813
    1814             vmmdevHGCMAddCommand(pThis, pCmd);
     1814            /*
     1815             * Do not restore cancelled calls.  Why do we save them to start with?
     1816             *
     1817             * The guest memory no longer contains a valid request!  So, it is not
     1818             * possible to restore it.  The memory is often reused for a new request
     1819             * by now and we will end up trying to complete that more than once if
     1820             * we restore a cancelled call.  In some cases VERR_HGCM_INVALID_CLIENT_ID
     1821             * is returned, though it might just be silent memory corruption.
     1822             */
     1823            /* See current version above. */
     1824            if (!fCancelled)
     1825                vmmdevHGCMAddCommand(pThis, pCmd);
     1826            else
     1827            {
     1828                Log(("vmmdevHGCMLoadState: Skipping cancelled request: enmCmdType=%d GCPhys=%#RX32 LB %#x\n",
     1829                     enmCmdType, GCPhys, cbRequest));
     1830                vmmdevHGCMCmdFree(pThis, pCmd);
     1831            }
    18151832        }
    18161833
     
    18881905            AssertRCReturn(rc, rc);
    18891906
    1890             vmmdevHGCMAddCommand(pThis, pCmd);
     1907            /* See current version above. */
     1908            if (!fCancelled)
     1909                vmmdevHGCMAddCommand(pThis, pCmd);
     1910            else
     1911            {
     1912                Log(("vmmdevHGCMLoadState: Skipping cancelled request: enmCmdType=%d GCPhys=%#RX32 LB %#x\n",
     1913                     enmCmdType, GCPhys, cbRequest));
     1914                vmmdevHGCMCmdFree(pThis, pCmd);
     1915            }
    18911916        }
    18921917
     
    19481973    AssertReturn(pCmd, VERR_NO_MEMORY);
    19491974
    1950     if (u32SSMVersion >= 9)
    1951         pCmd->fCancelled = pLoadedCmd->fCancelled;
    1952     else
    1953         pCmd->fCancelled = false;
     1975    Assert(pLoadedCmd->fCancelled == false);
     1976    pCmd->fCancelled = false;
    19541977    pCmd->fRestored      = true;
    19551978    pCmd->enmRequestType = enmRequestType;
     
    19912014    AssertReturn(pCmd, VERR_NO_MEMORY);
    19922015
    1993     if (u32SSMVersion >= 9)
    1994         pCmd->fCancelled = pLoadedCmd->fCancelled;
    1995     else
    1996         pCmd->fCancelled = false;
     2016    Assert(pLoadedCmd->fCancelled == false);
     2017    pCmd->fCancelled = false;
    19972018    pCmd->fRestored      = true;
    19982019    pCmd->enmRequestType = enmRequestType;
     
    20282049    {
    20292050        ASSERT_GUEST_RETURN(pLoadedCmd->enmCmdType == VBOXHGCMCMDTYPE_CALL, VERR_MISMATCH);
     2051        Assert(pLoadedCmd->fCancelled == false);
    20302052    }
    20312053
     
    20372059
    20382060    /* pLoadedCmd is fake, it does not contain actual call parameters. Only pagelists for LinAddr. */
    2039     if (u32SSMVersion >= 9)
    2040         pCmd->fCancelled = pLoadedCmd->fCancelled;
    2041     else
    2042         pCmd->fCancelled = false;
     2061    pCmd->fCancelled = false;
    20432062    pCmd->fRestored      = true;
    20442063    pCmd->enmRequestType = enmRequestType;
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