VirtualBox

Changeset 13796 in vbox


Ignore:
Timestamp:
Nov 4, 2008 6:37:33 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
38784
Message:

VMM: some adjustments.

Location:
trunk
Files:
17 edited

Legend:

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

    r13782 r13796  
    3333#define ___VBox_uvm_h
    3434
    35 
    3635#include <VBox/types.h>
    3736
    38 /* Forward decl. */
    39 struct UVM;
    4037
    4138/**
     
    4441typedef struct UVMCPU
    4542{
    46     struct UVM                     *pUVM;
     43    /** Pointer to the UVM structure.  */
     44    PUVM                            pUVM;
     45    /** The virtual CPU ID.  */
    4746    RTCPUID                         idCPU;
    4847
     
    5554        uint8_t                     padding[768];
    5655    } vm;
    57 } UVMCPU, *PUVMCPU;
     56} UVMCPU;
     57/** Pointer to the per virtual CPU ring-3 (user mode) data. */
     58typedef UVMCPU *PUVMCPU;
     59
    5860
    5961/**
     
    115117    } stam;
    116118
    117     /* Per virtual CPU data. */
    118     UVMCPU                      aCpu[1];
     119    /** Per virtual CPU data. */
     120    UVMCPU                      aCpus[1];
    119121} UVM;
    120122
  • trunk/include/VBox/vm.h

    r13791 r13796  
    779779    uint32_t    u32Reserved2[8];
    780780
    781     /** VMCPU array for the configured number of virtual CPUs. */
    782     VMCPU       aCpu[1];
     781    /** VMCPU array for the configured number of virtual CPUs.
     782     * Must be aligned on a 64-byte boundrary.  */
     783    VMCPU       aCpus[1];
    783784} VM;
    784785
  • trunk/src/VBox/VMM/CPUM.cpp

    r13778 r13796  
    218218}
    219219
     220
    220221/**
    221222 * Initializes the per-VCPU CPUM.
     
    229230    return VINF_SUCCESS;
    230231}
     232
    231233
    232234/**
     
    657659}
    658660
     661
    659662/**
    660663 * Terminates the per-VCPU CPUM.
     
    670673    return 0;
    671674}
     675
    672676
    673677/**
  • trunk/src/VBox/VMM/EM.cpp

    r13782 r13796  
    374374}
    375375
     376
    376377/**
    377378 * Initializes the per-VCPU EM.
     
    385386    return VINF_SUCCESS;
    386387}
     388
    387389
    388390/**
  • trunk/src/VBox/VMM/MMHyper.cpp

    r13767 r13796  
    105105         * Map the VM structure into the hypervisor space.
    106106         */
    107         AssertRelease(pVM->cbSelf == RT_UOFFSETOF(VM, aCpu[pVM->cCPUs]));
    108 
     107        AssertRelease(pVM->cbSelf == RT_UOFFSETOF(VM, aCpus[pVM->cCPUs]));
    109108        RTGCPTR GCPtr;
    110109        rc = MMR3HyperMapPages(pVM, pVM, pVM->pVMR0, RT_ALIGN_Z(pVM->cbSelf, PAGE_SIZE) >> PAGE_SHIFT, pVM->paVMPagesR3, "VM", &GCPtr);
     
    114113            pVM->pVMGC = pVM->pVMRC;
    115114            for (uint32_t i = 0; i < pVM->cCPUs; i++)
    116                 pVM->aCpu[i].pVMRC = pVM->pVMRC;
     115                pVM->aCpus[i].pVMRC = pVM->pVMRC;
    117116
    118117            /* Reserve a page for fencing. */
     
    293292            pVM->pVMGC                          = pVM->pVMRC;
    294293            for (uint32_t i = 0; i < pVM->cCPUs; i++)
    295                 pVM->aCpu[i].pVMRC             = pVM->pVMRC;
     294                pVM->aCpus[i].pVMRC             = pVM->pVMRC;
    296295
    297296            pVM->mm.s.pvHyperAreaGC             += offDelta;
  • trunk/src/VBox/VMM/PGM.cpp

    r13778 r13796  
    12791279}
    12801280
     1281
    12811282/**
    12821283 * Initializes the per-VCPU PGM.
     
    12901291    return VINF_SUCCESS;
    12911292}
     1293
    12921294
    12931295/**
     
    21182120}
    21192121
     2122
    21202123/**
    21212124 * Terminates the per-VCPU PGM.
     
    21312134    return 0;
    21322135}
     2136
    21332137
    21342138/**
  • trunk/src/VBox/VMM/PGMInternal.h

    r13742 r13796  
    26082608    STAMPROFILE StatR3GstModifyPage;                /**< R3: Profiling of the PGMGstModifyPage() body */
    26092609#endif /* VBOX_WITH_STATISTICS */
    2610 } PGM, *PPGM;
    2611 
    2612 
    2613 /**
    2614  * PGMCPU Data (part of VMCPU)
     2610} PGM;
     2611/** Pointer to the PGM instance data. */
     2612typedef PGM *PPGM;
     2613
     2614
     2615/**
     2616 * PGMCPU Data (part of VMCPU).
    26152617 */
    26162618typedef struct PGMCPU
     
    26182620    /** Offset to the VMCPU structure. */
    26192621    RTINT                           offVMCPU;
    2620 } PGMCPU, *PPGMCPU;
     2622} PGMCPU;
     2623/** Pointer to the per-cpu PGM data. */
     2624typedef PGMCPU *PPGMCPU;
     2625
    26212626
    26222627/** @name PGM::fSyncFlags Flags
  • trunk/src/VBox/VMM/TM.cpp

    r13778 r13796  
    601601}
    602602
     603
    603604/**
    604605 * Initializes the per-VCPU TM.
     
    612613    return VINF_SUCCESS;
    613614}
     615
    614616
    615617/**
     
    884886}
    885887
     888
    886889/**
    887890 * Terminates the per-VCPU TM.
     
    897900    return 0;
    898901}
     902
    899903
    900904/**
  • trunk/src/VBox/VMM/VM.cpp

    r13791 r13796  
    192192VMMR3DECL(int)   VMR3Create(uint32_t cCPUs, PFNVMATERROR pfnVMAtError, void *pvUserVM, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM, PVM *ppVM)
    193193{
    194     LogFlow(("VMR3Create: cCPUs=%d pfnVMAtError=%p pvUserVM=%p  pfnCFGMConstructor=%p pvUserCFGM=%p ppVM=%p\n", cCPUs, pfnVMAtError, pvUserVM, pfnCFGMConstructor, pvUserCFGM, ppVM));
     194    LogFlow(("VMR3Create: cCPUs=%RU32 pfnVMAtError=%p pvUserVM=%p  pfnCFGMConstructor=%p pvUserCFGM=%p ppVM=%p\n", cCPUs, pfnVMAtError, pvUserVM, pfnCFGMConstructor, pvUserCFGM, ppVM));
    195195
    196196    /*
     
    239239             */
    240240            PVMREQ pReq;
     241            /** @todo SMP: VMREQDEST_ANY -> VMREQDEST_CPU0 */
    241242            rc = VMR3ReqCallU(pUVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, 0, (PFNRT)vmR3CreateU,
    242243                              4, pUVM, cCPUs, pfnCFGMConstructor, pvUserCFGM);
     
    378379static int vmR3CreateUVM(uint32_t cCPUs, PUVM *ppUVM)
    379380{
    380     /*
    381      * Create the UVM, initialize the fundamental stuff (VM+MMR3Heap+STAM)
    382      * and start the emulation thread (EMT).
    383      */
    384     PUVM pUVM = (PUVM)RTMemAllocZ(RT_OFFSETOF(UVM, aCpu[cCPUs]));
     381    uint32_t i;
     382
     383    /*
     384     * Create and initialize the UVM.
     385     */
     386    PUVM pUVM = (PUVM)RTMemAllocZ(RT_OFFSETOF(UVM, aCpus[cCPUs]));
    385387    AssertReturn(pUVM, VERR_NO_MEMORY);
    386388    pUVM->u32Magic = UVM_MAGIC;
     
    395397    pUVM->vm.s.enmHaltMethod = VMHALTMETHOD_BOOTSTRAP;
    396398
     399    /* Initialize the VMCPU array in the UVM. */
     400    for (i = 0; i < cCPUs; i++)
     401    {
     402        pUVM->aCpus[i].pUVM  = pUVM;
     403        pUVM->aCpus[i].idCPU = i;
     404    }
     405
    397406    /* Allocate a TLS entry to store the VMINTUSERPERVMCPU pointer. */
    398407    int rc = RTTlsAllocEx(&pUVM->vm.s.idxTLS, NULL);
    399408    AssertRC(rc);
    400     if (RT_FAILURE(rc))
    401     {
    402         RTMemFree(pUVM);
    403         return rc;
    404     }
    405 
    406     /* Initialize the VMCPU array in the UVM. */
    407     for (unsigned i=0;i<cCPUs;i++)
    408     {
    409         pUVM->aCpu[i].pUVM  = pUVM;
    410         pUVM->aCpu[i].idCPU = i;
    411     }
    412 
    413     rc = RTSemEventCreate(&pUVM->vm.s.EventSemWait);
    414409    if (RT_SUCCESS(rc))
    415410    {
    416         rc = STAMR3InitUVM(pUVM);
     411        rc = RTSemEventCreate(&pUVM->vm.s.EventSemWait);
    417412        if (RT_SUCCESS(rc))
    418413        {
    419             rc = MMR3InitUVM(pUVM);
     414            /*
     415             * Init fundamental (sub-)components - STAM, MMR3Heap and PDMLdr.
     416             */
     417            rc = STAMR3InitUVM(pUVM);
    420418            if (RT_SUCCESS(rc))
    421419            {
    422                 rc = PDMR3InitUVM(pUVM);
     420                rc = MMR3InitUVM(pUVM);
    423421                if (RT_SUCCESS(rc))
    424422                {
    425                     /* Start the emulation threads for all VMCPUs. */
    426                     for (unsigned i=0;i<cCPUs;i++)
    427                     {
    428                         rc = RTThreadCreate(&pUVM->aCpu[i].vm.s.ThreadEMT, vmR3EmulationThread, &pUVM->aCpu[i], _1M,
    429                                             RTTHREADTYPE_EMULATION, RTTHREADFLAGS_WAITABLE, "EMT");
    430                         if (RT_FAILURE(rc))
    431                             break;
    432 
    433                         pUVM->aCpu[i].vm.s.NativeThreadEMT = RTThreadGetNative(pUVM->aCpu[i].vm.s.ThreadEMT);
    434                     }
    435 
     423                    rc = PDMR3InitUVM(pUVM);
    436424                    if (RT_SUCCESS(rc))
    437425                    {
    438                         *ppUVM = pUVM;
    439                         return VINF_SUCCESS;
     426                        /*
     427                         * Start the emulation threads for all VMCPUs.
     428                         */
     429                        for (i = 0; i < cCPUs; i++)
     430                        {
     431                            rc = RTThreadCreate(&pUVM->aCpus[i].vm.s.ThreadEMT, vmR3EmulationThread, &pUVM->aCpus[i], _1M,
     432                                                RTTHREADTYPE_EMULATION, RTTHREADFLAGS_WAITABLE, "EMT");
     433                            if (RT_FAILURE(rc))
     434                                break;
     435
     436                            pUVM->aCpus[i].vm.s.NativeThreadEMT = RTThreadGetNative(pUVM->aCpus[i].vm.s.ThreadEMT);
     437                        }
     438
     439                        if (RT_SUCCESS(rc))
     440                        {
     441                            *ppUVM = pUVM;
     442                            return VINF_SUCCESS;
     443                        }
     444
     445                        /* bail out. */
     446                        while (i-- > 0)
     447                        {
     448                            /** @todo rainy day: terminate the EMTs. */
     449                        }
     450                        PDMR3TermUVM(pUVM);
    440451                    }
    441 
    442                     /* bail out. */
    443                     PDMR3TermUVM(pUVM);
     452                    MMR3TermUVM(pUVM);
    444453                }
    445                 MMR3TermUVM(pUVM);
     454                STAMR3TermUVM(pUVM);
    446455            }
    447             STAMR3TermUVM(pUVM);
     456            RTSemEventDestroy(pUVM->vm.s.EventSemWait);
    448457        }
    449         RTSemEventDestroy(pUVM->vm.s.EventSemWait);
    450     }
    451     RTTlsFree(pUVM->vm.s.idxTLS);
     458        RTTlsFree(pUVM->vm.s.idxTLS);
     459    }
    452460    RTMemFree(pUVM);
    453461    return rc;
     
    495503        AssertRelease(pVM->pSession == pUVM->vm.s.pSession);
    496504        AssertRelease(pVM->cCPUs == cCPUs);
     505        AssertRelease(pVM->offVMCPU == RT_UOFFSETOF(VM, aCpus));
    497506
    498507        Log(("VMR3Create: Created pUVM=%p pVM=%p pVMR0=%p hSelf=%#x cCPUs=%RU32\n",
     
    503512         */
    504513        pVM->pUVM = pUVM;
    505         pVM->offVMCPU = RT_OFFSETOF(VM, aCpu);
    506514
    507515        for (uint32_t i = 0; i < pVM->cCPUs; i++)
    508516        {
    509             pVM->aCpu[i].hNativeThread = pUVM->aCpu[i].vm.s.NativeThreadEMT;
    510             Assert(pVM->aCpu[i].hNativeThread != NIL_RTNATIVETHREAD);
     517            pVM->aCpus[i].hNativeThread = pUVM->aCpus[i].vm.s.NativeThreadEMT;
     518            Assert(pVM->aCpus[i].hNativeThread != NIL_RTNATIVETHREAD);
    511519        }
    512520
     
    792800}
    793801
     802
    794803/**
    795804 * Initializes all VM CPU components of the VM
     
    817826                        rc = EMR3InitCPU(pVM);
    818827                        if (VBOX_SUCCESS(rc))
     828                        {
     829                            LogFlow(("vmR3InitVMCpu: returns %Rrc\n", VINF_SUCCESS));
    819830                            return VINF_SUCCESS;
     831                        }
    820832
    821833                        rc2 = VMMR3TermCPU(pVM);
     
    15891601        Assert(pUVM->vm.s.fTerminateEMT);
    15901602        /** @todo SMP */
    1591         rc = RTThreadWait(pUVM->aCpu[0].vm.s.ThreadEMT, 30000, NULL);
     1603        rc = RTThreadWait(pUVM->aCpus[0].vm.s.ThreadEMT, 30000, NULL);
    15921604        AssertMsgRC(rc, ("EMT thread wait failed, rc=%Rrc\n", rc));
    15931605
     
    17441756
    17451757        /** @todo SMP */
    1746         int rc2 = RTThreadWait(pUVM->aCpu[0].vm.s.ThreadEMT, 2000, NULL);
     1758        int rc2 = RTThreadWait(pUVM->aCpus[0].vm.s.ThreadEMT, 2000, NULL);
    17471759        AssertRC(rc2);
    17481760    }
     
    31663178}
    31673179
     3180
    31683181/**
    31693182 * Returns the VMCPU id of the current EMT thread.
     
    31793192    return pUVMCPU->idCPU;
    31803193}
     3194
    31813195
    31823196/**
     
    31973211}
    31983212
     3213
    31993214/**
    32003215 * Returns the native handle of the current EMT VMCPU thread.
     
    32143229}
    32153230
     3231
    32163232/**
    32173233 * Returns the handle of the current EMT VMCPU thread.
     
    32313247}
    32323248
     3249
    32333250/**
    32343251 * Returns the handle of the current EMT VMCPU thread.
  • trunk/src/VBox/VMM/VMEmt.cpp

    r13791 r13796  
    5757    PUVM    pUVM    = pUVMCPU->pUVM;
    5858    RTCPUID idCPU   = pUVMCPU->idCPU;
    59     int     rc = VINF_SUCCESS;
     59    int     rc;
    6060
    6161    AssertReleaseMsg(VALID_PTR(pUVM) && pUVM->u32Magic == UVM_MAGIC,
     
    6363
    6464    rc = RTTlsSet(pUVM->vm.s.idxTLS, pUVMCPU);
    65     AssertReleaseMsgReturn(RT_SUCCESS(rc), ("RTTlsSet %x failed with %Rrc\n", pUVM->vm.s.idxTLS, rc), rc);
     65    AssertReleaseMsgRCReturn(rc, ("RTTlsSet %x failed with %Rrc\n", pUVM->vm.s.idxTLS, rc), rc);
    6666
    6767    /*
    6868     * The request loop.
    6969     */
     70    rc = VINF_SUCCESS;
    7071    volatile VMSTATE enmBefore = VMSTATE_CREATING; /* volatile because of setjmp */
    7172    Log(("vmR3EmulationThread: Emulation thread starting the days work... Thread=%#x pUVM=%p\n", ThreadSelf, pUVM));
  • trunk/src/VBox/VMM/VMM.cpp

    r13778 r13796  
    256256    return VINF_SUCCESS;
    257257}
     258
    258259
    259260/**
     
    765766}
    766767
     768
    767769/**
    768770 * Terminates the per-VCPU VMM.
     
    776778VMMR3DECL(int) VMMR3TermCPU(PVM pVM)
    777779{
    778     return 0;
     780    return VINF_SUCCESS;
    779781}
    780782
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r13791 r13796  
    7676    {
    7777        pCritSect->s.Core.cNestings = 1;
    78         Assert(pVM->aCpu[idCPU].hNativeThread);
    79         ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVM->aCpu[idCPU].hNativeThread);
     78        Assert(pVM->aCpus[idCPU].hNativeThread);
     79        ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVM->aCpus[idCPU].hNativeThread);
    8080        STAM_PROFILE_ADV_START(&pCritSect->s.StatLocked, l);
    8181        return VINF_SUCCESS;
     
    8585     * Nested?
    8686     */
    87     if (pCritSect->s.Core.NativeThreadOwner == pVM->aCpu[idCPU].hNativeThread)
     87    if (pCritSect->s.Core.NativeThreadOwner == pVM->aCpus[idCPU].hNativeThread)
    8888    {
    8989        pCritSect->s.Core.cNestings++;
     
    163163    PVM pVM = pCritSect->s.CTX_SUFF(pVM);
    164164    Assert(pVM);
    165     AssertMsg(pCritSect->s.Core.NativeThreadOwner == pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread, ("Owner %RX64 emt=%RX64\n", pCritSect->s.Core.NativeThreadOwner, pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread));
     165    AssertMsg(pCritSect->s.Core.NativeThreadOwner == pVM->aCpus[VM_GET_VMCPUID(pVM)].hNativeThread, ("Owner %RX64 emt=%RX64\n", pCritSect->s.Core.NativeThreadOwner, pVM->aCpus[VM_GET_VMCPUID(pVM)].hNativeThread));
    166166
    167167    /*
     
    187187
    188188        /* darn, someone raced in on us. */
    189         Assert(pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread);
    190         ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread);
     189        Assert(pVM->aCpus[VM_GET_VMCPUID(pVM)].hNativeThread);
     190        ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVM->aCpus[VM_GET_VMCPUID(pVM)].hNativeThread);
    191191        STAM_PROFILE_ADV_START(&pCritSect->s.StatLocked, l);
    192192    }
     
    222222    PVM pVM = pCritSect->s.CTX_SUFF(pVM);
    223223    Assert(pVM);
    224     return pCritSect->s.Core.NativeThreadOwner == pVM->aCpu[VM_GET_VMCPUID(pVM)].hNativeThread;
     224    return pCritSect->s.Core.NativeThreadOwner == pVM->aCpus[VM_GET_VMCPUID(pVM)].hNativeThread;
    225225#endif
    226226}
  • trunk/src/VBox/VMM/VMMInternal.h

    r13742 r13796  
    351351typedef VMM *PVMM;
    352352
     353
    353354/**
    354355 * VMMCPU Data (part of VMCPU)
  • trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp

    r13789 r13796  
    470470    if (!VALID_PTR(pReq->pSession))
    471471        return VERR_INVALID_POINTER;
    472     if (    pReq->cCPUs == 0
    473         ||  pReq->cCPUs > VMCPU_MAX_CPU_COUNT)
    474         return VERR_INVALID_PARAMETER;
    475472
    476473    /*
     
    510507    AssertPtrReturn(ppVM, VERR_INVALID_POINTER);
    511508    *ppVM = NULL;
     509
     510    if (    cCPUs == 0
     511        ||  cCPUs > VMCPU_MAX_CPU_COUNT)
     512        return VERR_INVALID_PARAMETER;
    512513
    513514    RTNATIVETHREAD hEMT = RTThreadNativeSelf();
     
    575576                         * Allocate the shared VM structure and associated page array.
    576577                         */
    577                         const size_t cbVM   = RT_OFFSETOF(VM, aCpu[cCPUs]);
     578                        const size_t cbVM   = RT_UOFFSETOF(VM, aCpus[cCPUs]);
    578579                        const size_t cPages = RT_ALIGN(cbVM, PAGE_SIZE) >> PAGE_SHIFT;
    579580                        rc = RTR0MemObjAllocLow(&pGVM->gvmm.s.VMMemObj, cPages << PAGE_SHIFT, false /* fExecutable */);
     
    588589                            pVM->cbSelf     = cbVM;
    589590                            pVM->cCPUs      = cCPUs;
     591                            pVM->offVMCPU   = RT_UOFFSETOF(VM, aCpus);
    590592
    591593                            rc = RTR0MemObjAllocPage(&pGVM->gvmm.s.VMPagesMemObj, cPages * sizeof(SUPPAGE), false /* fExecutable */);
     
    613615                                    for (uint32_t i = 0; i < cCPUs; i++)
    614616                                    {
    615                                         pVM->aCpu[i].pVMR0 = pVM;
    616                                         pVM->aCpu[i].pVMR3 = pVM->pVMR3;
     617                                        pVM->aCpus[i].pVMR0 = pVM;
     618                                        pVM->aCpus[i].pVMR3 = pVM->pVMR3;
    617619                                    }
    618620
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r13542 r13796  
    106106    if (VBOX_FAILURE(rc))
    107107    {
    108         if (pVM) 
     108        if (pVM)
    109109            VMXR0CheckError(pVM, rc);
    110110        ASMSetCR4(ASMGetCR4() & ~X86_CR4_VMXE);
     
    563563                RTGCUINTPTR intInfo;
    564564
    565                 intInfo  = (iGate == X86_XCPT_GP) ? X86_XCPT_DF : iGate;
     565                intInfo  = (iGate == X86_XCPT_GP) ? (uint32_t)X86_XCPT_DF : iGate;
    566566                intInfo |= (1 << VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT);
    567567                intInfo |= VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_VALID;
     
    863863 * @param   pVM         The VM to operate on.
    864864 * @param   pCtx        Guest context
    865  */ 
     865 */
    866866static void vmxR0PrefetchPAEPdptrs(PVM pVM, PCPUMCTX pCtx)
    867867{
     
    887887 * @param   pVM         The VM to operate on.
    888888 * @param   pCtx        Guest context
    889  */ 
     889 */
    890890static void vmxR0UpdateExceptionBitmap(PVM pVM, PCPUMCTX pCtx)
    891891{
     
    11281128            {
    11291129                /* Disable cr3 read/write monitoring as we don't need it for EPT. */
    1130                 pVM->hwaccm.s.vmx.proc_ctls &=  ~(  VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_LOAD_EXIT 
     1130                pVM->hwaccm.s.vmx.proc_ctls &=  ~(  VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_LOAD_EXIT
    11311131                                                  | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_STORE_EXIT);
    11321132            }
     
    11341134            {
    11351135                /* Reenable cr3 read/write monitoring as our identity mapped page table is active. */
    1136                 pVM->hwaccm.s.vmx.proc_ctls |=   VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_LOAD_EXIT 
     1136                pVM->hwaccm.s.vmx.proc_ctls |=   VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_LOAD_EXIT
    11371137                                               | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_STORE_EXIT;
    11381138            }
     
    12511251            pVM->hwaccm.s.vmx.GCPhysEPTP |=   VMX_EPT_MEMTYPE_WB
    12521252                                           | (VMX_EPT_PAGE_WALK_LENGTH_DEFAULT << VMX_EPT_PAGE_WALK_LENGTH_SHIFT);
    1253            
     1253
    12541254            rc = VMXWriteVMCS(VMX_VMCS_CTRL_EPTP_FULL, pVM->hwaccm.s.vmx.GCPhysEPTP);
    12551255#if HC_ARCH_BITS == 32
     
    30713071    LogFlow(("VMXR0InvalidatePage %VGv\n", GCVirt));
    30723072
    3073     /* Only relevant if we want to use VPID. 
     3073    /* Only relevant if we want to use VPID.
    30743074     * In the nested paging case we still see such calls, but
    30753075     * can safely ignore them. (e.g. after cr3 updates)
     
    30773077#ifdef HWACCM_VTX_WITH_VPID
    30783078    /* Skip it if a TLB flush is already pending. */
    3079     if (   !fFlushPending 
     3079    if (   !fFlushPending
    30803080        && pVM->hwaccm.s.vmx.fVPID)
    30813081        vmxR0FlushVPID(pVM, pVM->hwaccm.s.vmx.enmFlushPage, GCVirt);
     
    31373137            Log(("Unable to start/resume VM for reason: %x. Instruction error %x\n", (uint32_t)exitReason, (uint32_t)instrError));
    31383138            Log(("Current stack %08x\n", &rc));
    3139            
     3139
    31403140            pVM->hwaccm.s.vmx.lasterror.ulLastInstrError = instrError;
    31413141            pVM->hwaccm.s.vmx.lasterror.ulLastExitReason = exitReason;
  • trunk/src/VBox/VMM/VMReq.cpp

    r13782 r13796  
    638638                do
    639639                {
    640                     pNext = pUVM->aCpu[i].vm.s.pReqs;
     640                    pNext = pUVM->aCpus[i].vm.s.pReqs;
    641641                    pReq->pNext = pNext;
    642                 } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pUVM->aCpu[i].vm.s.pReqs, (void *)pReq, (void *)pNext));
     642                } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pUVM->aCpus[i].vm.s.pReqs, (void *)pReq, (void *)pNext));
    643643
    644644                /*
     
    683683        do
    684684        {
    685             pNext = pUVM->aCpu[idTarget].vm.s.pReqs;
     685            pNext = pUVM->aCpus[idTarget].vm.s.pReqs;
    686686            pReq->pNext = pNext;
    687         } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pUVM->aCpu[idTarget].vm.s.pReqs, (void *)pReq, (void *)pNext));
     687        } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pUVM->aCpus[idTarget].vm.s.pReqs, (void *)pReq, (void *)pNext));
    688688
    689689        /*
     
    703703        LogFlow(("VMR3ReqQueue: returns %Vrc\n", rc));
    704704    }
    705     else
    706     if (    pReq->enmDest == VMREQDEST_ANY
    707         &&  !pUVMCPU /* only EMT threads have a valid pointer stored in the TLS slot. */)
     705    else if (    pReq->enmDest == VMREQDEST_ANY
     706             &&  !pUVMCPU /* only EMT threads have a valid pointer stored in the TLS slot. */)
    708707    {
    709708        unsigned fFlags = ((VMREQ volatile *)pReq)->fFlags;     /* volatile paranoia */
     
    838837    while (rc <= VINF_SUCCESS)
    839838    {
    840         void *volatile *ppReqs;
    841 
    842839        /*
    843840         * Get pending requests.
    844841         */
     842        void *volatile *ppReqs;
    845843        if (enmDest == VMREQDEST_ANY)
    846844        {
     
    851849        else
    852850        {
    853             ppReqs = (void * volatile *)&pUVM->aCpu[enmDest].vm.s.pReqs;
     851            ppReqs = (void * volatile *)&pUVM->aCpus[enmDest].vm.s.pReqs;
    854852            if (RT_LIKELY(pUVM->pVM))
    855853                VMCPU_FF_CLEAR(pUVM->pVM, enmDest, VM_FF_REQUEST);
  • trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp

    r13751 r13796  
    173173    CHECK_MEMBER_ALIGNMENT(VM, rem.s.StatsInQEMU, 8);
    174174    CHECK_MEMBER_ALIGNMENT(VM, rem.s.Env, 32);
    175     CHECK_MEMBER_ALIGNMENT(VM, aCpu, 64);
     175    CHECK_MEMBER_ALIGNMENT(VM, aCpus, 64);
    176176
    177177    /* vmcpu */
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