VirtualBox

Changeset 18927 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Apr 16, 2009 11:41:38 AM (16 years ago)
Author:
vboxsync
Message:

Big step to separate VMM data structures for guest SMP. (pgm, em)

Location:
trunk/src/VBox/VMM/VMMR0
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/CPUMR0.cpp

    r16776 r18927  
    222222
    223223        /* If we sync the FPU/XMM state on-demand, then we can continue execution as if nothing has happened. */
    224         int rc = CPUMHandleLazyFPU(pVM, pVCpu);
     224        int rc = CPUMHandleLazyFPU(pVCpu);
    225225        AssertRC(rc);
    226226        Assert(CPUMIsGuestFPUStateActive(pVCpu));
  • trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp

    r18008 r18927  
    954954    ASMAtomicWriteBool(&pCpu->fInUse, true);
    955955
    956     pCtx = CPUMQueryGuestCtxPtrEx(pVM, pVCpu);
     956    pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    957957
    958958    /* Always load the guest's FPU/XMM state on-demand. */
    959     CPUMDeactivateGuestFPUState(pVM);
     959    CPUMDeactivateGuestFPUState(pVCpu);
    960960
    961961    /* Always load the guest's debug state on-demand. */
    962     CPUMDeactivateGuestDebugState(pVM);
     962    CPUMDeactivateGuestDebugState(pVCpu);
    963963
    964964    /* Always reload the host context and the guest's CR0 register. (!!!!) */
     
    10091009    AssertReturn(!ASMAtomicReadBool(&HWACCMR0Globals.fSuspended), VERR_HWACCM_SUSPEND_PENDING);
    10101010
    1011     pCtx = CPUMQueryGuestCtxPtrEx(pVM, pVCpu);
     1011    pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    10121012
    10131013    /* Note:  It's rather tricky with longjmps done by e.g. Log statements or the page fault handler.
     
    10671067#endif
    10681068
    1069     pCtx = CPUMQueryGuestCtxPtrEx(pVM, pVCpu);
     1069    pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    10701070
    10711071    rc = HWACCMR0Globals.pfnRunGuestCode(pVM, pVCpu, pCtx);
     
    11241124    int      rc;
    11251125
    1126     pCtx = CPUMQueryGuestCtxPtrEx(pVM, pVCpu);
     1126    pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    11271127
    11281128    STAM_PROFILE_ADV_START(&pVCpu->hwaccm.s.StatWorldSwitch3264, z);   
     
    13741374 *
    13751375 * @param   pVM         The VM to operate on.
     1376 * @param   pVCpu       The VMCPU to operate on.
    13761377 * @param   pCtx        The context to format.
    13771378 */
    1378 VMMR0DECL(void) HWACCMDumpRegs(PVM pVM, PCPUMCTX pCtx)
     1379VMMR0DECL(void) HWACCMDumpRegs(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
    13791380{
    13801381    /*
     
    14211422     * Format the registers.
    14221423     */
    1423     if (CPUMIsGuestIn64BitCode(pVM, CPUMCTX2CORE(pCtx)))
     1424    if (CPUMIsGuestIn64BitCode(pVCpu, CPUMCTX2CORE(pCtx)))
    14241425    {
    14251426        Log(("rax=%016RX64 rbx=%016RX64 rcx=%016RX64 rdx=%016RX64\n"
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r18781 r18927  
    4949*   Internal Functions                                                         *
    5050*******************************************************************************/
    51 static int SVMR0InterpretInvpg(PVM pVM, PCPUMCTXCORE pRegFrame, uint32_t uASID);
     51static int SVMR0InterpretInvpg(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t uASID);
    5252
    5353/*******************************************************************************
     
    671671                enmShwPagingMode = PGMGetHostMode(pVM);
    672672
    673             pVMCB->ctrl.u64NestedPagingCR3  = PGMGetNestedCR3(pVM, enmShwPagingMode);
     673            pVMCB->ctrl.u64NestedPagingCR3  = PGMGetNestedCR3(pVCpu, enmShwPagingMode);
    674674            Assert(pVMCB->ctrl.u64NestedPagingCR3);
    675675            pVMCB->guest.u64CR3             = pCtx->cr3;
     
    677677        else
    678678        {
    679             pVMCB->guest.u64CR3             = PGMGetHyperCR3(pVM);
     679            pVMCB->guest.u64CR3             = PGMGetHyperCR3(pVCpu);
    680680            Assert(pVMCB->guest.u64CR3 || VM_FF_ISPENDING(pVM, VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL));
    681681        }
     
    736736        /* Sync the debug state now if any breakpoint is armed. */
    737737        if (    (pCtx->dr[7] & (X86_DR7_ENABLED_MASK|X86_DR7_GD))
    738             &&  !CPUMIsGuestDebugStateActive(pVM)
     738            &&  !CPUMIsGuestDebugStateActive(pVCpu)
    739739            &&  !DBGFIsStepping(pVM))
    740740        {
     
    869869    if (VM_FF_ISSET(pVM, VM_FF_INHIBIT_INTERRUPTS))
    870870    {
    871         Log(("VM_FF_INHIBIT_INTERRUPTS at %RGv successor %RGv\n", (RTGCPTR)pCtx->rip, EMGetInhibitInterruptsPC(pVM)));
    872         if (pCtx->rip != EMGetInhibitInterruptsPC(pVM))
     871        Log(("VM_FF_INHIBIT_INTERRUPTS at %RGv successor %RGv\n", (RTGCPTR)pCtx->rip, EMGetInhibitInterruptsPC(pVM, pVCpu)));
     872        if (pCtx->rip != EMGetInhibitInterruptsPC(pVM, pVCpu))
    873873        {
    874874            /* Note: we intentionally don't clear VM_FF_INHIBIT_INTERRUPTS here.
     
    10711071    if (exitCode == (uint64_t)SVM_EXIT_INVALID)          /* Invalid guest state. */
    10721072    {
    1073         HWACCMDumpRegs(pVM, pCtx);
     1073        HWACCMDumpRegs(pVM, pVCpu, pCtx);
    10741074#ifdef DEBUG
    10751075        Log(("ctrl.u16InterceptRdCRx            %x\n",      pVMCB->ctrl.u16InterceptRdCRx));
     
    12351235        &&  pCtx->cr3 != pVMCB->guest.u64CR3)
    12361236    {
    1237         CPUMSetGuestCR3(pVM, pVMCB->guest.u64CR3);
    1238         PGMUpdateCR3(pVM, pVMCB->guest.u64CR3);
     1237        CPUMSetGuestCR3(pVCpu, pVMCB->guest.u64CR3);
     1238        PGMUpdateCR3(pVM, pVCpu, pVMCB->guest.u64CR3);
    12391239    }
    12401240
     
    12451245    {
    12461246        Log(("uInterruptState %x rip=%RGv\n", pVMCB->ctrl.u64IntShadow, (RTGCPTR)pCtx->rip));
    1247         EMSetInhibitInterruptsPC(pVM, pCtx->rip);
     1247        EMSetInhibitInterruptsPC(pVM, pVCpu, pCtx->rip);
    12481248    }
    12491249    else
     
    14131413
    14141414            /* Forward it to our trap handler first, in case our shadow pages are out of sync. */
    1415             rc = PGMTrap0eHandler(pVM, errCode, CPUMCTX2CORE(pCtx), (RTGCPTR)uFaultAddress);
     1415            rc = PGMTrap0eHandler(pVM, pVCpu, errCode, CPUMCTX2CORE(pCtx), (RTGCPTR)uFaultAddress);
    14161416            Log2(("PGMTrap0eHandler %RGv returned %Rrc\n", (RTGCPTR)pCtx->rip, rc));
    14171417            if (rc == VINF_SUCCESS)
     
    15581558            enmShwPagingMode = PGMGetHostMode(pVM);
    15591559
    1560         rc = PGMR0Trap0eHandlerNestedPaging(pVM, enmShwPagingMode, errCode, CPUMCTX2CORE(pCtx), uFaultAddress);
     1560        rc = PGMR0Trap0eHandlerNestedPaging(pVM, pVCpu, enmShwPagingMode, errCode, CPUMCTX2CORE(pCtx), uFaultAddress);
    15611561        Log2(("PGMR0Trap0eHandlerNestedPaging %RGv returned %Rrc\n", (RTGCPTR)pCtx->rip, rc));
    15621562        if (rc == VINF_SUCCESS)
     
    16091609        Log2(("SVM: Cpuid at %RGv for %x\n", (RTGCPTR)pCtx->rip, pCtx->eax));
    16101610        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCpuid);
    1611         rc = EMInterpretCpuId(pVM, CPUMCTX2CORE(pCtx));
     1611        rc = EMInterpretCpuId(pVM, pVCpu, CPUMCTX2CORE(pCtx));
    16121612        if (rc == VINF_SUCCESS)
    16131613        {
     
    16261626        Log2(("SVM: Rdtsc\n"));
    16271627        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitRdtsc);
    1628         rc = EMInterpretRdtsc(pVM, CPUMCTX2CORE(pCtx));
     1628        rc = EMInterpretRdtsc(pVM, pVCpu, CPUMCTX2CORE(pCtx));
    16291629        if (rc == VINF_SUCCESS)
    16301630        {
     
    16421642        Log2(("SVM: Rdpmc %x\n", pCtx->ecx));
    16431643        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitRdpmc);
    1644         rc = EMInterpretRdpmc(pVM, CPUMCTX2CORE(pCtx));
     1644        rc = EMInterpretRdpmc(pVM, pVCpu, CPUMCTX2CORE(pCtx));
    16451645        if (rc == VINF_SUCCESS)
    16461646        {
     
    16571657        Log2(("SVM: Rdtscp\n"));
    16581658        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitRdtsc);
    1659         rc = EMInterpretRdtscp(pVM, pCtx);
     1659        rc = EMInterpretRdtscp(pVM, pVCpu, pCtx);
    16601660        if (rc == VINF_SUCCESS)
    16611661        {
     
    16781678
    16791679        /* Truly a pita. Why can't SVM give the same information as VT-x? */
    1680         rc = SVMR0InterpretInvpg(pVM, CPUMCTX2CORE(pCtx), pVMCB->ctrl.TLBCtrl.n.u32ASID);
     1680        rc = SVMR0InterpretInvpg(pVM, pVCpu, CPUMCTX2CORE(pCtx), pVMCB->ctrl.TLBCtrl.n.u32ASID);
    16811681        if (rc == VINF_SUCCESS)
    16821682        {
     
    16961696        Log2(("SVM: %RGv mov cr%d, \n", (RTGCPTR)pCtx->rip, exitCode - SVM_EXIT_WRITE_CR0));
    16971697        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxWrite[exitCode - SVM_EXIT_WRITE_CR0]);
    1698         rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
     1698        rc = EMInterpretInstruction(pVM, pVCpu, CPUMCTX2CORE(pCtx), 0, &cbSize);
    16991699
    17001700        switch (exitCode - SVM_EXIT_WRITE_CR0)
     
    17211721            &&  VM_FF_ISPENDING(pVM, VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL))
    17221722        {
    1723             rc = PGMSyncCR3(pVM, CPUMGetGuestCR0(pVM), CPUMGetGuestCR3(pVM), CPUMGetGuestCR4(pVM), VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3));
     1723            rc = PGMSyncCR3(pVM, pVCpu, pCtx->cr0, pCtx->cr3, pCtx->cr4, VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3));
    17241724            AssertRC(rc);
    17251725
     
    17271727
    17281728            /* Must be set by PGMSyncCR3 */
    1729             Assert(rc != VINF_SUCCESS || PGMGetGuestMode(pVM) <= PGMMODE_PROTECTED || pVCpu->hwaccm.s.fForceTLBFlush);
     1729            Assert(rc != VINF_SUCCESS || PGMGetGuestMode(pVCpu) <= PGMMODE_PROTECTED || pVCpu->hwaccm.s.fForceTLBFlush);
    17301730        }
    17311731        if (rc == VINF_SUCCESS)
     
    17501750        Log2(("SVM: %RGv mov x, cr%d\n", (RTGCPTR)pCtx->rip, exitCode - SVM_EXIT_READ_CR0));
    17511751        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxRead[exitCode - SVM_EXIT_READ_CR0]);
    1752         rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
     1752        rc = EMInterpretInstruction(pVM, pVCpu, CPUMCTX2CORE(pCtx), 0, &cbSize);
    17531753        if (rc == VINF_SUCCESS)
    17541754        {
     
    17891789        }
    17901790
    1791         rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
     1791        rc = EMInterpretInstruction(pVM, pVCpu, CPUMCTX2CORE(pCtx), 0, &cbSize);
    17921792        if (rc == VINF_SUCCESS)
    17931793        {
     
    18291829        }
    18301830
    1831         rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
     1831        rc = EMInterpretInstruction(pVM, pVCpu, CPUMCTX2CORE(pCtx), 0, &cbSize);
    18321832        if (rc == VINF_SUCCESS)
    18331833        {
     
    18811881
    18821882            /* Disassemble manually to deal with segment prefixes. */
    1883             rc = EMInterpretDisasOne(pVM, CPUMCTX2CORE(pCtx), &Cpu, NULL);
     1883            rc = EMInterpretDisasOne(pVM, pVCpu, CPUMCTX2CORE(pCtx), &Cpu, NULL);
    18841884            if (rc == VINF_SUCCESS)
    18851885            {
     
    19491949                            SVM_EVENT Event;
    19501950
    1951                             Assert(CPUMIsGuestDebugStateActive(pVM));
     1951                            Assert(CPUMIsGuestDebugStateActive(pVCpu));
    19521952
    19531953                            /* Clear all breakpoint status flags and set the one we just hit. */
     
    20482048        /* Note: the intel manual claims there's a REX version of RDMSR that's slightly different, so we play safe by completely disassembling the instruction. */
    20492049        Log(("SVM: %s\n", (pVMCB->ctrl.u64ExitInfo1 == 0) ? "rdmsr" : "wrmsr"));
    2050         rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
     2050        rc = EMInterpretInstruction(pVM, pVCpu, CPUMCTX2CORE(pCtx), 0, &cbSize);
    20512051        if (rc == VINF_SUCCESS)
    20522052        {
     
    20922092
    20932093    /* Signal changes for the recompiler. */
    2094     CPUMSetChangedFlags(pVM, CPUM_CHANGED_SYSENTER_MSR | CPUM_CHANGED_LDTR | CPUM_CHANGED_GDTR | CPUM_CHANGED_IDTR | CPUM_CHANGED_TR | CPUM_CHANGED_HIDDEN_SEL_REGS);
     2094    CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_SYSENTER_MSR | CPUM_CHANGED_LDTR | CPUM_CHANGED_GDTR | CPUM_CHANGED_IDTR | CPUM_CHANGED_TR | CPUM_CHANGED_HIDDEN_SEL_REGS);
    20952095
    20962096    /* If we executed vmrun and an external irq was pending, then we don't have to do a full sync the next time. */
     
    21542154
    21552155    /* Save the guest debug state if necessary. */
    2156     if (CPUMIsGuestDebugStateActive(pVM))
     2156    if (CPUMIsGuestDebugStateActive(pVCpu))
    21572157    {
    21582158        CPUMR0SaveGuestDebugState(pVM, pVCpu, pCtx, false /* skip DR6 */);
     
    21722172
    21732173
    2174 static int svmR0InterpretInvlPg(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, uint32_t uASID)
     2174static int svmR0InterpretInvlPg(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, uint32_t uASID)
    21752175{
    21762176    OP_PARAMVAL param1;
     
    21972197     * (in absence of segment override prefixes)????
    21982198     */
    2199     rc = PGMInvalidatePage(pVM, addr);
     2199    rc = PGMInvalidatePage(pVM, pVCpu, addr);
    22002200    if (RT_SUCCESS(rc))
    22012201    {
     
    22232223 *                      Updates the EIP if an instruction was executed successfully.
    22242224 */
    2225 static int SVMR0InterpretInvpg(PVM pVM, PCPUMCTXCORE pRegFrame, uint32_t uASID)
     2225static int SVMR0InterpretInvpg(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t uASID)
    22262226{
    22272227    /*
     
    22392239
    22402240            Cpu.mode = enmMode;
    2241             rc = EMInterpretDisasOneEx(pVM, pbCode, pRegFrame, &Cpu, &cbOp);
     2241            rc = EMInterpretDisasOneEx(pVM, pVCpu, pbCode, pRegFrame, &Cpu, &cbOp);
    22422242            Assert(RT_FAILURE(rc) || Cpu.pCurInstr->opcode == OP_INVLPG);
    22432243            if (RT_SUCCESS(rc) && Cpu.pCurInstr->opcode == OP_INVLPG)
    22442244            {
    22452245                Assert(cbOp == Cpu.opsize);
    2246                 rc = svmR0InterpretInvlPg(pVM, &Cpu, pRegFrame, uASID);
     2246                rc = svmR0InterpretInvlPg(pVM, pVCpu, &Cpu, pRegFrame, uASID);
    22472247                if (RT_SUCCESS(rc))
    22482248                {
     
    22852285#if HC_ARCH_BITS == 32
    22862286        /* If we get a flush in 64 bits guest mode, then force a full TLB flush. Invlpga takes only 32 bits addresses. */
    2287         if (CPUMIsGuestInLongMode(pVM))
     2287        if (CPUMIsGuestInLongMode(pVCpu))
    22882288            pVCpu->hwaccm.s.fForceTLBFlush = true;
    22892289        else
     
    23512351    RTHCUINTREG     uFlags;
    23522352
    2353     /* @todo This code is not guest SMP safe (hyper context) */
     2353    /* @todo This code is not guest SMP safe (hyper stack) */
    23542354    AssertReturn(pVM->cCPUs == 1, VERR_ACCESS_DENIED);
    23552355    Assert(pfnHandler);
     
    23572357    uFlags = ASMIntDisableFlags();
    23582358
    2359     CPUMSetHyperESP(pVM, VMMGetStackRC(pVM));
    2360     CPUMSetHyperEIP(pVM, pfnHandler);
     2359    CPUMSetHyperESP(pVCpu, VMMGetStackRC(pVM));
     2360    CPUMSetHyperEIP(pVCpu, pfnHandler);
    23612361    for (int i=(int)cbParam-1;i>=0;i--)
    2362         CPUMPushHyper(pVM, paParam[i]);
     2362        CPUMPushHyper(pVCpu, paParam[i]);
    23632363
    23642364    STAM_PROFILE_ADV_START(&pVCpu->hwaccm.s.StatWorldSwitch3264, z);
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r18781 r18927  
    10561056        for (unsigned i=0;i<4;i++)
    10571057        {
    1058             Pdpe = PGMGstGetPaePDPtr(pVM, i);
     1058            Pdpe = PGMGstGetPaePDPtr(pVCpu, i);
    10591059            int rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR0_FULL + i*2, Pdpe.u);
    10601060            AssertRC(rc);
     
    11811181        if (pVM->hwaccm.s.vmx.pRealModeTSS)
    11821182        {
    1183             PGMMODE enmGuestMode = PGMGetGuestMode(pVM);
     1183            PGMMODE enmGuestMode = PGMGetGuestMode(pVCpu);
    11841184            if (pVCpu->hwaccm.s.vmx.enmLastSeenGuestMode != enmGuestMode)
    11851185            {
     
    14911491        if (pVM->hwaccm.s.fNestedPaging)
    14921492        {
    1493             Assert(PGMGetHyperCR3(pVM));
    1494             pVCpu->hwaccm.s.vmx.GCPhysEPTP = PGMGetHyperCR3(pVM);
     1493            Assert(PGMGetHyperCR3(pVCpu));
     1494            pVCpu->hwaccm.s.vmx.GCPhysEPTP = PGMGetHyperCR3(pVCpu);
    14951495
    14961496            Assert(!(pVCpu->hwaccm.s.vmx.GCPhysEPTP & 0xfff));
     
    15251525        else
    15261526        {
    1527             val = PGMGetHyperCR3(pVM);
     1527            val = PGMGetHyperCR3(pVCpu);
    15281528            Assert(val || VM_FF_ISPENDING(pVM, VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL));
    15291529        }
     
    15501550        /* Sync the debug state now if any breakpoint is armed. */
    15511551        if (    (pCtx->dr[7] & (X86_DR7_ENABLED_MASK|X86_DR7_GD))
    1552             &&  !CPUMIsGuestDebugStateActive(pVM)
     1552            &&  !CPUMIsGuestDebugStateActive(pVCpu)
    15531553            &&  !DBGFIsStepping(pVM))
    15541554        {
     
    16931693        Assert(uInterruptState <= 2);    /* only sti & mov ss */
    16941694        Log(("uInterruptState %x eip=%RGv\n", uInterruptState, pCtx->rip));
    1695         EMSetInhibitInterruptsPC(pVM, pCtx->rip);
     1695        EMSetInhibitInterruptsPC(pVM, pVCpu, pCtx->rip);
    16961696    }
    16971697    else
     
    17021702    VMXReadCachedVMCS(VMX_VMCS64_GUEST_CR0,              &val);
    17031703    val = (valShadow & pVCpu->hwaccm.s.vmx.cr0_mask) | (val & ~pVCpu->hwaccm.s.vmx.cr0_mask);
    1704     CPUMSetGuestCR0(pVM, val);
     1704    CPUMSetGuestCR0(pVCpu, val);
    17051705
    17061706    VMXReadCachedVMCS(VMX_VMCS_CTRL_CR4_READ_SHADOW,     &valShadow);
    17071707    VMXReadCachedVMCS(VMX_VMCS64_GUEST_CR4,              &val);
    17081708    val = (valShadow & pVCpu->hwaccm.s.vmx.cr4_mask) | (val & ~pVCpu->hwaccm.s.vmx.cr4_mask);
    1709     CPUMSetGuestCR4(pVM, val);
     1709    CPUMSetGuestCR4(pVCpu, val);
    17101710
    17111711    /* Note: no reason to sync back the CRx registers. They can't be changed by the guest. */
     
    17171717
    17181718        /* Can be updated behind our back in the nested paging case. */
    1719         CPUMSetGuestCR2(pVM, pCache->cr2);
     1719        CPUMSetGuestCR2(pVCpu, pCache->cr2);
    17201720
    17211721        VMXReadCachedVMCS(VMX_VMCS64_GUEST_CR3, &val);
     
    17231723        if (val != pCtx->cr3)
    17241724        {
    1725             CPUMSetGuestCR3(pVM, val);
    1726             PGMUpdateCR3(pVM, val);
     1725            CPUMSetGuestCR3(pVCpu, val);
     1726            PGMUpdateCR3(pVM, pVCpu, val);
    17271727        }
    17281728        /* Prefetch the four PDPT entries in PAE mode. */
     
    20362036    if (VM_FF_ISSET(pVM, VM_FF_INHIBIT_INTERRUPTS))
    20372037    {
    2038         Log(("VM_FF_INHIBIT_INTERRUPTS at %RGv successor %RGv\n", (RTGCPTR)pCtx->rip, EMGetInhibitInterruptsPC(pVM)));
    2039         if (pCtx->rip != EMGetInhibitInterruptsPC(pVM))
     2038        Log(("VM_FF_INHIBIT_INTERRUPTS at %RGv successor %RGv\n", (RTGCPTR)pCtx->rip, EMGetInhibitInterruptsPC(pVM, pVCpu)));
     2039        if (pCtx->rip != EMGetInhibitInterruptsPC(pVM, pVCpu))
    20402040        {
    20412041            /* Note: we intentionally don't clear VM_FF_INHIBIT_INTERRUPTS here.
     
    22762276
    22772277    if (exitReason == VMX_EXIT_ERR_INVALID_GUEST_STATE)
    2278         HWACCMDumpRegs(pVM, pCtx);
     2278        HWACCMDumpRegs(pVM, pVCpu, pCtx);
    22792279#endif
    22802280
     
    23882388
    23892389                /* Forward it to our trap handler first, in case our shadow pages are out of sync. */
    2390                 rc = PGMTrap0eHandler(pVM, errCode, CPUMCTX2CORE(pCtx), (RTGCPTR)exitQualification);
     2390                rc = PGMTrap0eHandler(pVM, pVCpu, errCode, CPUMCTX2CORE(pCtx), (RTGCPTR)exitQualification);
    23912391                Log2(("PGMTrap0eHandler %RGv returned %Rrc\n", (RTGCPTR)pCtx->rip, rc));
    23922392                if (rc == VINF_SUCCESS)
     
    25382538                LogFlow(("Real mode X86_XCPT_GP instruction emulation at %RGv\n", (RTGCPTR)pCtx->rip));
    25392539
    2540                 rc = EMInterpretDisasOne(pVM, CPUMCTX2CORE(pCtx), &Cpu, &cbOp);
     2540                rc = EMInterpretDisasOne(pVM, pVCpu, CPUMCTX2CORE(pCtx), &Cpu, &cbOp);
    25412541                if (RT_SUCCESS(rc))
    25422542                {
     
    27352735
    27362736                    default:
    2737                         rc = EMInterpretInstructionCPU(pVM, &Cpu, CPUMCTX2CORE(pCtx), 0, &cbSize);
     2737                        rc = EMInterpretInstructionCPU(pVM, pVCpu, &Cpu, CPUMCTX2CORE(pCtx), 0, &cbSize);
    27382738                        break;
    27392739                    }
     
    28532853
    28542854        /* Handle the pagefault trap for the nested shadow table. */
    2855         rc = PGMR0Trap0eHandlerNestedPaging(pVM, PGMMODE_EPT, errCode, CPUMCTX2CORE(pCtx), GCPhys);
     2855        rc = PGMR0Trap0eHandlerNestedPaging(pVM, pVCpu, PGMMODE_EPT, errCode, CPUMCTX2CORE(pCtx), GCPhys);
    28562856        Log2(("PGMR0Trap0eHandlerNestedPaging %RGv returned %Rrc\n", (RTGCPTR)pCtx->rip, rc));
    28572857        if (rc == VINF_SUCCESS)
     
    29082908        Log2(("VMX: Cpuid %x\n", pCtx->eax));
    29092909        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCpuid);
    2910         rc = EMInterpretCpuId(pVM, CPUMCTX2CORE(pCtx));
     2910        rc = EMInterpretCpuId(pVM, pVCpu, CPUMCTX2CORE(pCtx));
    29112911        if (rc == VINF_SUCCESS)
    29122912        {
     
    29252925        Log2(("VMX: Rdpmc %x\n", pCtx->ecx));
    29262926        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitRdpmc);
    2927         rc = EMInterpretRdpmc(pVM, CPUMCTX2CORE(pCtx));
     2927        rc = EMInterpretRdpmc(pVM, pVCpu, CPUMCTX2CORE(pCtx));
    29282928        if (rc == VINF_SUCCESS)
    29292929        {
     
    29412941        Log2(("VMX: Rdtsc\n"));
    29422942        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitRdtsc);
    2943         rc = EMInterpretRdtsc(pVM, CPUMCTX2CORE(pCtx));
     2943        rc = EMInterpretRdtsc(pVM, pVCpu, CPUMCTX2CORE(pCtx));
    29442944        if (rc == VINF_SUCCESS)
    29452945        {
     
    29592959
    29602960        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitInvpg);
    2961         rc = EMInterpretInvlpg(pVM, CPUMCTX2CORE(pCtx), exitQualification);
     2961        rc = EMInterpretInvlpg(pVM, pVCpu, CPUMCTX2CORE(pCtx), exitQualification);
    29622962        if (rc == VINF_SUCCESS)
    29632963        {
     
    29772977        /* Note: the intel manual claims there's a REX version of RDMSR that's slightly different, so we play safe by completely disassembling the instruction. */
    29782978        Log2(("VMX: %s\n", (exitReason == VMX_EXIT_RDMSR) ? "rdmsr" : "wrmsr"));
    2979         rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
     2979        rc = EMInterpretInstruction(pVM, pVCpu, CPUMCTX2CORE(pCtx), 0, &cbSize);
    29802980        if (rc == VINF_SUCCESS)
    29812981        {
     
    29982998            Log2(("VMX: %RGv mov cr%d, x\n", (RTGCPTR)pCtx->rip, VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification)));
    29992999            STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxWrite[VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification)]);
    3000             rc = EMInterpretCRxWrite(pVM, CPUMCTX2CORE(pCtx),
     3000            rc = EMInterpretCRxWrite(pVM, pVCpu, CPUMCTX2CORE(pCtx),
    30013001                                     VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification),
    30023002                                     VMX_EXIT_QUALIFICATION_CRX_GENREG(exitQualification));
     
    30293029                &&  VM_FF_ISPENDING(pVM, VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL))
    30303030            {
    3031                 rc = PGMSyncCR3(pVM, CPUMGetGuestCR0(pVM), CPUMGetGuestCR3(pVM), CPUMGetGuestCR4(pVM), VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3));
     3031                rc = PGMSyncCR3(pVM, pVCpu, pCtx->cr0, pCtx->cr3, pCtx->cr4, VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3));
    30323032                AssertRC(rc);
    30333033            }
     
    30433043            Assert(VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification) != 8 || !(pVM->hwaccm.s.vmx.msr.vmx_proc_ctls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_TPR_SHADOW));
    30443044
    3045             rc = EMInterpretCRxRead(pVM, CPUMCTX2CORE(pCtx),
     3045            rc = EMInterpretCRxRead(pVM, pVCpu, CPUMCTX2CORE(pCtx),
    30463046                                    VMX_EXIT_QUALIFICATION_CRX_GENREG(exitQualification),
    30473047                                    VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification));
     
    30513051            Log2(("VMX: clts\n"));
    30523052            STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCLTS);
    3053             rc = EMInterpretCLTS(pVM);
     3053            rc = EMInterpretCLTS(pVM, pVCpu);
    30543054            pVCpu->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_GUEST_CR0;
    30553055            break;
     
    30583058            Log2(("VMX: lmsw %x\n", VMX_EXIT_QUALIFICATION_CRX_LMSW_DATA(exitQualification)));
    30593059            STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitLMSW);
    3060             rc = EMInterpretLMSW(pVM, CPUMCTX2CORE(pCtx), VMX_EXIT_QUALIFICATION_CRX_LMSW_DATA(exitQualification));
     3060            rc = EMInterpretLMSW(pVM, pVCpu, CPUMCTX2CORE(pCtx), VMX_EXIT_QUALIFICATION_CRX_LMSW_DATA(exitQualification));
    30613061            pVCpu->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_GUEST_CR0;
    30623062            break;
     
    31073107            Log2(("VMX: mov drx%d, genreg%d\n", VMX_EXIT_QUALIFICATION_DRX_REGISTER(exitQualification), VMX_EXIT_QUALIFICATION_DRX_GENREG(exitQualification)));
    31083108            STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitDRxWrite);
    3109             rc = EMInterpretDRxWrite(pVM, CPUMCTX2CORE(pCtx),
     3109            rc = EMInterpretDRxWrite(pVM, pVCpu, CPUMCTX2CORE(pCtx),
    31103110                                     VMX_EXIT_QUALIFICATION_DRX_REGISTER(exitQualification),
    31113111                                     VMX_EXIT_QUALIFICATION_DRX_GENREG(exitQualification));
     
    31173117            Log2(("VMX: mov x, drx\n"));
    31183118            STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitDRxRead);
    3119             rc = EMInterpretDRxRead(pVM, CPUMCTX2CORE(pCtx),
     3119            rc = EMInterpretDRxRead(pVM, pVCpu, CPUMCTX2CORE(pCtx),
    31203120                                    VMX_EXIT_QUALIFICATION_DRX_GENREG(exitQualification),
    31213121                                    VMX_EXIT_QUALIFICATION_DRX_REGISTER(exitQualification));
     
    31683168            /** @todo VMX_VMCS_EXIT_GUEST_LINEAR_ADDR contains the flat pointer operand of the instruction. */
    31693169            /** @todo VMX_VMCS32_RO_EXIT_INSTR_INFO also contains segment prefix info. */
    3170             rc = EMInterpretDisasOne(pVM, CPUMCTX2CORE(pCtx), &Cpu, NULL);
     3170            rc = EMInterpretDisasOne(pVM, pVCpu, CPUMCTX2CORE(pCtx), &Cpu, NULL);
    31713171            if (rc == VINF_SUCCESS)
    31723172            {
     
    32363236                            uint64_t uDR6;
    32373237
    3238                             Assert(CPUMIsGuestDebugStateActive(pVM));
     3238                            Assert(CPUMIsGuestDebugStateActive(pVCpu));
    32393239
    32403240                            uDR6 = ASMGetDR6();
     
    34593459
    34603460    /* Signal changes for the recompiler. */
    3461     CPUMSetChangedFlags(pVM, CPUM_CHANGED_SYSENTER_MSR | CPUM_CHANGED_LDTR | CPUM_CHANGED_GDTR | CPUM_CHANGED_IDTR | CPUM_CHANGED_TR | CPUM_CHANGED_HIDDEN_SEL_REGS);
     3461    CPUMSetChangedFlags(pVCpu, CPUM_CHANGED_SYSENTER_MSR | CPUM_CHANGED_LDTR | CPUM_CHANGED_GDTR | CPUM_CHANGED_IDTR | CPUM_CHANGED_TR | CPUM_CHANGED_HIDDEN_SEL_REGS);
    34623462
    34633463    /* If we executed vmlaunch/vmresume and an external irq was pending, then we don't have to do a full sync the next time. */
     
    35413541
    35423542    /* Save the guest debug state if necessary. */
    3543     if (CPUMIsGuestDebugStateActive(pVM))
     3543    if (CPUMIsGuestDebugStateActive(pVCpu))
    35443544    {
    35453545        CPUMR0SaveGuestDebugState(pVM, pVCpu, pCtx, true /* save DR6 */);
     
    35983598#if HC_ARCH_BITS == 32
    35993599    /* If we get a flush in 64 bits guest mode, then force a full TLB flush. Invvpid probably takes only 32 bits addresses. (@todo) */
    3600     if (   CPUMIsGuestInLongMode(pVM)
     3600    if (   CPUMIsGuestInLongMode(pVCpu)
    36013601        && !VMX_IS_64BIT_HOST_MODE())
    36023602    {
     
    39193919    RTHCPHYS        pPageCpuPhys;
    39203920
    3921     /* @todo This code is not guest SMP safe (hyper context) */
     3921    /* @todo This code is not guest SMP safe (hyper stack) */
    39223922    AssertReturn(pVM->cCPUs == 1, VERR_ACCESS_DENIED);
    39233923    AssertReturn(pVM->hwaccm.s.pfnHost32ToGuest64R0, VERR_INTERNAL_ERROR);
     
    39443944    ASMSetCR4(ASMGetCR4() & ~X86_CR4_VMXE);
    39453945
    3946     CPUMSetHyperESP(pVM, VMMGetStackRC(pVM));
    3947     CPUMSetHyperEIP(pVM, pfnHandler);
     3946    CPUMSetHyperESP(pVCpu, VMMGetStackRC(pVM));
     3947    CPUMSetHyperEIP(pVCpu, pfnHandler);
    39483948    for (int i=(int)cbParam-1;i>=0;i--)
    3949         CPUMPushHyper(pVM, paParam[i]);
     3949        CPUMPushHyper(pVCpu, paParam[i]);
    39503950
    39513951    STAM_PROFILE_ADV_START(&pVCpu->hwaccm.s.StatWorldSwitch3264, z);
  • trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp

    r18666 r18927  
    3030#include <VBox/mm.h>
    3131#include <VBox/vm.h>
     32#include <VBox/vmm.h>
    3233#include <VBox/patm.h>
    3334#include <VBox/hwaccm.h>
     
    7071static DECLCALLBACK(PVM)  pdmR0DevHlp_GetVM(PPDMDEVINS pDevIns);
    7172static DECLCALLBACK(bool) pdmR0DevHlp_CanEmulateIoBlock(PPDMDEVINS pDevIns);
     73static DECLCALLBACK(PVMCPU) pdmR0DevHlp_GetVMCPU(PPDMDEVINS pDevIns);
    7274/** @} */
    7375
     
    138140    pdmR0DevHlp_GetVM,
    139141    pdmR0DevHlp_CanEmulateIoBlock,
     142    pdmR0DevHlp_GetVMCPU,
    140143    PDM_DEVHLPR0_VERSION
    141144};
     
    286289    LogFlow(("pdmR0DevHlp_A20IsEnabled: caller=%p/%d:\n", pDevIns, pDevIns->iInstance));
    287290
    288     bool fEnabled = PGMPhysIsA20Enabled(pDevIns->Internal.s.pVMR0);
     291    bool fEnabled = PGMPhysIsA20Enabled(VMMGetCpu(pDevIns->Internal.s.pVMR0));
    289292
    290293    Log(("pdmR0DevHlp_A20IsEnabled: caller=%p/%d: returns %RTbool\n", pDevIns, pDevIns->iInstance, fEnabled));
     
    362365    PDMDEV_ASSERT_DEVINS(pDevIns);
    363366    LogFlow(("pdmR0DevHlp_GetVM: caller='%p'/%d\n", pDevIns, pDevIns->iInstance));
    364     return HWACCMCanEmulateIoBlock(pDevIns->Internal.s.pVMR0);
    365 }
    366 
     367    return HWACCMCanEmulateIoBlock(VMMGetCpu(pDevIns->Internal.s.pVMR0));
     368}
     369
     370
     371/** @copydoc PDMDEVHLPR0::pfnGetVMCPU */
     372static DECLCALLBACK(PVMCPU) pdmR0DevHlp_GetVMCPU(PPDMDEVINS pDevIns)
     373{
     374    PDMDEV_ASSERT_DEVINS(pDevIns);
     375    LogFlow(("pdmR0DevHlp_GetVMCPU: caller='%p'/%d\n", pDevIns, pDevIns->iInstance));
     376    return VMMGetCpu(pDevIns->Internal.s.pVMR0);
     377}
    367378
    368379
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r18617 r18927  
    168168 * @returns VBox status code (appropriate for trap handling and GC return).
    169169 * @param   pVM                 VM Handle.
     170 * @param   pVCpu               VMCPU Handle.
    170171 * @param   enmShwPagingMode    Paging mode for the nested page tables
    171172 * @param   uErr                The trap error code.
     
    173174 * @param   pvFault             The fault address.
    174175 */
    175 VMMR0DECL(int) PGMR0Trap0eHandlerNestedPaging(PVM pVM, PGMMODE enmShwPagingMode, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPHYS pvFault)
     176VMMR0DECL(int) PGMR0Trap0eHandlerNestedPaging(PVM pVM, PVMCPU pVCpu, PGMMODE enmShwPagingMode, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPHYS pvFault)
    176177{
    177178    int rc;
    178179
    179180    LogFlow(("PGMTrap0eHandler: uErr=%#x pvFault=%RGp eip=%RGv\n", uErr, pvFault, (RTGCPTR)pRegFrame->rip));
    180     STAM_PROFILE_START(&pVM->pgm.s.StatRZTrap0e, a);
    181     STAM_STATS({ pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = NULL; } );
     181    STAM_PROFILE_START(&pVCpu->pgm.s.StatRZTrap0e, a);
     182    STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = NULL; } );
    182183
    183184    /* AMD uses the host's paging mode; Intel has a single mode (EPT). */
     
    193194        {
    194195            if (uErr & X86_TRAP_PF_RW)
    195                 STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eUSNotPresentWrite);
     196                STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eUSNotPresentWrite);
    196197            else
    197                 STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eUSNotPresentRead);
     198                STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eUSNotPresentRead);
    198199        }
    199200        else if (uErr & X86_TRAP_PF_RW)
    200             STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eUSWrite);
     201            STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eUSWrite);
    201202        else if (uErr & X86_TRAP_PF_RSVD)
    202             STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eUSReserved);
     203            STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eUSReserved);
    203204        else if (uErr & X86_TRAP_PF_ID)
    204             STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eUSNXE);
     205            STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eUSNXE);
    205206        else
    206             STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eUSRead);
     207            STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eUSRead);
    207208    }
    208209    else
     
    211212        {
    212213            if (uErr & X86_TRAP_PF_RW)
    213                 STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eSVNotPresentWrite);
     214                STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eSVNotPresentWrite);
    214215            else
    215                 STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eSVNotPresentRead);
     216                STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eSVNotPresentRead);
    216217        }
    217218        else if (uErr & X86_TRAP_PF_RW)
    218             STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eSVWrite);
     219            STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eSVWrite);
    219220        else if (uErr & X86_TRAP_PF_ID)
    220             STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eSNXE);
     221            STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eSNXE);
    221222        else if (uErr & X86_TRAP_PF_RSVD)
    222             STAM_COUNTER_INC(&pVM->pgm.s.StatRZTrap0eSVReserved);
     223            STAM_COUNTER_INC(&pVCpu->pgm.s.StatRZTrap0eSVReserved);
    223224    }
    224225#endif
     
    233234    {
    234235    case PGMMODE_32_BIT:
    235         rc = PGM_BTH_NAME_32BIT_PROT(Trap0eHandler)(pVM, uErr, pRegFrame, pvFault);
     236        rc = PGM_BTH_NAME_32BIT_PROT(Trap0eHandler)(pVM, pVCpu, uErr, pRegFrame, pvFault);
    236237        break;
    237238    case PGMMODE_PAE:
    238239    case PGMMODE_PAE_NX:
    239         rc = PGM_BTH_NAME_PAE_PROT(Trap0eHandler)(pVM, uErr, pRegFrame, pvFault);
     240        rc = PGM_BTH_NAME_PAE_PROT(Trap0eHandler)(pVM, pVCpu, uErr, pRegFrame, pvFault);
    240241        break;
    241242    case PGMMODE_AMD64:
    242243    case PGMMODE_AMD64_NX:
    243         rc = PGM_BTH_NAME_AMD64_PROT(Trap0eHandler)(pVM, uErr, pRegFrame, pvFault);
     244        rc = PGM_BTH_NAME_AMD64_PROT(Trap0eHandler)(pVM, pVCpu, uErr, pRegFrame, pvFault);
    244245        break;
    245246    case PGMMODE_EPT:
    246         rc = PGM_BTH_NAME_EPT_PROT(Trap0eHandler)(pVM, uErr, pRegFrame, pvFault);
     247        rc = PGM_BTH_NAME_EPT_PROT(Trap0eHandler)(pVM, pVCpu, uErr, pRegFrame, pvFault);
    247248        break;
    248249    default:
     
    253254    if (rc == VINF_PGM_SYNCPAGE_MODIFIED_PDE)
    254255        rc = VINF_SUCCESS;
    255     STAM_STATS({ if (!pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution))
    256                     pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVM->pgm.s.StatRZTrap0eTime2Misc; });
    257     STAM_PROFILE_STOP_EX(&pVM->pgm.s.StatRZTrap0e, pVM->pgm.s.CTX_SUFF(pStatTrap0eAttribution), a);
     256    STAM_STATS({ if (!pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution))
     257                    pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.StatRZTrap0eTime2Misc; });
     258    STAM_PROFILE_STOP_EX(&pVCpu->pgm.s.StatRZTrap0e, pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution), a);
    258259    return rc;
    259260}
  • trunk/src/VBox/VMM/VMMR0/PGMR0Bth.h

    r8977 r18927  
    2525*******************************************************************************/
    2626__BEGIN_DECLS
    27 PGM_BTH_DECL(int, Trap0eHandler)(PVM pVM, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault);
     27PGM_BTH_DECL(int, Trap0eHandler)(PVM pVM, PVMCPU pVCpu, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault);
    2828__END_DECLS
    2929
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r18666 r18927  
    529529VMMR0DECL(void) VMMR0EntryFast(PVM pVM, unsigned idCpu, VMMR0OPERATION enmOperation)
    530530{
     531    PVMCPU pVCpu = &pVM->aCpus[idCpu];
     532
    531533    if (RT_UNLIKELY(idCpu >= pVM->cCPUs))
    532534    {
     
    551553
    552554#ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    553                 if (RT_UNLIKELY(!PGMGetHyperCR3(pVM)))
     555                if (RT_UNLIKELY(!PGMGetHyperCR3(pVCpu)))
    554556                {
    555557                    pVM->vmm.s.iLastGZRc = VERR_PGM_NO_CR3_SHADOW_ROOT;
     
    797799
    798800#ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    799             if (RT_UNLIKELY(!PGMGetHyperCR3(pVM)))
     801            if (RT_UNLIKELY(!PGMGetHyperCR3(VMMGetCpu0(pVM))))
    800802                return VERR_PGM_NO_CR3_SHADOW_ROOT;
    801803#endif
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