VirtualBox

Changeset 397 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Jan 28, 2007 2:34:06 AM (18 years ago)
Author:
vboxsync
Message:

Completed most of VBOX_WITHOUT_IDT_PATCHING. (hope I didn't break anything...) TODO: IST support on AMD64.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDRVIOC.h

    r42 r397  
    132132#define SUP_IOCTL_SET_VM_FOR_FAST   SUP_CTL_CODE(20)
    133133
    134 /** Fast path IOCtl: VMMR0_DO_RUN_GC */
     134/** Fast path IOCtl: VMMR0_DO_RAW_RUN */
    135135#define SUP_IOCTL_FAST_DO_RAW_RUN   SUP_CTL_CODE_FAST(64)
    136 /** Fast path IOCtl: VMMR0_HWACC_RUN_GUEST */
     136/** Fast path IOCtl: VMMR0_DO_HWACC_RUN */
    137137#define SUP_IOCTL_FAST_DO_HWACC_RUN SUP_CTL_CODE_FAST(65)
     138/** Just a NOP call for profiling the latency of a fast ioctl call to VMMR0. */
     139#define SUP_IOCTL_FAST_DO_NOP       SUP_CTL_CODE_FAST(66)
    138140
    139141
  • trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c

    r392 r397  
    559559int  VBOXCALL   supdrvIOCtlFast(unsigned uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession)
    560560{
    561     if (    !pSession->pVM
    562         ||  pDevExt->pfnVMMR0Entry)
    563         return VERR_INTERNAL_ERROR;
    564     switch (uIOCtl)
    565     {
    566         case SUP_IOCTL_FAST_DO_RAW_RUN:
    567             return pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_DO_RUN_GC, NULL);
    568         case SUP_IOCTL_FAST_DO_HWACC_RUN:
    569             return pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_HWACC_RUN_GUEST, NULL);
    570         default:
    571             return VERR_INTERNAL_ERROR;
    572     }
     561    /*
     562     * Disable interrupts before invoking VMMR0Entry() because it ASSUMES
     563     * that interrupts are disabled. (We check the two prereqs after doing
     564     * this only to allow the compiler to optimize things better.)
     565     */
     566    RTCCUINTREG     uFlags = ASMGetFlags();
     567    ASMIntDisable();
     568
     569    int rc;
     570    if (RT_LIKELY(pSession->pVM && pDevExt->pfnVMMR0Entry))
     571    {
     572        switch (uIOCtl)
     573        {
     574            case SUP_IOCTL_FAST_DO_RAW_RUN:
     575                rc = pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_DO_RAW_RUN, NULL);
     576                break;
     577            case SUP_IOCTL_FAST_DO_HWACC_RUN:
     578                rc = pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_DO_HWACC_RUN, NULL);
     579                break;
     580            case SUP_IOCTL_FAST_DO_NOP:
     581                rc = pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_DO_NOP, NULL);
     582                break;
     583            default:
     584                rc = VERR_INTERNAL_ERROR;
     585                break;
     586        }
     587    }
     588    else
     589        rc = VERR_INTERNAL_ERROR;
     590
     591    ASMSetFlags(uFlags);
     592    return rc;
    573593}
    574594#endif /* VBOX_WITHOUT_IDT_PATCHING */
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r339 r397  
    381381#ifndef VBOX_WITHOUT_IDT_PATCHING
    382382    return g_pfnCallVMMR0(pVM, uOperation, pvArg);
     383
    383384#else
    384     if (uOperation == VMMR0_DO_RUN_GC)
     385    if (uOperation == VMMR0_DO_RAW_RUN)
    385386    {
    386387        Assert(!pvArg);
    387388        return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_RAW_RUN);
    388389    }
    389     if (uOperation == VMMR0_HWACC_RUN_GUEST)
     390    if (uOperation == VMMR0_DO_HWACC_RUN)
    390391    {
    391392        Assert(!pvArg);
    392393        return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_HWACC_RUN);
     394    }
     395    if (uOperation == VMMR0_DO_NOP)
     396    {
     397        Assert(!pvArg);
     398        return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_NOP);
    393399    }
    394400    return SUPCallVMMR0Ex(pVM, uOperation, pvArg, pvArg ? sizeof(pvArg) : 0);
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r387 r397  
    430430     * the session and iCmd, and only returns a VBox status code.
    431431     */
    432     if (    iCmd == 1
    433         ||  iCmd == 1)
     432    if (    iCmd == SUP_IOCTL_FAST_DO_RAW_RUN
     433        ||  iCmd == SUP_IOCTL_FAST_DO_HWACC_RUN
     434        ||  iCmd == SUP_IOCTL_FAST_DO_NOP)
    434435        return supdrvIOCtlFast(iCmd, &g_DevExt, pSession);
    435436    return VBoxSupDrvIOCtlSlow(pSession, iCmd, pData, pProcess);
  • trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp

    r1 r397  
    8989            for (int i = cIterations; i > 0; i--)
    9090            {
    91                 rc = SUPCallVMMR0(&vm, 0xdeadbeef, NULL);
    92                 //RTPrintf("tstInt: SUPCallVMMR0 -> rc=%Vrc i=%d\n", rc, i);
     91                rc = SUPCallVMMR0(&vm, VMMR0_DO_NOP, NULL);
     92                if (rc != VINF_SUCCESS)
     93                {
     94                    RTPrintf("tstInt: SUPCallVMMR0 -> rc=%Vrc i=%d Expected VINF_SUCCESS!\n", rc, i);
     95                    break;s
     96                }
    9397            }
    9498            RTPrintf("tstInt: Performed SUPCallVMMR0 %d times (rc=%Vrc)\n", cIterations, 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