VirtualBox

Changeset 50575 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Feb 25, 2014 1:07:16 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92440
Message:

VMM: Added SSMR3RegisterStub and used it to provide saved state load-exec stubs for ignoring CSAM and PATM state when VBOX_WITH_RAW_MODE isn't defined or when HM is active.

Location:
trunk/src/VBox/VMM
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CSAM.cpp

    r49247 r50575  
    7272static DECLCALLBACK(int) csamr3Save(PVM pVM, PSSMHANDLE pSSM);
    7373static DECLCALLBACK(int) csamr3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
    74 static DECLCALLBACK(int) csamR3LoadDummy(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
    7574static DECLCALLBACK(int) CSAMCodePageWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser);
    7675static DECLCALLBACK(int) CSAMCodePageInvalidate(PVM pVM, RTGCPTR GCPtr);
     
    232231    {
    233232        pVM->fCSAMEnabled = false;
    234         return SSMR3RegisterInternal(pVM, "CSAM", 0, CSAM_SSM_VERSION, 0,
    235                                      NULL, NULL, NULL,
    236                                      NULL, NULL, NULL,
    237                                      NULL, csamR3LoadDummy, NULL);
     233        return SSMR3RegisterStub(pVM, "CSAM", 0);
    238234    }
    239235
     
    566562    /** @note we don't restore aDangerousInstr; it will be recreated automatically. */
    567563    return VINF_SUCCESS;
    568 }
    569 
    570 
    571 /**
    572  * @callback_method_impl{FNSSMINTLOADEXEC, Dummy load function for HM mode.}
    573  */
    574 DECLCALLBACK(int) csamR3LoadDummy(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    575 {
    576     return SSMR3SkipToEndOfUnit(pSSM);
    577564}
    578565
  • trunk/src/VBox/VMM/VMMR3/PATM.cpp

    r46493 r50575  
    146146    {
    147147        pVM->fPATMEnabled = false;
    148         return SSMR3RegisterInternal(pVM, "PATM", 0, PATM_SSM_VERSION, 0,
    149                                      NULL, NULL, NULL,
    150                                      NULL, NULL, NULL,
    151                                      NULL, patmR3LoadDummy, NULL);
     148        return SSMR3RegisterStub(pVM, "PATM", 0);
    152149    }
    153150
  • trunk/src/VBox/VMM/VMMR3/PATMSSM.cpp

    r49808 r50575  
    804804
    805805/**
    806  * @callback_method_impl{FNSSMINTLOADEXEC, Dummy load function for HM mode.}
    807  */
    808 DECLCALLBACK(int) patmR3LoadDummy(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    809 {
    810     return SSMR3SkipToEndOfUnit(pSSM);
    811 }
    812 
    813 
    814 /**
    815806 * Execute state load operation.
    816807 *
  • trunk/src/VBox/VMM/VMMR3/SSM.cpp

    r49801 r50575  
    14681468    }
    14691469    return rc;
     1470}
     1471
     1472
     1473/**
     1474 * @callback_method_impl{FNSSMINTLOADEXEC,
     1475 * Stub that skips the whole unit (see SSMR3RegisterStub).}
     1476 */
     1477static DECLCALLBACK(int) ssmR3LoadExecStub(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
     1478{
     1479    NOREF(pVM); NOREF(uVersion); NOREF(uPass);
     1480    return SSMR3SkipToEndOfUnit(pSSM);
     1481}
     1482
     1483
     1484/**
     1485 * Registers a stub state loader for working around legacy.
     1486 *
     1487 * This is used to deal with irelevant PATM and CSAM saved state units in HM
     1488 * mode and when built without raw-mode.
     1489 *
     1490 * @returns VBox status code.
     1491 * @param   pVM                 The VM handle.
     1492 * @param   pszName             Data unit name.
     1493 * @param   uInstance           Instance number.
     1494 */
     1495VMMR3DECL(int) SSMR3RegisterStub(PVM pVM, const char *pszName, uint32_t uInstance)
     1496{
     1497    return SSMR3RegisterInternal(pVM, pszName, uInstance, UINT32_MAX, 0,
     1498                                 NULL, NULL, NULL,
     1499                                 NULL, NULL, NULL,
     1500                                 NULL, ssmR3LoadExecStub, NULL);
    14701501}
    14711502
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r49893 r50575  
    11661166    if (RT_SUCCESS(rc))
    11671167        rc = PGMR3InitCompleted(pVM, enmWhat);
     1168#ifndef VBOX_WITH_RAW_MODE
     1169    if (RT_SUCCESS(rc))
     1170        rc = SSMR3RegisterStub(pVM, "CSAM", 0);
     1171    if (RT_SUCCESS(rc))
     1172        rc = SSMR3RegisterStub(pVM, "PATM", 0);
     1173#endif
    11681174    return rc;
    11691175}
  • trunk/src/VBox/VMM/include/PATMInternal.h

    r49464 r50575  
    567567DECLCALLBACK(int) patmR3Save(PVM pVM, PSSMHANDLE pSSM);
    568568DECLCALLBACK(int) patmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
    569 DECLCALLBACK(int) patmR3LoadDummy(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
    570569
    571570#ifdef IN_RING3
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