VirtualBox

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


Ignore:
Timestamp:
Sep 11, 2013 5:35:55 PM (11 years ago)
Author:
vboxsync
Message:

VMM/VMMAll: Fix nasty wake up with SMP VMs and thread-context hooks.

File:
1 edited

Legend:

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

    r48426 r48441  
    200200     * and then by native thread id (page fusion case).
    201201     */
    202     /* RTMpCpuId had better be cheap. */
    203     Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
    204     RTCPUID idHostCpu = RTMpCpuId();
    205 
    206     /** @todo optimize for large number of VCPUs when that becomes more common. */
    207     for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    208     {
    209         PVMCPU pVCpu = &pVM->aCpus[idCpu];
    210 
    211         if (pVCpu->idHostCpu == idHostCpu)
    212             return pVCpu->idCpu;
     202    if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD))
     203    {
     204        /** @todo r=ramshankar: This doesn't buy us anything in terms of performance
     205         *        leaving it here for hysterical raisins and as a reference if we
     206         *        implemented a hashing approach in the future. */
     207        RTCPUID idHostCpu = RTMpCpuId();
     208
     209        /** @todo optimize for large number of VCPUs when that becomes more common. */
     210        for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
     211        {
     212            PVMCPU pVCpu = &pVM->aCpus[idCpu];
     213
     214            if (pVCpu->idHostCpu == idHostCpu)
     215                return pVCpu->idCpu;
     216        }
    213217    }
    214218
     
    263267         *        leaving it here for hysterical raisins and as a reference if we
    264268         *        implemented a hashing approach in the future. */
    265 
    266         /* RTMpCpuId had better be cheap. */
    267269        RTCPUID idHostCpu = RTMpCpuId();
    268270
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