VirtualBox

Changeset 98644 in vbox


Ignore:
Timestamp:
Feb 20, 2023 12:05:56 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155944
Message:

VMM,SUPLib: Adjustments for running tstPDMQueue in driverless mode on hardened windows builds. This adds a fFlags parameter to VMR3Create and defines VMCREATE_F_DRIVERLESS, allowing it to switch between default and driverless suplib initialization. The default CFGM config constructor was amended to enable the IEM fallback option by default (only relevant to amd64/x86).

Location:
trunk
Files:
12 edited

Legend:

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

    r98267 r98644  
    384384
    385385
    386 VMMR3DECL(int)          VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVm2UserCbs,
     386VMMR3DECL(int)          VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVm2UserCbs, uint64_t fFlags,
    387387                                   PFNVMATERROR pfnVMAtError, void *pvUserVM,
    388388                                   PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM,
    389389                                   PVM *ppVM, PUVM *ppUVM);
     390/** @name VMCREATE_F_XXX - VMR3Create flags.
     391 * @{ */
     392/** Create the VM with SUPLib in driverless mode. */
     393#define VMCREATE_F_DRIVERLESS       RT_BIT_64(0)
     394/** @} */
    390395VMMR3DECL(int)          VMR3PowerOn(PUVM pUVM);
    391396VMMR3DECL(int)          VMR3Suspend(PUVM pUVM, VMSUSPENDREASON enmReason);
  • trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp

    r98103 r98644  
    151151#endif
    152152    }
     153
     154#if !defined(IN_SUP_HARDENED_R3)
     155    /*
     156     * Driverless?
     157     */
     158    if (fFlags & SUPR3INIT_F_DRIVERLESS)
     159    {
     160        pThis->fDriverless = true;
     161        return VINF_SUCCESS;
     162    }
     163#endif
    153164
    154165    /*
     
    274285                pErrInfo->pszMsg[0] = '\0';
    275286        }
     287
     288        /*
     289         * Do fallback.
     290         */
     291        if (   (fFlags & SUPR3INIT_F_DRIVERLESS_MASK)
     292            && rcNt != -1 /** @todo */ )
     293        {
     294            LogRel(("Failed to open '%.*ls' rc=%Rrc rcNt=%#x - Switching to driverless mode.\n",
     295                    NtName.Length / sizeof(WCHAR), NtName.Buffer, rc, rcNt));
     296            pThis->fDriverless = true;
     297            return VINF_SUCCESS;
     298        }
     299
    276300#else
    277301        RT_NOREF1(penmWhat);
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r98340 r98644  
    1102211022        vrc = pVMM->pfnVMR3Create(cCpus,
    1102311023                                  pConsole->mpVmm2UserMethods,
     11024                                  0 /*fFlags*/,
    1102411025                                  Console::i_genericVMSetErrorCallback,
    1102511026                                  &pTask->mErrorMsg,
  • trunk/src/VBox/VMM/VMMR3/CFGM.cpp

    r98103 r98644  
    10851085    rc = CFGMR3InsertInteger(pRoot, "TimerMillies",         10);
    10861086    UPDATERC();
     1087
     1088    /*
     1089     * HM.
     1090     */
     1091    PCFGMNODE pHm;
     1092    rc = CFGMR3InsertNode(pRoot, "HM", &pHm);
     1093    UPDATERC();
     1094    rc = CFGMR3InsertInteger(pHm, "FallbackToIEM",          1); /* boolean */
     1095    UPDATERC();
     1096
    10871097
    10881098    /*
     
    32933303    LogRel(("************************* CFGM dump *************************\n"));
    32943304    cfgmR3Dump(pRoot, 0, DBGFR3InfoLogRelHlp());
     3305#ifdef LOG_ENABLED
     3306    if (LogIsEnabled())
     3307        cfgmR3Dump(pRoot, 0, DBGFR3InfoLogHlp());
     3308#endif
    32953309    LogRel(("********************* End of CFGM dump **********************\n"));
    32963310    RTLogRelSetBuffering(fOldBuffered);
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r98103 r98644  
    133133 *                              to make the user perform various action, like
    134134 *                              for instance state saving.
     135 * @param   fFlags              VMCREATE_F_XXX
    135136 * @param   pfnVMAtError        Pointer to callback function for setting VM
    136137 *                              errors.  This was added as an implicit call to
     
    151152 *                              VMR3ReleaseUVM() once done with the handle.
    152153 */
    153 VMMR3DECL(int)   VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVmm2UserMethods,
     154VMMR3DECL(int)   VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVmm2UserMethods, uint64_t fFlags,
    154155                            PFNVMATERROR pfnVMAtError, void *pvUserVM,
    155156                            PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM,
    156157                            PVM *ppVM, PUVM *ppUVM)
    157158{
    158     LogFlow(("VMR3Create: cCpus=%RU32 pVmm2UserMethods=%p pfnVMAtError=%p pvUserVM=%p  pfnCFGMConstructor=%p pvUserCFGM=%p ppVM=%p ppUVM=%p\n",
    159              cCpus, pVmm2UserMethods, pfnVMAtError, pvUserVM, pfnCFGMConstructor, pvUserCFGM, ppVM, ppUVM));
     159    LogFlow(("VMR3Create: cCpus=%RU32 pVmm2UserMethods=%p fFlags=%#RX64 pfnVMAtError=%p pvUserVM=%p  pfnCFGMConstructor=%p pvUserCFGM=%p ppVM=%p ppUVM=%p\n",
     160             cCpus, pVmm2UserMethods, fFlags, pfnVMAtError, pvUserVM, pfnCFGMConstructor, pvUserCFGM, ppVM, ppUVM));
    160161
    161162    if (pVmm2UserMethods)
     
    177178    AssertPtrNullReturn(ppUVM, VERR_INVALID_POINTER);
    178179    AssertReturn(ppVM || ppUVM, VERR_INVALID_PARAMETER);
     180    AssertMsgReturn(!(fFlags & ~VMCREATE_F_DRIVERLESS), ("%#RX64\n", fFlags), VERR_INVALID_FLAGS);
    179181
    180182    /*
     
    198200         * Initialize the support library creating the session for this VM.
    199201         */
    200         rc = SUPR3Init(&pUVM->vm.s.pSession);
     202        if (fFlags & VMCREATE_F_DRIVERLESS)
     203            rc = SUPR3InitEx(SUPR3INIT_F_DRIVERLESS | SUPR3INIT_F_DRIVERLESS_IEM_ALLOWED, &pUVM->vm.s.pSession);
     204        else
     205            rc = SUPR3Init(&pUVM->vm.s.pSession);
    201206        if (RT_SUCCESS(rc))
    202207        {
  • trunk/src/VBox/VMM/testcase/tstAnimate.cpp

    r98103 r98644  
    839839    PVM pVM;
    840840    PUVM pUVM;
    841     rc = VMR3Create(1, NULL, NULL, NULL, cfgmR3CreateDefault, &cbMem, &pVM, &pUVM);
     841    rc = VMR3Create(1 /*cCpus*/, NULL, 0 /*fFlags*/, NULL, NULL, cfgmR3CreateDefault, &cbMem, &pVM, &pUVM);
    842842    if (RT_SUCCESS(rc))
    843843    {
  • trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletion.cpp

    r98103 r98644  
    103103    PVM pVM;
    104104    PUVM pUVM;
    105     int rc = VMR3Create(1, NULL, NULL, NULL, NULL, NULL, &pVM, &pUVM);
     105    int rc = VMR3Create(1 /*cCpus*/, NULL, 0 /*fFlags*/, NULL, NULL, NULL, NULL, &pVM, &pUVM);
    106106    if (RT_SUCCESS(rc))
    107107    {
  • trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp

    r98103 r98644  
    592592    PVM pVM;
    593593    PUVM pUVM;
    594     int rc = VMR3Create(1, NULL, NULL, NULL, NULL, NULL, &pVM, &pUVM);
     594    int rc = VMR3Create(1 /*cCpus*/, NULL, 0 /*fFlags*/, NULL, NULL, NULL, NULL, &pVM, &pUVM);
    595595    if (RT_SUCCESS(rc))
    596596    {
  • trunk/src/VBox/VMM/testcase/tstPDMQueue.cpp

    r98103 r98644  
    424424    PVM  pVM;
    425425    PUVM pUVM;
    426     RTTESTI_CHECK_RC_OK_RETV(VMR3Create(1, NULL, NULL, NULL, NULL, NULL, &pVM, &pUVM));
     426    RTTESTI_CHECK_RC_OK_RETV(VMR3Create(1 /*cCpus*/, NULL, VMCREATE_F_DRIVERLESS, NULL, NULL, NULL, NULL, &pVM, &pUVM));
    427427
    428428    /*
  • trunk/src/VBox/VMM/testcase/tstVMM-HM.cpp

    r98103 r98644  
    9898    PVM pVM;
    9999    PUVM pUVM;
    100     int rc = VMR3Create(1, NULL, NULL, NULL, tstVmmHmConfigConstructor, NULL, &pVM, &pUVM);
     100    int rc = VMR3Create(1 /*cCpus*/, NULL, 0 /*fFlags*/, NULL, NULL, tstVmmHmConfigConstructor, NULL, &pVM, &pUVM);
    101101    if (RT_SUCCESS(rc))
    102102    {
  • trunk/src/VBox/VMM/testcase/tstVMMFork.cpp

    r98103 r98644  
    7878    PVM pVM;
    7979    PUVM pUVM;
    80     int rc = VMR3Create(1, NULL, NULL, NULL, NULL, NULL, &pVM, &pUVM);
     80    int rc = VMR3Create(1 /*cCpus*/, NULL, 0 /*fFlags*/, NULL, NULL, NULL, NULL, &pVM, &pUVM);
    8181    if (RT_SUCCESS(rc))
    8282    {
  • trunk/src/VBox/VMM/testcase/tstVMREQ.cpp

    r98103 r98644  
    240240     */
    241241    PUVM pUVM;
    242     int rc = VMR3Create(1, NULL, NULL, NULL, tstVMREQConfigConstructor, NULL, NULL, &pUVM);
     242    int rc = VMR3Create(1 /*cCpus*/, NULL, 0 /*fFlags*/, NULL, NULL, tstVMREQConfigConstructor, NULL, NULL, &pUVM);
    243243    if (RT_SUCCESS(rc))
    244244    {
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