VirtualBox

Changeset 19454 in vbox for trunk/include/VBox


Ignore:
Timestamp:
May 6, 2009 7:20:18 PM (16 years ago)
Author:
vboxsync
Message:

VMM++: More on poking. Fixed broken R0 stats (wrong way of calling into VMMR0), use NIL_VMCPUID instead of 0 to VMMR0EntryEx when it is supposed to be irrellevant. Use VMCPUID. Allow for and check NIL_VMCPUID. Fixed a few missing/wrong idCpu checks (paranoia mostly).

Location:
trunk/include/VBox
Files:
6 edited

Legend:

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

    r19381 r19454  
    266266GMMR0DECL(void) GMMR0InitPerVMData(PGVM pGVM);
    267267GMMR0DECL(void) GMMR0CleanupVM(PGVM pGVM);
    268 GMMR0DECL(int)  GMMR0InitialReservation(PVM pVM, unsigned idCpu, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages,
     268GMMR0DECL(int)  GMMR0InitialReservation(PVM pVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages,
    269269                                        GMMOCPOLICY enmPolicy, GMMPRIORITY enmPriority);
    270 GMMR0DECL(int)  GMMR0UpdateReservation(PVM pVM, unsigned idCpu, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages);
    271 GMMR0DECL(int)  GMMR0AllocateHandyPages(PVM pVM, unsigned idCpu, uint32_t cPagesToUpdate, uint32_t cPagesToAlloc, PGMMPAGEDESC paPages);
    272 GMMR0DECL(int)  GMMR0AllocatePages(PVM pVM, unsigned idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount);
    273 GMMR0DECL(int)  GMMR0FreePages(PVM pVM, unsigned idCpu, uint32_t cPages, PGMMFREEPAGEDESC paPages, GMMACCOUNT enmAccount);
    274 GMMR0DECL(int)  GMMR0BalloonedPages(PVM pVM, unsigned idCpu, uint32_t cBalloonedPages, uint32_t cPagesToFree, PGMMFREEPAGEDESC paPages, bool fCompleted);
    275 GMMR0DECL(int)  GMMR0DeflatedBalloon(PVM pVM, unsigned idCpu, uint32_t cPages);
    276 GMMR0DECL(int)  GMMR0MapUnmapChunk(PVM pVM, unsigned idCpu, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3);
    277 GMMR0DECL(int)  GMMR0SeedChunk(PVM pVM, unsigned idCpu, RTR3PTR pvR3);
     270GMMR0DECL(int)  GMMR0UpdateReservation(PVM pVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages);
     271GMMR0DECL(int)  GMMR0AllocateHandyPages(PVM pVM, VMCPUID idCpu, uint32_t cPagesToUpdate, uint32_t cPagesToAlloc, PGMMPAGEDESC paPages);
     272GMMR0DECL(int)  GMMR0AllocatePages(PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount);
     273GMMR0DECL(int)  GMMR0FreePages(PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMFREEPAGEDESC paPages, GMMACCOUNT enmAccount);
     274GMMR0DECL(int)  GMMR0BalloonedPages(PVM pVM, VMCPUID idCpu, uint32_t cBalloonedPages, uint32_t cPagesToFree, PGMMFREEPAGEDESC paPages, bool fCompleted);
     275GMMR0DECL(int)  GMMR0DeflatedBalloon(PVM pVM, VMCPUID idCpu, uint32_t cPages);
     276GMMR0DECL(int)  GMMR0MapUnmapChunk(PVM pVM, VMCPUID idCpu, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3);
     277GMMR0DECL(int)  GMMR0SeedChunk(PVM pVM, VMCPUID idCpu, RTR3PTR pvR3);
    278278
    279279
     
    296296typedef GMMINITIALRESERVATIONREQ *PGMMINITIALRESERVATIONREQ;
    297297
    298 GMMR0DECL(int)  GMMR0InitialReservationReq(PVM pVM, unsigned idCpu, PGMMINITIALRESERVATIONREQ pReq);
     298GMMR0DECL(int)  GMMR0InitialReservationReq(PVM pVM, VMCPUID idCpu, PGMMINITIALRESERVATIONREQ pReq);
    299299
    300300
     
    314314typedef GMMUPDATERESERVATIONREQ *PGMMUPDATERESERVATIONREQ;
    315315
    316 GMMR0DECL(int)  GMMR0UpdateReservationReq(PVM pVM, unsigned idCpu, PGMMUPDATERESERVATIONREQ pReq);
     316GMMR0DECL(int)  GMMR0UpdateReservationReq(PVM pVM, VMCPUID idCpu, PGMMUPDATERESERVATIONREQ pReq);
    317317
    318318
     
    335335typedef GMMALLOCATEPAGESREQ *PGMMALLOCATEPAGESREQ;
    336336
    337 GMMR0DECL(int)  GMMR0AllocatePagesReq(PVM pVM, unsigned idCpu, PGMMALLOCATEPAGESREQ pReq);
     337GMMR0DECL(int)  GMMR0AllocatePagesReq(PVM pVM, VMCPUID idCpu, PGMMALLOCATEPAGESREQ pReq);
    338338
    339339
     
    356356typedef GMMFREEPAGESREQ *PGMMFREEPAGESREQ;
    357357
    358 GMMR0DECL(int)  GMMR0FreePagesReq(PVM pVM, unsigned idCpu, PGMMFREEPAGESREQ pReq);
     358GMMR0DECL(int)  GMMR0FreePagesReq(PVM pVM, VMCPUID idCpu, PGMMFREEPAGESREQ pReq);
    359359
    360360
     
    379379typedef GMMBALLOONEDPAGESREQ *PGMMBALLOONEDPAGESREQ;
    380380
    381 GMMR0DECL(int)  GMMR0BalloonedPagesReq(PVM pVM, unsigned idCpu, PGMMBALLOONEDPAGESREQ pReq);
     381GMMR0DECL(int)  GMMR0BalloonedPagesReq(PVM pVM, VMCPUID idCpu, PGMMBALLOONEDPAGESREQ pReq);
    382382
    383383
     
    400400typedef GMMMAPUNMAPCHUNKREQ *PGMMMAPUNMAPCHUNKREQ;
    401401
    402 GMMR0DECL(int)  GMMR0MapUnmapChunkReq(PVM pVM, unsigned idCpu, PGMMMAPUNMAPCHUNKREQ pReq);
     402GMMR0DECL(int)  GMMR0MapUnmapChunkReq(PVM pVM, VMCPUID idCpu, PGMMMAPUNMAPCHUNKREQ pReq);
    403403
    404404
  • trunk/include/VBox/gvmm.h

    r19406 r19454  
    8383    /** The number of calls to GVMMR0WakeUp. */
    8484    uint64_t        cWakeUpCalls;
    85     /** The number of times the EMT thread wasn't actually halted when GVMMR0WakeUp was called. */
     85    /** The number of times the EMT thread wasn't actually halted when GVMMR0WakeUp
     86     *  was called. */
    8687    uint64_t        cWakeUpNotHalted;
    87     /** The number of wake ups done during GVMMR0WakeUp (not counting the explicit one). */
     88    /** The number of wake ups done during GVMMR0WakeUp (not counting the explicit
     89     *  one). */
    8890    uint64_t        cWakeUpWakeUps;
     91
     92    /** The number of calls to GVMMR0Poke. */
     93    uint64_t        cPokeCalls;
     94    /** The number of times the EMT thread wasn't actually busy when
     95     *  GVMMR0Poke was called. */
     96    uint64_t        cPokeNotBusy;
    8997
    9098    /** The number of calls to GVMMR0SchedPoll. */
  • trunk/include/VBox/sup.h

    r19257 r19454  
    447447 * @returns error code specific to uFunction.
    448448 * @param   pVMR0       Pointer to the Ring-0 (Host Context) mapping of the VM structure.
    449  * @param   idCpu       VMCPU id.
     449 * @param   idCpu       The virtual CPU ID.
    450450 * @param   uOperation  Operation to execute.
    451451 * @param   pvArg       Argument.
    452452 */
    453 SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned idCpu, unsigned uOperation, void *pvArg);
     453SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, void *pvArg);
    454454
    455455/**
     
    460460 * @param   pVMR0       The ring-0 VM handle.
    461461 * @param   uOperation  The operation; only the SUP_VMMR0_DO_* ones are valid.
    462  * @param   idCpu       VMCPU id.
    463  */
    464 SUPR3DECL(int) SUPCallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, unsigned idCpu);
     462 * @param   idCpu       The virtual CPU ID.
     463 */
     464SUPR3DECL(int) SUPCallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu);
    465465
    466466/**
     
    473473 * @returns error code specific to uFunction.
    474474 * @param   pVMR0       Pointer to the Ring-0 (Host Context) mapping of the VM structure.
    475  * @param   idCpu       VMCPU id.
     475 * @param   idCpu       The virtual CPU ID.
    476476 * @param   uOperation  Operation to execute.
    477477 * @param   u64Arg      Constant argument.
     
    480480 *                      limit on this, just below 4KB.
    481481 */
    482 SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr);
     482SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr);
    483483
    484484/**
  • trunk/include/VBox/vm.h

    r19435 r19454  
    106106    /** The native thread handle. */
    107107    RTNATIVETHREAD          hNativeThread;
     108    /** Which host CPU ID is this EMT running on.
     109     * Only valid when in RC or HWACCMR0 with scheduling disabled. */
     110    RTCPUID volatile        idHostCpu;
    108111
    109112    /** Align the next bit on a 64-byte boundary.
     
    114117     *          following it (to grow into and align the struct size).
    115118     *   */
    116     uint32_t                au32Alignment[HC_ARCH_BITS == 32 ? 8 : 4];
     119    uint32_t                au32Alignment[HC_ARCH_BITS == 32 ? 7 : 3];
    117120
    118121    /** CPUM part. */
  • trunk/include/VBox/vm.mac

    r19217 r19454  
    4747; This is part of  the VM structure.
    4848struc VM
    49     .enmVMState         resd 1
    50     .fGlobalForcedActions resd 1
    51     .paVMPagesR3        RTR3PTR_RES 1
    52     .pSession           RTR0PTR_RES 1
    53     .pUVM               RTR3PTR_RES 1
    54     .pVMR3              RTR3PTR_RES 1
    55     .pVMR0              RTR0PTR_RES 1
    56     .pVMRC              RTRCPTR_RES 1
    57     .hSelf              resd 1
    58     .cCPUs              resd 1
    59     .cbSelf             resd 1
    60     .offVMCPU           resd 1
    61     .u32Reserved        resd 6
     49    .enmVMState             resd 1
     50    .fGlobalForcedActions   resd 1
     51    .paVMPagesR3            RTR3PTR_RES 1
     52    .pSession               RTR0PTR_RES 1
     53    .pUVM                   RTR3PTR_RES 1
     54    .pVMR3                  RTR3PTR_RES 1
     55    .pVMR0                  RTR0PTR_RES 1
     56    .pVMRC                  RTRCPTR_RES 1
     57    .hSelf                  resd 1
     58    .cCPUs                  resd 1
     59    .cbSelf                 resd 1
     60    .offVMCPU               resd 1
     61    .u32Reserved            resd 6
    6262
    6363    .pfnVMMGCGuestToHostAsmGuestCtx RTRCPTR_RES 1
     
    6565    .pfnVMMGCGuestToHostAsm         RTRCPTR_RES 1
    6666
    67     .uPadding1          RTHCPTR_RES 1
    68     .uPadding2          RTHCPTR_RES 1
     67    .uPadding1              RTHCPTR_RES 1
     68    .uPadding2              RTHCPTR_RES 1
    6969
    70     .fRawR3Enabled      resb 1
    71     .fRawR0Enabled      resb 1
    72     .fPATMEnabled       resb 1
    73     .fCSAMEnabled       resb 1
    74     .fHWACCMEnabled     resb 1
    75     .fHwVirtExtForced   resb 1
    76     .fPARAVEnabled      resb 1
     70    .fRawR3Enabled          resb 1
     71    .fRawR0Enabled          resb 1
     72    .fPATMEnabled           resb 1
     73    .fCSAMEnabled           resb 1
     74    .fHWACCMEnabled         resb 1
     75    .fHwVirtExtForced       resb 1
     76    .fPARAVEnabled          resb 1
    7777
    7878    alignb 8
    7979
    80     .StatTotalQemuToGC  resb STAMPROFILEADV_size
    81     .StatTotalGCToQemu  resb STAMPROFILEADV_size
    82     .StatTotalInGC      resb STAMPROFILEADV_size
    83     .StatTotalInQemu    resb STAMPROFILEADV_size
    84     .StatSwitcherToGC   resb STAMPROFILEADV_size
    85     .StatSwitcherToHC   resb STAMPROFILEADV_size
    86     .StatSwitcherSaveRegs resb STAMPROFILEADV_size
    87     .StatSwitcherSysEnter resb STAMPROFILEADV_size
    88     .StatSwitcherDebug    resb STAMPROFILEADV_size
    89     .StatSwitcherCR0      resb STAMPROFILEADV_size
    90     .StatSwitcherCR4      resb STAMPROFILEADV_size
    91     .StatSwitcherJmpCR3   resb STAMPROFILEADV_size
    92     .StatSwitcherRstrRegs resb STAMPROFILEADV_size
    93     .StatSwitcherLgdt     resb STAMPROFILEADV_size
    94     .StatSwitcherLidt     resb STAMPROFILEADV_size
    95     .StatSwitcherLldt     resb STAMPROFILEADV_size
    96     .StatSwitcherTSS      resb STAMPROFILEADV_size
     80    .StatTotalQemuToGC      resb STAMPROFILEADV_size
     81    .StatTotalGCToQemu      resb STAMPROFILEADV_size
     82    .StatTotalInGC          resb STAMPROFILEADV_size
     83    .StatTotalInQemu        resb STAMPROFILEADV_size
     84    .StatSwitcherToGC       resb STAMPROFILEADV_size
     85    .StatSwitcherToHC       resb STAMPROFILEADV_size
     86    .StatSwitcherSaveRegs   resb STAMPROFILEADV_size
     87    .StatSwitcherSysEnter   resb STAMPROFILEADV_size
     88    .StatSwitcherDebug      resb STAMPROFILEADV_size
     89    .StatSwitcherCR0        resb STAMPROFILEADV_size
     90    .StatSwitcherCR4        resb STAMPROFILEADV_size
     91    .StatSwitcherJmpCR3     resb STAMPROFILEADV_size
     92    .StatSwitcherRstrRegs   resb STAMPROFILEADV_size
     93    .StatSwitcherLgdt       resb STAMPROFILEADV_size
     94    .StatSwitcherLidt       resb STAMPROFILEADV_size
     95    .StatSwitcherLldt       resb STAMPROFILEADV_size
     96    .StatSwitcherTSS        resb STAMPROFILEADV_size
    9797
    9898    alignb 64
    99     .cpum                 resb 2048
    100     .vmm                  resb 1024
     99    .cpum                   resb 2048
     100    .vmm                    resb 1024
    101101
    102102endstruc
     
    105105; This is part of  the VMCPU structure.
    106106struc VMCPU
    107     .fLocalForcedActions resd 1
    108     .enmState            resd 1
    109     .pUVCpu              RTR3PTR_RES 1
    110     .pVMR3               RTR3PTR_RES 1
    111     .pVMR0               RTR0PTR_RES 1
    112     .pVMRC               RTRCPTR_RES 1
    113     .idCpu               resd 1
     107    .fLocalForcedActions    resd 1
     108    .enmState               resd 1
     109    .pUVCpu                 RTR3PTR_RES 1
     110    .pVMR3                  RTR3PTR_RES 1
     111    .pVMR0                  RTR0PTR_RES 1
     112    .pVMRC                  RTRCPTR_RES 1
     113    .idCpu                  resd 1
    114114
    115     .hNativeThread       RTR0PTR_RES 1
     115    .hNativeThread          RTR0PTR_RES 1
     116    .idHostCpu              resd 1
    116117
    117118    alignb 64
    118119
    119     .cpum                resb 4096
     120    .cpum                   resb 4096
    120121endstruc
    121122
  • trunk/include/VBox/vmm.h

    r19437 r19454  
    114114VMMDECL(PVMCPU)      VMMGetCpu(PVM pVM);
    115115VMMDECL(PVMCPU)      VMMGetCpu0(PVM pVM);
    116 VMMDECL(PVMCPU)      VMMGetCpuById(PVM pVM, RTCPUID idCpu);
     116VMMDECL(PVMCPU)      VMMGetCpuById(PVM pVM, VMCPUID idCpu);
    117117VMMDECL(uint32_t)    VMMGetSvnRev(void);
    118118VMMDECL(VMMSWITCHER) VMMGetSwitcher(PVM pVM);
     
    298298
    299299VMMR0DECL(int)      VMMR0EntryInt(PVM pVM, VMMR0OPERATION enmOperation, void *pvArg);
    300 VMMR0DECL(void)     VMMR0EntryFast(PVM pVM, unsigned idCpu, VMMR0OPERATION enmOperation);
    301 VMMR0DECL(int)      VMMR0EntryEx(PVM pVM, unsigned idCpu, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION);
     300VMMR0DECL(void)     VMMR0EntryFast(PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation);
     301VMMR0DECL(int)      VMMR0EntryEx(PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION);
    302302VMMR0DECL(int)      VMMR0TermVM(PVM pVM, PGVM pGVM);
    303303VMMR0DECL(int)      VMMR0CallHost(PVM pVM, VMMCALLHOST enmOperation, uint64_t uArg);
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