Changeset 31359 in vbox
- Timestamp:
- Aug 4, 2010 3:31:04 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
include/VBox/vm.h (modified) (2 diffs)
-
include/VBox/vm.mac (modified) (1 diff)
-
src/VBox/VMM/VMMAll/VMMAll.cpp (modified) (4 diffs)
-
src/VBox/VMM/VMMR0/VMMR0.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vm.h
r31326 r31359 102 102 /** The native thread handle. */ 103 103 RTNATIVETHREAD hNativeThread; 104 /** The native R0 thread handle. (different from the R3 handle!) */ 105 RTNATIVETHREAD hNativeThreadR0; 104 106 /** Which host CPU ID is this EMT running on. 105 107 * Only valid when in RC or HWACCMR0 with scheduling disabled. */ … … 114 116 * following it (to grow into and align the struct size). 115 117 * */ 116 uint8_t abAlignment1[HC_ARCH_BITS == 32 ? 2 8 : 12];118 uint8_t abAlignment1[HC_ARCH_BITS == 32 ? 24 : 4]; 117 119 118 120 /** CPUM part. */ -
trunk/include/VBox/vm.mac
r31326 r31359 120 120 121 121 .hNativeThread RTR0PTR_RES 1 122 .hNativeThreadR0 RTR0PTR_RES 1 122 123 .idHostCpu resd 1 123 124 -
trunk/src/VBox/VMM/VMMAll/VMMAll.cpp
r31356 r31359 61 61 return 0; 62 62 63 /* Search first by host cpu id (most common case)64 * and then by native thread id (page fusion case).65 */66 /* RTMpCpuId had better be cheap. */67 RTCPUID idHostCpu = RTMpCpuId();68 69 /** @todo optimize for large number of VCPUs when that becomes more common. */70 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)71 {72 PVMCPU pVCpu = &pVM->aCpus[idCpu];73 74 if (pVCpu->idHostCpu == idHostCpu)75 return pVCpu->idCpu;76 }77 78 63 /* RTThreadGetNativeSelf had better be cheap. */ 79 64 RTNATIVETHREAD hThread = RTThreadNativeSelf(); … … 84 69 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 85 70 86 if (pVCpu->hNativeThread == hThread)71 if (pVCpu->hNativeThreadR0 == hThread) 87 72 return pVCpu->idCpu; 88 73 } … … 115 100 return &pVM->aCpus[0]; 116 101 117 /* Search first by host cpu id (most common case)118 * and then by native thread id (page fusion case).119 */120 121 /* RTMpCpuId had better be cheap. */122 RTCPUID idHostCpu = RTMpCpuId();123 124 /** @todo optimize for large number of VCPUs when that becomes more common. */125 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)126 {127 PVMCPU pVCpu = &pVM->aCpus[idCpu];128 129 if (pVCpu->idHostCpu == idHostCpu)130 return pVCpu;131 }132 133 102 /* RTThreadGetNativeSelf had better be cheap. */ 134 103 RTNATIVETHREAD hThread = RTThreadNativeSelf(); … … 139 108 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 140 109 141 if (pVCpu->hNativeThread == hThread)110 if (pVCpu->hNativeThreadR0 == hThread) 142 111 return pVCpu; 143 112 } -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r31352 r31359 965 965 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 966 966 967 if (pVCpu->hNativeThreadR0 == NIL_RTNATIVETHREAD) 968 pVCpu->hNativeThreadR0 = RTThreadNativeSelf(); 969 967 970 /* 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 971 int rc = GMMR0CheckSharedModulesStart(pVM);
Note:
See TracChangeset
for help on using the changeset viewer.

