VirtualBox

Changeset 22890 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Sep 9, 2009 11:11:31 PM (15 years ago)
Author:
vboxsync
Message:

VM::cCPUs -> VM::cCpus so it matches all the other cCpus and aCpus members.

Location:
trunk/src/VBox/VMM/VMMAll
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r22070 r22890  
    10731073
    10741074    if (    iLeaf == 1
    1075         &&  pVM->cCPUs > 1)
     1075        &&  pVM->cCpus > 1)
    10761076    {
    10771077        /* Bits 31-24: Initial APIC ID */
     
    13111311            break;
    13121312    }
    1313     for (unsigned i=0;i<pVM->cCPUs;i++)
     1313    for (VMCPUID i = 0; i < pVM->cCpus; i++)
    13141314    {
    13151315        PVMCPU pVCpu = &pVM->aCpus[i];
    1316 
    13171316        pVCpu->cpum.s.fChanged |= CPUM_CHANGED_CPUID;
    13181317    }
     
    14311430            break;
    14321431    }
    1433     for (unsigned i=0;i<pVM->cCPUs;i++)
     1432    for (VMCPUID i = 0; i < pVM->cCpus; i++)
    14341433    {
    14351434        PVMCPU pVCpu = &pVM->aCpus[i];
    1436 
    14371435        pVCpu->cpum.s.fChanged |= CPUM_CHANGED_CPUID;
    14381436    }
  • trunk/src/VBox/VMM/VMMAll/HWACCMAll.cpp

    r20981 r22890  
    116116    VMCPUID idCurCpu = VMMGetCpuId(pVM);
    117117
    118     for (unsigned idCpu = 0; idCpu < pVM->cCPUs; idCpu++)
     118    for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    119119    {
    120120        PVMCPU pVCpu = &pVM->aCpus[idCpu];
     
    154154VMMDECL(int) HWACCMFlushTLBOnAllVCpus(PVM pVM)
    155155{
    156     if (pVM->cCPUs == 1)
     156    if (pVM->cCpus == 1)
    157157        return HWACCMFlushTLB(&pVM->aCpus[0]);
    158158
    159159    VMCPUID idThisCpu = VMMGetCpuId(pVM);
    160160
    161     for (unsigned idCpu = 0; idCpu < pVM->cCPUs; idCpu++)
     161    for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    162162    {
    163163        PVMCPU pVCpu = &pVM->aCpus[idCpu];
     
    231231        VMCPUID idThisCpu = VMMGetCpuId(pVM);
    232232
    233         for (unsigned idCpu = 0; idCpu < pVM->cCPUs; idCpu++)
     233        for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    234234        {
    235235            PVMCPU pVCpu = &pVM->aCpus[idCpu];
  • trunk/src/VBox/VMM/VMMAll/IOMAll.cpp

    r22493 r22890  
    5050int iomLock(PVM pVM)
    5151{
    52     Assert(pVM->cCPUs == 1 || !PGMIsLockOwner(pVM));
     52    Assert(pVM->cCpus == 1 || !PGMIsLockOwner(pVM));
    5353    int rc = PDMCritSectEnter(&pVM->iom.s.EmtLock, VERR_SEM_BUSY);
    5454    return rc;
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r22039 r22890  
    493493    PVM pVM = pCritSect->s.CTX_SUFF(pVM);
    494494    AssertPtr(pVM);
    495     Assert(idCpu < pVM->cCPUs);
     495    Assert(idCpu < pVM->cCpus);
    496496    return pCritSect->s.Core.NativeThreadOwner == pVM->aCpus[idCpu].hNativeThread
    497497        && (pCritSect->s.Core.fFlags & PDMCRITSECT_FLAGS_PENDING_UNLOCK) == 0;
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r22545 r22890  
    460460# ifdef IN_RING0
    461461    /* Note: hack alert for difficult to reproduce problem. */
    462     if (    pVM->cCPUs > 1
     462    if (    pVM->cCpus > 1
    463463        &&  rc == VERR_PAGE_TABLE_NOT_PRESENT)
    464464    {
     
    25182518
    25192519    /* Only applies to raw mode -> 1 VPCU */
    2520     Assert(pVM->cCPUs == 1);
     2520    Assert(pVM->cCpus == 1);
    25212521    PVMCPU pVCpu = &pVM->aCpus[0];
    25222522
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r22600 r22890  
    856856                        uint64_t fPageShw;
    857857                        rc = PGMShwGetPage(pVCpu, pvFault, &fPageShw, NULL);
    858                         AssertMsg((RT_SUCCESS(rc) && (fPageShw & X86_PTE_RW)) || pVM->cCPUs > 1 /* new monitor can be installed/page table flushed between the trap exit and PGMTrap0eHandler */, ("rc=%Rrc fPageShw=%RX64\n", rc, fPageShw));
     858                        AssertMsg((RT_SUCCESS(rc) && (fPageShw & X86_PTE_RW)) || pVM->cCpus > 1 /* new monitor can be installed/page table flushed between the trap exit and PGMTrap0eHandler */, ("rc=%Rrc fPageShw=%RX64\n", rc, fPageShw));
    859859#   endif /* VBOX_STRICT */
    860860                        STAM_PROFILE_STOP(&pVCpu->pgm.s.StatRZTrap0eTimeOutOfSync, c);
     
    17291729    if (!PdeDst.n.u1Present)
    17301730    {
    1731         AssertMsg(pVM->cCPUs > 1, ("%Unexpected missing PDE p=%llx\n", pPdeDst, (uint64_t)PdeDst.u));
     1731        AssertMsg(pVM->cCpus > 1, ("%Unexpected missing PDE p=%llx\n", pPdeDst, (uint64_t)PdeDst.u));
    17321732        Log(("CPU%d: SyncPage: Pde at %RGv changed behind our back!\n", GCPtrPage));
    17331733        return VINF_SUCCESS;    /* force the instruction to be executed again. */
     
    22552255                else
    22562256                /* Check for stale TLB entry; only applies to the SMP guest case. */
    2257                 if (    pVM->cCPUs > 1
     2257                if (    pVM->cCpus > 1
    22582258                    &&  pPdeDst->n.u1Write
    22592259                    &&  pPdeDst->n.u1Accessed)
     
    23952395                        else
    23962396                        /* Check for stale TLB entry; only applies to the SMP guest case. */
    2397                         if (    pVM->cCPUs > 1
     2397                        if (    pVM->cCpus > 1
    23982398                            &&  pPteDst->n.u1Write == 1
    23992399                            &&  pPteDst->n.u1Accessed == 1)
     
    44714471
    44724472    /* Clean up the old CR3 root. */
    4473     if (    pOldShwPageCR3 
     4473    if (    pOldShwPageCR3
    44744474        &&  pOldShwPageCR3 != pNewShwPageCR3    /* @todo can happen due to incorrect syncing between REM & PGM; find the real cause */)
    44754475    {
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r20374 r22890  
    484484    STAM_PROFILE_START(&pVM->pgm.s.CTX_MID_Z(Stat,SyncCR3HandlerVirtualUpdate), a);
    485485
    486     for (unsigned i=0;i<pVM->cCPUs;i++)
     486    for (VMCPUID i = 0; i < pVM->cCpus; i++)
    487487    {
    488488        PGMHVUSTATE State;
     
    509509        RTAvlroGCPtrDoWithAll(&pVM->pgm.s.CTX_SUFF(pTrees)->VirtHandlers, true, pgmHandlerVirtualResetOne, pVM);
    510510
    511         for (unsigned i=0;i<pVM->cCPUs;i++)
     511        for (VMCPUID i = 0; i < pVM->cCpus; i++)
    512512        {
    513513            PVMCPU pVCpu = &pVM->aCpus[i];
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r22756 r22890  
    15421542    for (unsigned iPage = 0; iPage < pVirt->cPages; iPage++, GCPtr += PAGE_SIZE)
    15431543    {
    1544         for (unsigned i=0;i<pVM->cCPUs;i++)
     1544        for (VMCPUID i = 0; i < pVM->cCpus; i++)
    15451545        {
    15461546            PVMCPU pVCpu = &pVM->aCpus[i];
  • trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp

    r21964 r22890  
    222222
    223223    if (    !pgmMapAreMappingsEnabled(&pVM->pgm.s)
    224         ||  pVM->cCPUs > 1)
     224        ||  pVM->cCpus > 1)
    225225        return;
    226226
     
    390390
    391391    if (    !pgmMapAreMappingsEnabled(&pVM->pgm.s)
    392         ||  pVM->cCPUs > 1)
     392        ||  pVM->cCpus > 1)
    393393        return;
    394394
     
    602602        return;
    603603
    604     Assert(pVM->cCPUs == 1);
     604    Assert(pVM->cCpus == 1);
    605605
    606606    /* This only applies to raw mode where we only support 1 VCPU. */
     
    636636     */
    637637    if (    !pgmMapAreMappingsEnabled(&pVM->pgm.s)
    638         ||  pVM->cCPUs > 1)
     638        ||  pVM->cCpus > 1)
    639639        return VINF_SUCCESS;
    640640
     
    672672     */
    673673    if (    !pgmMapAreMappingsEnabled(&pVM->pgm.s)
    674         ||  pVM->cCPUs > 1)
     674        ||  pVM->cCpus > 1)
    675675        return VINF_SUCCESS;
    676676
     
    705705        return false;
    706706
    707     Assert(pVM->cCPUs == 1);
     707    Assert(pVM->cCpus == 1);
    708708
    709709    /* This only applies to raw mode where we only support 1 VCPU. */
     
    801801        return VINF_SUCCESS;
    802802
    803     Assert(pVM->cCPUs == 1);
     803    Assert(pVM->cCpus == 1);
    804804
    805805    /* This only applies to raw mode where we only support 1 VCPU. */
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r22788 r22890  
    885885            return false;
    886886    }
    887     if (    (    (pDis->param1.flags & USE_REG_GEN32) 
     887    if (    (    (pDis->param1.flags & USE_REG_GEN32)
    888888             ||  (pDis->param1.flags & USE_REG_GEN64))
    889889        &&  (pDis->param1.base.reg_gen == USE_REG_ESP))
     
    12261226            if (fReused)
    12271227                goto flushPage;
    1228                
     1228
    12291229            /* A mov instruction to change the first page table entry will be remembered so we can detect
    12301230             * full page table changes early on. This will reduce the amount of unnecessary traps we'll take.
     
    13151315        &&  !fForcedFlush
    13161316        &&  pPage->enmKind == PGMPOOLKIND_PAE_PT_FOR_PAE_PT
    1317         &&  (   fNotReusedNotForking 
     1317        &&  (   fNotReusedNotForking
    13181318             || (   !pgmPoolMonitorIsReused(pVM, pVCpu, pRegFrame, pDis, pvFault)
    13191319                 && !pgmPoolMonitorIsForking(pPool, pDis, GCPhysFault & PAGE_OFFSET_MASK))
     
    13621362            {
    13631363                rc = PGMShwModifyPage(pVCpu, pvFault, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW);
    1364                 AssertMsg(rc == VINF_SUCCESS 
     1364                AssertMsg(rc == VINF_SUCCESS
    13651365                        /* In the SMP case the page table might be removed while we wait for the PGM lock in the trap handler. */
    1366                         ||  rc == VERR_PAGE_TABLE_NOT_PRESENT 
    1367                         ||  rc == VERR_PAGE_NOT_PRESENT, 
     1366                        ||  rc == VERR_PAGE_TABLE_NOT_PRESENT
     1367                        ||  rc == VERR_PAGE_NOT_PRESENT,
    13681368                        ("PGMShwModifyPage -> GCPtr=%RGv rc=%d\n", pvFault, rc));
    13691369
    13701370                pgmPoolAddDirtyPage(pVM, pPool, pPage);
    13711371                pPage->pvDirtyFault = pvFault;
    1372      
     1372
    13731373                STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), a);
    13741374                pgmUnlock(pVM);
     
    13881388     * interpret then. This may be a bit risky, in which case
    13891389     * the reuse detection must be fixed.
    1390      */       
     1390     */
    13911391    rc = pgmPoolAccessHandlerFlush(pVM, pVCpu, pPool, pPage, pDis, pRegFrame, GCPhysFault, pvFault);
    13921392    if (rc == VINF_EM_RAW_EMULATE_INSTR && fReused)
     
    14231423            RTHCPHYS HCPhys = -1;
    14241424            int rc = PGMPhysGCPhys2HCPhys(pPool->CTX_SUFF(pVM), pGstPT->a[i].u & X86_PTE_PAE_PG_MASK, &HCPhys);
    1425             if (    rc != VINF_SUCCESS 
     1425            if (    rc != VINF_SUCCESS
    14261426                ||  (pShwPT->a[i].u & X86_PTE_PAE_PG_MASK) != HCPhys)
    14271427            {
     
    15551555    RTHCPHYS HCPhys;
    15561556    rc = PGMShwGetPage(VMMGetCpu(pVM), pPage->pvDirtyFault, &fFlags, &HCPhys);
    1557     AssertMsg(      (   rc == VINF_SUCCESS 
     1557    AssertMsg(      (   rc == VINF_SUCCESS
    15581558                     && (!(fFlags & X86_PTE_RW) || HCPhys != pPage->Core.Key))
    15591559              /* In the SMP case the page table might be removed while we wait for the PGM lock in the trap handler. */
    1560               ||    rc == VERR_PAGE_TABLE_NOT_PRESENT 
    1561               ||    rc == VERR_PAGE_NOT_PRESENT, 
     1560              ||    rc == VERR_PAGE_TABLE_NOT_PRESENT
     1561              ||    rc == VERR_PAGE_NOT_PRESENT,
    15621562              ("PGMShwGetPage -> GCPtr=%RGv rc=%d flags=%RX64\n", pPage->pvDirtyFault, rc, fFlags));
    15631563#endif
     
    18281828
    18291829    /*
    1830      * Found a usable page, flush it and return. 
     1830     * Found a usable page, flush it and return.
    18311831     */
    18321832    return pgmPoolFlushPage(pPool, pPage);
     
    26352635
    26362636    /* Clear the PGM_SYNC_CLEAR_PGM_POOL flag on all VCPUs to prevent redundant flushes. */
    2637     for (unsigned idCpu = 0; idCpu < pVM->cCPUs; idCpu++)
     2637    for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    26382638    {
    26392639        PVMCPU pVCpu = &pVM->aCpus[idCpu];
    2640 
    26412640        pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_CLEAR_PGM_POOL;
    26422641    }
     
    49114910     * including the root page.
    49124911     */
    4913     for (unsigned i=0;i<pVM->cCPUs;i++)
     4912    for (VMCPUID i = 0; i < pVM->cCpus; i++)
    49144913    {
    49154914        PVMCPU pVCpu = &pVM->aCpus[i];
     
    50675066    }
    50685067
    5069     for (unsigned i=0;i<pVM->cCPUs;i++)
    5070     {
    5071         PVMCPU pVCpu = &pVM->aCpus[i];
     5068    for (VMCPUID i = 0; i < pVM->cCpus; i++)
     5069    {
    50725070        /*
    50735071         * Re-enter the shadowing mode and assert Sync CR3 FF.
    50745072         */
     5073        PVMCPU pVCpu = &pVM->aCpus[i];
    50755074        pgmR3ReEnterShadowModeAfterPoolFlush(pVM, pVCpu);
    50765075        VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
  • trunk/src/VBox/VMM/VMMAll/REMAll.cpp

    r22707 r22890  
    211211VMMDECL(void) REMNotifyHandlerPhysicalFlushIfAlmostFull(PVM pVM, PVMCPU pVCpu)
    212212{
    213     Assert(pVM->cCPUs == 1);
     213    Assert(pVM->cCpus == 1);
    214214
    215215    /*
  • trunk/src/VBox/VMM/VMMAll/SELMAll.cpp

    r19334 r22890  
    5656VMMDECL(RTGCPTR) SELMToFlatBySel(PVM pVM, RTSEL Sel, RTGCPTR Addr)
    5757{
    58     Assert(pVM->cCPUs == 1 && !CPUMIsGuestInLongMode(VMMGetCpu(pVM)));    /* DON'T USE! */
     58    Assert(pVM->cCpus == 1 && !CPUMIsGuestInLongMode(VMMGetCpu(pVM)));    /* DON'T USE! */
    5959
    6060    /** @todo check the limit. */
     
    835835VMMDECL(int) SELMValidateAndConvertCSAddrGCTrap(PVM pVM, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS, RTGCPTR Addr, PRTGCPTR ppvFlat, uint32_t *pcBits)
    836836{
    837     Assert(pVM->cCPUs == 1);
     837    Assert(pVM->cCpus == 1);
    838838    PVMCPU pVCpu = &pVM->aCpus[0];
    839839
     
    996996VMMDECL(int) SELMGetRing1Stack(PVM pVM, uint32_t *pSS, PRTGCPTR32 pEsp)
    997997{
    998     Assert(pVM->cCPUs == 1);
     998    Assert(pVM->cCpus == 1);
    999999    PVMCPU pVCpu = &pVM->aCpus[0];
    10001000
  • trunk/src/VBox/VMM/VMMAll/TMAllVirtual.cpp

    r22808 r22890  
    828828{
    829829    uint32_t c = ASMAtomicDecU32(&pVM->tm.s.cVirtualTicking);
    830     AssertMsgReturn(c < pVM->cCPUs, ("%u vs %u\n", c, pVM->cCPUs), VERR_INTERNAL_ERROR);
     830    AssertMsgReturn(c < pVM->cCpus, ("%u vs %u\n", c, pVM->cCpus), VERR_INTERNAL_ERROR);
    831831    if (c == 0)
    832832    {
     
    848848{
    849849    uint32_t c = ASMAtomicIncU32(&pVM->tm.s.cVirtualTicking);
    850     AssertMsgReturn(c <= pVM->cCPUs, ("%u vs %u\n", c, pVM->cCPUs), VERR_INTERNAL_ERROR);
     850    AssertMsgReturn(c <= pVM->cCpus, ("%u vs %u\n", c, pVM->cCpus), VERR_INTERNAL_ERROR);
    851851    if (c == 1)
    852852    {
  • trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp

    r20840 r22890  
    366366    PVM pVM = pVCpu->CTX_SUFF(pVM);
    367367    X86EFLAGS eflags;
    368     Assert(pVM->cCPUs == 1);
     368    Assert(pVM->cCpus == 1);
    369369
    370370    STAM_PROFILE_ADV_START(&pVM->trpm.s.CTX_SUFF_Z(StatForwardProf), a);
  • trunk/src/VBox/VMM/VMMAll/VMMAll.cpp

    r22823 r22890  
    6565
    6666#elif defined(IN_RING0)
    67     if (pVM->cCPUs == 1)
     67    if (pVM->cCpus == 1)
    6868        return 0;
    6969    return HWACCMR0GetVMCPUId(pVM);
     
    8888    if (idCpu == NIL_VMCPUID)
    8989        return NULL;
    90     Assert(idCpu < pVM->cCPUs);
     90    Assert(idCpu < pVM->cCpus);
    9191    return &pVM->aCpus[VMR3GetVMCPUId(pVM)];
    9292
    9393#elif defined(IN_RING0)
    94     if (pVM->cCPUs == 1)
     94    if (pVM->cCpus == 1)
    9595        return &pVM->aCpus[0];
    9696    return HWACCMR0GetVMCPU(pVM);
     
    110110VMMDECL(PVMCPU) VMMGetCpu0(PVM pVM)
    111111{
    112     Assert(pVM->cCPUs == 1);
     112    Assert(pVM->cCpus == 1);
    113113    return &pVM->aCpus[0];
    114114}
     
    125125VMMDECL(PVMCPU) VMMGetCpuById(PVM pVM, RTCPUID idCpu)
    126126{
    127     AssertReturn(idCpu < pVM->cCPUs, NULL);
     127    AssertReturn(idCpu < pVM->cCpus, NULL);
    128128    return &pVM->aCpus[idCpu];
    129129}
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