Changeset 31352 in vbox
- Timestamp:
- Aug 4, 2010 9:45:01 AM (14 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
-
VMMAll/VMMAll.cpp (modified) (4 diffs)
-
VMMR0/VMMR0.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/VMMAll.cpp
r30329 r31352 60 60 return 0; 61 61 62 /* RT MpCpuIdhad better be cheap. */63 RT CPUID idHostCpu = RTMpCpuId();62 /* RTThreadGetNativeSelf had better be cheap. */ 63 RTNATIVETHREAD hThread = RTThreadNativeSelf(); 64 64 65 65 /** @todo optimize for large number of VCPUs when that becomes more common. */ … … 68 68 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 69 69 70 if (pVCpu-> idHostCpu == idHostCpu)70 if (pVCpu->hNativeThread == hThread) 71 71 return pVCpu->idCpu; 72 72 } … … 99 99 return &pVM->aCpus[0]; 100 100 101 /* RT MpCpuIdhad better be cheap. */102 RT CPUID idHostCpu = RTMpCpuId();101 /* RTThreadGetNativeSelf had better be cheap. */ 102 RTNATIVETHREAD hThread = RTThreadNativeSelf(); 103 103 104 104 /** @todo optimize for large number of VCPUs when that becomes more common. */ … … 107 107 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 108 108 109 if (pVCpu-> idHostCpu == idHostCpu)109 if (pVCpu->hNativeThread == hThread) 110 110 return pVCpu; 111 111 } -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r31351 r31352 965 965 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 966 966 967 /* Make sure that log flushes can jump back to ring-3; annoying to get an incomplete log (this is risky though as the code doesn't take this into account). 968 * Also grab the fast mutex before disabling preemption. 969 */ 967 /* Make sure that log flushes can jump back to ring-3; annoying to get an incomplete log (this is risky though as the code doesn't take this into account). */ 970 968 int rc = GMMR0CheckSharedModulesStart(pVM); 971 969 if (rc == VINF_SUCCESS) 972 970 { 973 # ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION974 RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER;975 RTThreadPreemptDisable(&PreemptState);976 # elif !defined(RT_OS_WINDOWS)977 RTCCUINTREG uFlags = ASMIntDisableFlags();978 # else979 AssertCompileFailed();980 # endif981 /* Select a valid VCPU context. */982 ASMAtomicWriteU32(&pVCpu->idHostCpu, RTMpCpuId());983 984 971 rc = vmmR0CallRing3SetJmp(&pVCpu->vmm.s.CallRing3JmpBufR0, GMMR0CheckSharedModules, pVM, pVCpu); /* this may resume code. */ 985 986 /* Clear the VCPU context. */ 987 ASMAtomicWriteU32(&pVCpu->idHostCpu, NIL_RTCPUID); 988 # ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION 989 RTThreadPreemptRestore(&PreemptState); 990 # elif !defined(RT_OS_WINDOWS) 991 ASMSetFlags(uFlags); 992 # else 993 AssertCompileFailed(); 994 # endif 995 972 Assert( rc == VINF_SUCCESS 973 || (rc == VINF_VMM_CALL_HOST && pVCpu->vmm.s.enmCallRing3Operation == VMMCALLRING3_VMM_LOGGER_FLUSH)); 996 974 GMMR0CheckSharedModulesEnd(pVM); 997 975 }
Note:
See TracChangeset
for help on using the changeset viewer.

