VirtualBox

Changeset 20979 in vbox


Ignore:
Timestamp:
Jun 26, 2009 2:56:03 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
49187
Message:

Cpu poke never worked in the VT-x/AMD-V case, because pVCpu->idHostCpu was never set.

Location:
trunk/src/VBox/VMM
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r20838 r20979  
    575575    /** Currenty shadow paging mode. */
    576576    PGMMODE                 enmShadowMode;
    577 
    578     /** The CPU ID of the CPU currently owning the VMCS. Set in
    579      * HWACCMR0Enter and cleared in HWACCMR0Leave. */
    580     RTCPUID                 idEnteredCpu;
    581577
    582578    /** To keep track of pending TLB shootdown pages. (SMP guest only) */
  • trunk/src/VBox/VMM/VMMAll/HWACCMAll.cpp

    r20180 r20979  
    131131                STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatTlbShootdown);
    132132#ifdef IN_RING0
    133                 RTCPUID idHostCpu = pVCpu->hwaccm.s.idEnteredCpu;
     133                RTCPUID idHostCpu = pVCpu->idHostCpu;
    134134                if (idHostCpu != NIL_RTCPUID)
    135135                    RTMpPokeCpu(idHostCpu);
     
    171171            STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatTlbShootdownFlush);
    172172#ifdef IN_RING0
    173             RTCPUID idHostCpu = pVCpu->hwaccm.s.idEnteredCpu;
     173            RTCPUID idHostCpu = pVCpu->idHostCpu;
    174174            if (idHostCpu != NIL_RTCPUID)
    175175                RTMpPokeCpu(idHostCpu);
     
    246246                STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatTlbShootdownFlush);
    247247    #ifdef IN_RING0
    248                 RTCPUID idHostCpu = pVCpu->hwaccm.s.idEnteredCpu;
     248                RTCPUID idHostCpu = pVCpu->idHostCpu;
    249249                if (idHostCpu != NIL_RTCPUID)
    250250                    RTMpPokeCpu(idHostCpu);
  • trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp

    r20132 r20979  
    851851        PVMCPU pVCpu = &pVM->aCpus[i];
    852852
    853         pVCpu->hwaccm.s.idEnteredCpu              = NIL_RTCPUID;
    854 
    855853        /* Invalidate the last cpu we were running on. */
    856854        pVCpu->hwaccm.s.idLastCpu                 = NIL_RTCPUID;
     
    963961    /* Make sure we can't enter a session after we've disabled hwaccm in preparation of a suspend. */
    964962    AssertReturn(!ASMAtomicReadBool(&HWACCMR0Globals.fSuspended), VERR_HWACCM_SUSPEND_PENDING);
     963    Assert(pVCpu->idHostCpu == NIL_RTCPUID);
     964
    965965    ASMAtomicWriteBool(&pCpu->fInUse, true);
    966 
    967     AssertMsg(pVCpu->hwaccm.s.idEnteredCpu == NIL_RTCPUID, ("%d", (int)pVCpu->hwaccm.s.idEnteredCpu));
    968     pVCpu->hwaccm.s.idEnteredCpu = idCpu;
     966    ASMAtomicWriteU32(&pVCpu->idHostCpu, idCpu);
    969967
    970968    pCtx = CPUMQueryGuestCtxPtr(pVCpu);
     
    1000998#endif
    1001999    }
    1002     else
    1003         pVCpu->hwaccm.s.idEnteredCpu = NIL_RTCPUID;
    10041000    return rc;
    10051001}
     
    10421038    /* keep track of the CPU owning the VMCS for debugging scheduling weirdness and ring-3 calls. */
    10431039#ifdef RT_STRICT
    1044     if (RT_UNLIKELY(    pVCpu->hwaccm.s.idEnteredCpu != idCpu
     1040    if (RT_UNLIKELY(    pVCpu->idHostCpu != idCpu
    10451041                    &&  RT_FAILURE(rc)))
    10461042    {
    1047         AssertMsgFailed(("Owner is %d, I'm %d", (int)pVCpu->hwaccm.s.idEnteredCpu, (int)idCpu));
     1043        AssertMsgFailed(("Owner is %d, I'm %d", (int)pVCpu->idHostCpu, (int)idCpu));
    10481044        rc = VERR_INTERNAL_ERROR;
    10491045    }
    10501046#endif
    1051     pVCpu->hwaccm.s.idEnteredCpu = NIL_RTCPUID;
    10521047
    10531048    ASMAtomicWriteBool(&pCpu->fInUse, false);
     
    12001195        PVMCPU pVCpu = &pVM->aCpus[idCpu];
    12011196
    1202         if (pVCpu->hwaccm.s.idEnteredCpu == idHostCpu)
     1197        if (pVCpu->idHostCpu == idHostCpu)
    12031198            return pVCpu;
    12041199    }
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r20846 r20979  
    21122112        if (!fStatEntryStarted) { STAM_PROFILE_ADV_START(&pVCpu->hwaccm.s.StatEntry, x); fStatEntryStarted = true; }
    21132113    });
    2114     AssertMsg(pVCpu->hwaccm.s.idEnteredCpu == RTMpCpuId(),
     2114    AssertMsg(pVCpu->idHostCpu == RTMpCpuId(),
    21152115              ("Expected %d, I'm %d; cResume=%d exitReason=%RGv exitQualification=%RGv\n",
    2116                (int)pVCpu->hwaccm.s.idEnteredCpu, (int)RTMpCpuId(), cResume, exitReason, exitQualification));
     2116               (int)pVCpu->idHostCpu, (int)RTMpCpuId(), cResume, exitReason, exitQualification));
    21172117    Assert(!HWACCMR0SuspendPending());
    21182118
     
    37313731        VMXGetActivateVMCS(&pVCpu->hwaccm.s.vmx.lasterror.u64VMCSPhys);
    37323732        pVCpu->hwaccm.s.vmx.lasterror.ulVMCSRevision = *(uint32_t *)pVCpu->hwaccm.s.vmx.pVMCS;
    3733         pVCpu->hwaccm.s.vmx.lasterror.idEnteredCpu   = pVCpu->hwaccm.s.idEnteredCpu;
     3733        pVCpu->hwaccm.s.vmx.lasterror.idEnteredCpu   = pVCpu->idHostCpu;
    37343734        pVCpu->hwaccm.s.vmx.lasterror.idCurrentCpu   = RTMpCpuId();
    37353735    }
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r20875 r20979  
    608608            RTCCUINTREG uFlags = ASMIntDisableFlags();
    609609#endif
    610             ASMAtomicWriteU32(&pVCpu->idHostCpu, NIL_RTCPUID);
    611 
    612610#ifdef LOG_ENABLED
    613611            if (pVCpu->idCpu > 0)
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