VirtualBox

Changeset 914 in vbox


Ignore:
Timestamp:
Feb 14, 2007 11:23:08 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18641
Message:

PVMR0 changes for darwin.

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pgm.h

    r861 r914  
    13821382 * @returns VBox status code.
    13831383 * @param   pVM         The virtual machine.
    1384  * @param   pvAddr      Intermediate context address of the mapping. This must be entriely below 4GB!
     1384 * @param   Addr        Intermediate context address of the mapping.
    13851385 * @param   HCPhys      Start of the range of physical pages. This must be entriely below 4GB!
    13861386 * @param   cbPages     Number of bytes to map.
     
    13881388 * @remark  This API shall not be used to anything but mapping the switcher code.
    13891389 */
    1390 PGMR3DECL(int) PGMR3MapIntermediate(PVM pVM, void *pvAddr, RTHCPHYS HCPhys, unsigned cbPages);
     1390PGMR3DECL(int) PGMR3MapIntermediate(PVM pVM, RTUINTPTR Addr, RTHCPHYS HCPhys, unsigned cbPages);
    13911391
    13921392/**
  • trunk/include/VBox/sup.h

    r335 r914  
    169169{
    170170    PCSUPGLOBALINFOPAGE pGIP;
    171     __asm__ __volatile__ ("movabs g_SUPGlobalInfoPage,%0\n\t" 
     171    __asm__ __volatile__ ("movabs g_SUPGlobalInfoPage,%0\n\t"
    172172                          : "=a" (pGIP));
    173173    return pGIP;
     
    176176# else
    177177#  define g_pSUPGlobalInfoPage         (&g_SUPGlobalInfoPage)
    178 #endif 
     178#endif
    179179#else
    180180extern DECLIMPORT(PCSUPGLOBALINFOPAGE)  g_pSUPGlobalInfoPage;
     
    251251 *
    252252 * @returns error code specific to uFunction.
    253  * @param   pVM         Pointer to the Host Context mapping of the VM structure.
     253 * @param   pVMR0       Pointer to the Ring-0 (Host Context) mapping of the VM structure.
    254254 * @param   uOperation  Operation to execute.
    255255 * @param   pvArg       Argument.
    256256 */
    257 SUPR3DECL(int) SUPCallVMMR0(PVM pVM, unsigned uOperation, void *pvArg);
     257SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg);
    258258
    259259/**
     
    265265 *
    266266 * @returns error code specific to uFunction.
    267  * @param   pVM         Pointer to the Host Context mapping of the VM structure.
     267 * @param   pVMR0       Pointer to the Ring-0 (Host Context) mapping of the VM structure.
    268268 * @param   uOperation  Operation to execute.
    269269 * @param   pvArg       Pointer to argument structure or if cbArg is 0 just an value.
     
    272272 *                      being invalidated while we're executing the call.
    273273 */
    274 SUPR3DECL(int) SUPCallVMMR0Ex(PVM pVM, unsigned uOperation, void *pvArg, unsigned cbArg);
     274SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned uOperation, void *pvArg, unsigned cbArg);
    275275
    276276/**
     
    349349 * @returns NULL on failure.
    350350 * @param   cb          Number of bytes to allocate.
    351  * @param   ppvR0       Where to store the ring-0 mapping of the allocation. (optional)
     351 * @param   pR0Ptr      Where to store the ring-0 mapping of the allocation. (optional)
    352352 * @param   pHCPhys     Where to store the physical address of the memory block.
    353353 *
     
    356356 *          the world switchers.
    357357 */
    358 SUPR3DECL(void *) SUPContAlloc2(unsigned cb, void **ppvR0, PRTHCPHYS pHCPhys);
     358SUPR3DECL(void *) SUPContAlloc2(unsigned cb, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys);
    359359
    360360/**
     
    486486SUPR0DECL(int) SUPR0LockMem(PSUPDRVSESSION pSession, void *pvR3, unsigned cb, PSUPPAGE paPages);
    487487SUPR0DECL(int) SUPR0UnlockMem(PSUPDRVSESSION pSession, void *pvR3);
    488 SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, unsigned cb, void **ppvR0, void **ppvR3, PRTHCPHYS pHCPhys);
     488SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, unsigned cb, void **ppvR0, PRTR3PTR ppvR3, PRTHCPHYS pHCPhys);
    489489SUPR0DECL(int) SUPR0ContFree(PSUPDRVSESSION pSession, void *pv);
    490490SUPR0DECL(int) SUPR0LowAlloc(PSUPDRVSESSION pSession, unsigned cPages, void **ppvR3, PSUPPAGE paPages);
  • trunk/src/VBox/HostDrivers/Support/SUPDRVIOC.h

    r912 r914  
    300300{
    301301    /** The address of the ring-0 mapping of the allocated memory. */
    302     void       *pvR0;
     302    RTR0PTR     pvR0;
    303303    /** The address of the ring-3 mapping of the allocated memory. */
    304     void       *pvR3;
     304    RTR3PTR     pvR3;
    305305    /** The physical address of the allocation. */
    306306    RTHCPHYS    HCPhys;
     
    458458    uint32_t    u32SessionCookie;
    459459    /** The VM handle. */
    460     PVM         pVM;
     460    PVMR0       pVMR0;
    461461    /** Which operation to execute. */
    462462    uint32_t    uOperation;
  • trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c

    r679 r914  
    11451145             * Execute.
    11461146             */
    1147             pOut->rc = pDevExt->pfnVMMR0Entry(pIn->pVM, pIn->uOperation, pIn->pvArg);
     1147            pOut->rc = pDevExt->pfnVMMR0Entry(pIn->pVMR0, pIn->uOperation, pIn->pvArg);
    11481148            *pcbReturned = sizeof(*pOut);
    11491149            return 0;
     
    18371837 * @param   pHCPhys     Where to put the physical address of allocated memory.
    18381838 */
    1839 SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, unsigned cb, void **ppvR0, void **ppvR3, PRTHCPHYS pHCPhys)
     1839SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, unsigned cb, void **ppvR0, PRTR3PTR ppvR3, PRTHCPHYS pHCPhys)
    18401840{
    18411841    int             rc;
     
    28322832    *u.pb++ = 0xf8;
    28332833
    2834     /* 
     2834    /*
    28352835     * Call VMMR0Entry
    2836      *      We don't have to push the arguments here, but we have to 
     2836     *      We don't have to push the arguments here, but we have to
    28372837     *      reserve some stack space for the interrupt forwarding.
    28382838     */
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r874 r914  
    7979*   Structures and Typedefs                                                    *
    8080*******************************************************************************/
    81 typedef DECLCALLBACK(int) FNCALLVMMR0(PVM pVM, unsigned uOperation, void *pvArg);
     81typedef DECLCALLBACK(int) FNCALLVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg);
    8282typedef FNCALLVMMR0 *PFNCALLVMMR0;
    8383
     
    356356}
    357357
    358 SUPR3DECL(int) SUPCallVMMR0Ex(PVM pVM, unsigned uOperation, void *pvArg, unsigned cbArg)
     358SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned uOperation, void *pvArg, unsigned cbArg)
    359359{
    360360    /*
     
    364364    In.u32Cookie        = g_u32Cookie;
    365365    In.u32SessionCookie = g_u32SessionCookie;
    366     In.pVM              = pVM;
     366    In.pVMR0            = pVMR0;
    367367    In.uOperation       = uOperation;
    368368    In.cbArg            = cbArg;
     
    377377
    378378
    379 SUPR3DECL(int) SUPCallVMMR0(PVM pVM, unsigned uOperation, void *pvArg)
     379SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg)
    380380{
    381381#ifndef VBOX_WITHOUT_IDT_PATCHING
    382     return g_pfnCallVMMR0(pVM, uOperation, pvArg);
     382    return g_pfnCallVMMR0(pVMR0, uOperation, pvArg);
    383383
    384384#else
    385     if (uOperation == VMMR0_DO_RAW_RUN)
     385    if (RT_LIKELY(uOperation == VMMR0_DO_RAW_RUN))
    386386    {
    387387        Assert(!pvArg);
    388388        return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_RAW_RUN);
    389389    }
    390     if (uOperation == VMMR0_DO_HWACC_RUN)
     390    if (RT_LIKELY(uOperation == VMMR0_DO_HWACC_RUN))
    391391    {
    392392        Assert(!pvArg);
     
    398398        return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_NOP);
    399399    }
    400     return SUPCallVMMR0Ex(pVM, uOperation, pvArg, pvArg ? sizeof(pvArg) : 0);
     400    return SUPCallVMMR0Ex(pVMR0, uOperation, pvArg, pvArg ? sizeof(pvArg) : 0);
    401401#endif
    402402}
     
    478478SUPR3DECL(void *) SUPContAlloc(unsigned cb, PRTHCPHYS pHCPhys)
    479479{
    480     return SUPContAlloc2(cb, NULL, pHCPhys);
    481 }
    482 
    483 
    484 SUPR3DECL(void *) SUPContAlloc2(unsigned cb, void **ppvR0, PRTHCPHYS pHCPhys)
     480    return SUPContAlloc2(cb, NIL_RTR0PTR, pHCPhys);
     481}
     482
     483
     484SUPR3DECL(void *) SUPContAlloc2(unsigned cb, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys)
    485485{
    486486    /*
     
    490490    AssertPtr(pHCPhys);
    491491    *pHCPhys = NIL_RTHCPHYS;
     492    AssertPtrNull(pR0Ptr);
     493    if (pR0Ptr)
     494        *pR0Ptr = NIL_RTR0PTR;
    492495
    493496    /*
     
    506509        rc = SUPPageAlloc(In.cb >> PAGE_SHIFT, &Out.pvR3);
    507510        Out.HCPhys = (uintptr_t)Out.pvR3 + (PAGE_SHIFT * 1024);
    508         Out.pvR0 = Out.pvR3;
     511        Out.pvR0 = (uintptr_t)Out.pvR3;
    509512    }
    510513    if (VBOX_SUCCESS(rc))
    511514    {
    512515        *pHCPhys = (RTHCPHYS)Out.HCPhys;
    513         if (ppvR0)
    514             *ppvR0 = Out.pvR0;
     516        if (pR0Ptr)
     517            *pR0Ptr = Out.pvR0;
    515518        return Out.pvR3;
    516519    }
     
    717720     * reg params:
    718721     *      <GCC>   <MSC>   <argument>
    719      *      rdi     rcx     pVM
     722     *      rdi     rcx     pVMR0
    720723     *      esi     edx     uOperation
    721724     *      rdx     r8      pvArg
  • trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp

    r913 r914  
    8989            PVMR0 pVMR0;
    9090            RTHCPHYS HCPhysVM;
    91             PVM pVM = (PVM)SUPContAlloc2(sizeof(*pVM), (void **)&pVMR0, &HCPhysVM);
     91            PVM pVM = (PVM)SUPContAlloc2(sizeof(*pVM), &pVMR0, &HCPhysVM);
    9292            if (pVM)
    9393            {
    9494                pVM->pVMGC = 0;
    95                 pVM->pVMHC = pVM;
     95                pVM->pVMR3 = pVM;
     96                pVM->pVMR0 = pVMR0;
    9697                pVM->HCPhysVM = HCPhysVM;
    9798                pVM->pSession = pSession;
     
    108109                    for (i = cIterations; i > 0; i--)
    109110                    {
    110                         rc = SUPCallVMMR0((PVM)pVMR0, VMMR0_DO_NOP, NULL);
     111                        rc = SUPCallVMMR0(pVMR0, VMMR0_DO_NOP, NULL);
    111112                        if (rc != VINF_SUCCESS)
    112113                        {
     
    130131                        {
    131132                            uint64_t OneStartTick = ASMReadTSC();
    132                             rc = SUPCallVMMR0((PVM)pVMR0, VMMR0_DO_NOP, NULL);
     133                            rc = SUPCallVMMR0(pVMR0, VMMR0_DO_NOP, NULL);
    133134                            uint64_t Ticks = ASMReadTSC() - OneStartTick;
    134135                            if (Ticks < MinTicks)
  • trunk/src/VBox/VMM/HWACCM.cpp

    r771 r914  
    292292            pVM->hwaccm.s.fInitialized = true;
    293293
    294             int rc = SUPCallVMMR0(pVM, VMMR0_DO_HWACC_SETUP_VM, NULL);
     294            int rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_HWACC_SETUP_VM, NULL);
    295295            AssertRC(rc);
    296296            if (rc == VINF_SUCCESS)
     
    324324            pVM->hwaccm.s.fInitialized = true;
    325325
    326             int rc = SUPCallVMMR0(pVM, VMMR0_DO_HWACC_SETUP_VM, NULL);
     326            int rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_HWACC_SETUP_VM, NULL);
    327327            AssertRC(rc);
    328328            if (rc == VINF_SUCCESS)
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r23 r914  
    961961    if (    uOperation >= VMMR0_DO_SRV_START
    962962        &&  uOperation <  VMMR0_DO_SRV_END)
    963         rc = SUPCallVMMR0Ex(pDrvIns->Internal.s.pVM, uOperation, pvArg, cbArg);
     963        rc = SUPCallVMMR0Ex(pDrvIns->Internal.s.pVM->pVMR0, uOperation, pvArg, cbArg);
    964964    else
    965965    {
  • trunk/src/VBox/VMM/PDMLdr.cpp

    r48 r914  
    2020 */
    2121
    22 #if defined(__DARWIN__) ||defined(__OS2__)
     22#if defined(__OS2__)
    2323# define PDMLDR_FAKE_MODE
    2424#endif
  • trunk/src/VBox/VMM/PGMMap.cpp

    r838 r914  
    455455 * @returns VBox status code.
    456456 * @param   pVM         The virtual machine.
    457  * @param   pvAddr      Intermediate context address of the mapping. This must be entriely below 4GB!
     457 * @param   Addr        Intermediate context address of the mapping.
    458458 * @param   HCPhys      Start of the range of physical pages. This must be entriely below 4GB!
    459459 * @param   cbPages     Number of bytes to map.
    460460 *
    461461 * @remark  This API shall not be used to anything but mapping the switcher code.
    462  * @todo pvAddr must be a RTUINTPTR!
    463  */
    464 PGMR3DECL(int) PGMR3MapIntermediate(PVM pVM, void *pvAddr, RTHCPHYS HCPhys, unsigned cbPages)
    465 {
    466     LogFlow(("PGMR3MapIntermediate: pvAddr=%p HCPhys=%VHp cbPages=%#x\n", pvAddr, HCPhys, cbPages));
     462 */
     463PGMR3DECL(int) PGMR3MapIntermediate(PVM pVM, RTUINTPTR Addr, RTHCPHYS HCPhys, unsigned cbPages)
     464{
     465    LogFlow(("PGMR3MapIntermediate: Addr=%RTptr HCPhys=%VHp cbPages=%#x\n", Addr, HCPhys, cbPages));
    467466
    468467    /*
     
    472471    cbPages  = RT_ALIGN(cbPages, PAGE_SIZE);
    473472    HCPhys  &= X86_PTE_PAE_PG_MASK;
    474     pvAddr   = (void *)((RTUINTPTR)pvAddr & PAGE_BASE_MASK);
     473    Addr    &= PAGE_BASE_MASK;
    475474    /* We only care about the first 4GB, because on AMD64 we'll be repeating them all over the address space. */
    476     uint32_t uAddress = (uint32_t)(uintptr_t)pvAddr;
     475    uint32_t uAddress = (uint32_t)Addr;
    477476
    478477    /*
     
    482481    AssertMsg(pVM->pgm.s.pInterPD, ("Bad init order, paging.\n"));
    483482    AssertMsg(cbPages <= (512 << PAGE_SHIFT), ("The mapping is too big %d bytes\n", cbPages));
    484     AssertMsg(HCPhys < _4G && HCPhys + cbPages < _4G, ("pvAddr=%p HCPhys=%VHp cbPages=%d\n", pvAddr, HCPhys, cbPages));
     483    AssertMsg(HCPhys < _4G && HCPhys + cbPages < _4G, ("Addr=%RTptr HCPhys=%VHp cbPages=%d\n", Addr, HCPhys, cbPages));
    485484
    486485    /*
     
    494493       )
    495494    {
    496         AssertMsgFailed(("pvAddr=%p HCPhys=%VHp cbPages=%d\n", pvAddr, HCPhys, cbPages));
    497         LogRel(("pvAddr=%p HCPhys=%VHp cbPages=%d\n", pvAddr, HCPhys, cbPages));
     495        AssertMsgFailed(("Addr=%RTptr HCPhys=%VHp cbPages=%d\n", Addr, HCPhys, cbPages));
     496        LogRel(("Addr=%RTptr HCPhys=%VHp cbPages=%d\n", Addr, HCPhys, cbPages));
    498497        return VERR_PGM_MAPPINGS_FIX_CONFLICT; /** @todo new error code */
    499498    }
  • trunk/src/VBox/VMM/VM.cpp

    r872 r914  
    188188         */
    189189        RTHCPHYS HCPhysVM;
    190         PVM pVM = (PVM)SUPContAlloc(RT_ALIGN_Z(sizeof(*pVM), PAGE_SIZE), &HCPhysVM);
     190        PVMR0 pVMR0;
     191        PVM pVM = (PVM)SUPContAlloc2(RT_ALIGN_Z(sizeof(*pVM), PAGE_SIZE), &pVMR0, &HCPhysVM);
    191192        if (pVM)
    192193        {
     
    198199            memset(pVM, 0, sizeof(*pVM));
    199200            pVM->pVMHC = pVM;
     201            pVM->pVMR0 = pVMR0;
     202            pVM->pVMR3 = pVM;
    200203            pVM->HCPhysVM = HCPhysVM;
    201204            pVM->pSession = pSession;
     
    10021005    if (pVM->vm.s.fPreventSaveState)
    10031006    {
    1004         LogRel(("VMM: vmR3Save: saving the VM state is not allowed at this moment\n")); 
    1005         return VERR_VM_SAVE_STATE_NOT_ALLOWED; 
     1007        LogRel(("VMM: vmR3Save: saving the VM state is not allowed at this moment\n"));
     1008        return VERR_VM_SAVE_STATE_NOT_ALLOWED;
    10061009    }
    10071010
     
    11731176     * ACPI and we find the VMSTATE_OFF. Just ignore the second power-off request.
    11741177     */
    1175     /** @todo r=bird: We should find a proper solution to this problem. This is just a workaround. 
     1178    /** @todo r=bird: We should find a proper solution to this problem. This is just a workaround.
    11761179     * Guest code should really run after we've entered VMSTATE_OFF really... */
    11771180    if (pVM->enmVMState == VMSTATE_OFF)
     
    27072710 */
    27082711static void vmR3SetRuntimeErrorWorkerDoCall(PVM pVM, PVMATRUNTIMEERROR pCur, bool fFatal,
    2709                                             const char *pszErrorID, 
     2712                                            const char *pszErrorID,
    27102713                                            const char *pszFormat, ...)
    27112714{
  • trunk/src/VBox/VMM/VMM.cpp

    r873 r914  
    246246            struct
    247247            {
    248                 void *pvR0;
    249                 void *pvR3;
     248                RTR0PTR  pvR0;
     249                void    *pvR3;
    250250                RTHCPHYS HCPhys;
    251251            } aBadTries[16];
     
    360360        AssertMsgRCReturn(rc, ("Configuration error. Failed to query \"YieldEMTInterval\", rc=%Vrc\n", rc), rc);
    361361
     362    /* GC switchers are enabled by default. Turned off by HWACCM. */
     363    pVM->vmm.s.fSwitcherDisabled = false;
     364
    362365    /*
    363366     * Register the saved state data unit.
     
    369372        return rc;
    370373
    371     /* GC switchers are enabled by default. Turned off by HWACCM. */
    372     pVM->vmm.s.fSwitcherDisabled = false;
     374#ifdef VBOX_WITHOUT_IDT_PATCHING
     375    /*
     376     * Register the Ring-0 VM handle with the session for fast ioctl calls.
     377     */
     378    rc = SUPSetVMForFastIOCtl(pVM->pVMR0);
     379    if (VBOX_FAILURE(rc))
     380        return rc;
     381#endif
    373382
    374383    /*
     
    615624        rc = VINF_SUCCESS;
    616625#else
    617         rc = SUPCallVMMR0(pVM, VMMR0_DO_VMMR0_INIT, (void *)VBOX_VERSION);
     626        rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_VMMR0_INIT, (void *)VBOX_VERSION);
    618627#endif
    619628        if (    pVM->vmm.s.pR0Logger
     
    675684            rc = VINF_SUCCESS;
    676685#else
    677             rc = SUPCallVMMR0(pVM, VMMR0_DO_CALL_HYPERVISOR, NULL);
     686            rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_CALL_HYPERVISOR, NULL);
    678687#endif
    679688#ifdef LOG_ENABLED
     
    10451054                uint32_t offCPUM = *u.pu32++;
    10461055                Assert(offCPUM < sizeof(pVM->cpum));
    1047                 *uSrc.pu32 = (uint32_t)((uintptr_t)&pVM->cpum + offCPUM);
    1048                 break;
    1049             }
    1050 
    1051             /*
    1052              * Make 32-bit HC pointer given VM offset.
     1056                *uSrc.pu32 = (uint32_t)pVM->pVMR0 + RT_OFFSETOF(VM, cpum) + offCPUM;
     1057                break;
     1058            }
     1059
     1060            /*
     1061             * Make 32-bit R0 pointer given VM offset.
    10531062             */
    10541063            case FIX_HC_VM_OFF:
     
    10561065                uint32_t offVM = *u.pu32++;
    10571066                Assert(offVM < sizeof(VM));
    1058                 *uSrc.pu32 = (uint32_t)(uintptr_t)pVM + offVM;
     1067                *uSrc.pu32 = (uint32_t)pVM->pVMR0 + offVM;
    10591068                break;
    10601069            }
     
    12401249            {
    12411250                Assert(offSrc < pSwitcher->cbCode);
    1242                 *uSrc.pu64 = (uintptr_t)&pVM->cpum;
     1251                *uSrc.pu64 = pVM->pVMR0 + RT_OFFSETOF(VM, cpum);
    12431252                break;
    12441253            }
     
    18341843            rc = VERR_GENERAL_FAILURE;
    18351844#else
    1836             rc = SUPCallVMMR0(pVM, VMMR0_DO_RAW_RUN, NULL);
     1845            rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
    18371846#endif
    18381847        } while (rc == VINF_EM_RAW_INTERRUPT_HYPER);
     
    18821891            rc = VERR_GENERAL_FAILURE;
    18831892#else
    1884             rc = SUPCallVMMR0(pVM, VMMR0_DO_HWACC_RUN, NULL);
     1893            rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_HWACC_RUN, NULL);
    18851894#endif
    18861895        } while (rc == VINF_EM_RAW_INTERRUPT_HYPER);
     
    19631972            rc = VERR_GENERAL_FAILURE;
    19641973#else
    1965             rc = SUPCallVMMR0(pVM, VMMR0_DO_RAW_RUN, NULL);
     1974            rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
    19661975#endif
    19671976        } while (rc == VINF_EM_RAW_INTERRUPT_HYPER);
     
    20172026            rc = VERR_GENERAL_FAILURE;
    20182027#else
    2019             rc = SUPCallVMMR0(pVM, VMMR0_DO_RAW_RUN, NULL);
     2028            rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
    20202029#endif
    20212030        } while (rc == VINF_EM_RAW_INTERRUPT_HYPER);
     
    25442553    CPUMPushHyper(pVM, GCPtrEP);                /* what to call */
    25452554    CPUMSetHyperEIP(pVM, pVM->vmm.s.pfnGCCallTrampoline);
    2546     return SUPCallVMMR0(pVM, VMMR0_DO_RAW_RUN, NULL);
     2555    return SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
    25472556}
    25482557
     
    25782587    CPUMPushHyper(pVM, GCPtrEP);                /* what to call */
    25792588    CPUMSetHyperEIP(pVM, pVM->vmm.s.pfnGCCallTrampoline);
    2580     rc = SUPCallVMMR0(pVM, VMMR0_DO_RAW_RUN, NULL);
     2589    rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
    25812590    bool fDump = false;
    25822591    if (rc != rcExpect)
     
    26562665    {
    26572666        RTPrintf("VMM: VMMGCEntry=%VGv\n", GCPtrEP);
    2658        
     2667
    26592668        /*
    26602669         * Test various crashes which we must be able to recover from.
     
    28182827        do
    28192828        {
    2820             rc = SUPCallVMMR0(pVM, VMMR0_DO_RAW_RUN, NULL);
     2829            rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
    28212830            if (VBOX_FAILURE(rc))
    28222831            {
     
    28692878
    28702879            uint64_t TickThisStart = ASMReadTSC();
    2871             rc = SUPCallVMMR0(pVM, VMMR0_DO_RAW_RUN, NULL);
     2880            rc = SUPCallVMMR0(pVM->pVMR0, VMMR0_DO_RAW_RUN, NULL);
    28722881            uint64_t TickThisElapsed = ASMReadTSC() - TickThisStart;
    28732882            if (VBOX_FAILURE(rc))
  • trunk/src/VBox/VMM/VMMInternal.h

    r847 r914  
    110110    uint32_t    eip;
    111111    uint32_t    u32Padding;
    112 #endif 
     112#endif
    113113#if HC_ARCH_BITS == 64
    114114    uint64_t    rbx;
    115115# ifdef __WIN__
    116     uint64_t    rsi;           
    117     uint64_t    rdi;           
     116    uint64_t    rsi;
     117    uint64_t    rdi;
    118118# endif
    119119    uint64_t    rbp;
     
    124124    uint64_t    rsp;
    125125    uint64_t    rip;
    126 #endif 
     126#endif
    127127    /** @} */
    128128
     
    157157    /** Pointer to core code ring-3 mapping - contiguous memory.
    158158     * At present this only means the context switcher code. */
    159     RTHCPTR                     pvHCCoreCodeR3;
     159    RTR3PTR                     pvHCCoreCodeR3;
    160160    /** Pointer to core code ring-0 mapping - contiguous memory.
    161161     * At present this only means the context switcher code. */
    162     RTHCPTR                     pvHCCoreCodeR0;
     162    RTR0PTR                     pvHCCoreCodeR0;
    163163    /** Pointer to core code guest context mapping. */
    164164    RTGCPTR                     pvGCCoreCode;
     
    250250    VMMR0JMPBUF                 CallHostR0JmpBuf;
    251251    /** @} */
    252    
     252
    253253    /** Number of VMMR0_DO_RUN_GC calls. */
    254254    STAMCOUNTER                 StatRunGC;
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r848 r914  
    137137             || VBOX_GET_VERSION_MINOR(uVersion) < VBOX_VERSION_MINOR))
    138138        return VERR_VERSION_MISMATCH;
     139    if (    !VALID_PTR(pVM)
     140        ||  pVM->pVMR0 != pVM)
     141        return VERR_INVALID_PARAMETER;
    139142
    140143    /*
     
    449452#else
    450453                    return rc;
    451 #endif 
     454#endif
    452455
    453456                /*
     
    461464                    TRPMR0DispatchHostInterrupt(pVM);
    462465#else /* !VBOX_WITHOUT_IDT_PATCHING */
    463                     /* 
     466                    /*
    464467                     * Don't trust the compiler to get this right.
    465                      * gcc -fomit-frame-pointer screws up big time here. This works fine in 64-bit 
     468                     * gcc -fomit-frame-pointer screws up big time here. This works fine in 64-bit
    466469                     * mode too because we push the arguments on the stack in the IDT patch code.
    467470                     */
     
    475478#  error "huh?"
    476479# endif
    477                     if (    ((uintptr_t *)pvRet)[1] == (uintptr_t)pVM 
     480                    if (    ((uintptr_t *)pvRet)[1] == (uintptr_t)pVM
    478481                        &&  ((uintptr_t *)pvRet)[2] == (uintptr_t)uOperation
    479482                        &&  ((uintptr_t *)pvRet)[3] == (uintptr_t)pvArg)
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