Changeset 75661 in vbox
- Timestamp:
- Nov 22, 2018 12:33:18 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/gvmm.h
r75646 r75661 172 172 GVMMR0DECL(PVM) GVMMR0GetVMByEMT(RTNATIVETHREAD hEMT); 173 173 GVMMR0DECL(PGVMCPU) GVMMR0GetGVCpuByEMT(RTNATIVETHREAD hEMT); 174 GVMMR0DECL(int) GVMMR0SchedHalt(PGVM pGVM, PVM pVM, PGVMCPU p CurGVCpu, uint64_t u64ExpireGipTime);174 GVMMR0DECL(int) GVMMR0SchedHalt(PGVM pGVM, PVM pVM, PGVMCPU pGVCpu, uint64_t u64ExpireGipTime); 175 175 GVMMR0DECL(int) GVMMR0SchedHaltReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime); 176 176 GVMMR0DECL(int) GVMMR0SchedWakeUp(PGVM pGVM, PVM pVM, VMCPUID idCpu); -
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r75646 r75661 2157 2157 * @param pGVM The global (ring-0) VM structure. 2158 2158 * @param pVM The cross context VM structure. 2159 * @param idCpu The Virtual CPU ID of the calling EMT. 2159 * @param pGVCpu The global (ring-0) CPU structure of the calling 2160 * EMT. 2160 2161 * @param u64ExpireGipTime The time for the sleep to expire expressed as GIP time. 2161 * @thread EMT( idCpu).2162 */ 2163 GVMMR0DECL(int) GVMMR0SchedHalt(PGVM pGVM, PVM pVM, PGVMCPU p CurGVCpu, uint64_t u64ExpireGipTime)2164 { 2165 LogFlow(("GVMMR0SchedHalt: pGVM=%p pVM=%p p CurGVCpu=%p(%d) u64ExpireGipTime=%#RX64\n",2166 pGVM, pVM, p CurGVCpu, pCurGVCpu->idCpu, u64ExpireGipTime));2162 * @thread EMT(pGVCpu). 2163 */ 2164 GVMMR0DECL(int) GVMMR0SchedHalt(PGVM pGVM, PVM pVM, PGVMCPU pGVCpu, uint64_t u64ExpireGipTime) 2165 { 2166 LogFlow(("GVMMR0SchedHalt: pGVM=%p pVM=%p pGVCpu=%p(%d) u64ExpireGipTime=%#RX64\n", 2167 pGVM, pVM, pGVCpu, pGVCpu->idCpu, u64ExpireGipTime)); 2167 2168 GVMM_CHECK_SMAP_SETUP(); 2168 2169 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); … … 2172 2173 2173 2174 pGVM->gvmm.s.StatsSched.cHaltCalls++; 2174 Assert(!p CurGVCpu->gvmm.s.u64HaltExpire);2175 Assert(!pGVCpu->gvmm.s.u64HaltExpire); 2175 2176 2176 2177 /* … … 2186 2187 } 2187 2188 2188 p CurGVCpu->gvmm.s.iCpuEmt = ASMGetApicId();2189 pGVCpu->gvmm.s.iCpuEmt = ASMGetApicId(); 2189 2190 2190 2191 /* GIP hack: We might are frequently sleeping for short intervals where the … … 2216 2217 if (cNsInterval > RT_NS_1SEC) 2217 2218 u64ExpireGipTime = u64NowGip + RT_NS_1SEC; 2218 ASMAtomicWriteU64(&p CurGVCpu->gvmm.s.u64HaltExpire, u64ExpireGipTime);2219 ASMAtomicWriteU64(&pGVCpu->gvmm.s.u64HaltExpire, u64ExpireGipTime); 2219 2220 ASMAtomicIncU32(&pGVMM->cHaltedEMTs); 2220 2221 if (fDoEarlyWakeUps) … … 2226 2227 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 2227 2228 2228 rc = RTSemEventMultiWaitEx(p CurGVCpu->gvmm.s.HaltEventMulti,2229 rc = RTSemEventMultiWaitEx(pGVCpu->gvmm.s.HaltEventMulti, 2229 2230 RTSEMWAIT_FLAGS_ABSOLUTE | RTSEMWAIT_FLAGS_NANOSECS | RTSEMWAIT_FLAGS_INTERRUPTIBLE, 2230 2231 u64NowGip > u64NowSys ? u64ExpireGipTime : u64NowSys + cNsInterval); 2231 2232 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 2232 2233 2233 ASMAtomicWriteU64(&p CurGVCpu->gvmm.s.u64HaltExpire, 0);2234 ASMAtomicWriteU64(&pGVCpu->gvmm.s.u64HaltExpire, 0); 2234 2235 ASMAtomicDecU32(&pGVMM->cHaltedEMTs); 2235 2236 … … 2237 2238 if (rc == VINF_SUCCESS) 2238 2239 { 2239 RTSemEventMultiReset(p CurGVCpu->gvmm.s.HaltEventMulti);2240 RTSemEventMultiReset(pGVCpu->gvmm.s.HaltEventMulti); 2240 2241 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 2241 2242 } … … 2252 2253 GVMMR0_USED_SHARED_UNLOCK(pGVMM); 2253 2254 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 2254 RTSemEventMultiReset(p CurGVCpu->gvmm.s.HaltEventMulti);2255 RTSemEventMultiReset(pGVCpu->gvmm.s.HaltEventMulti); 2255 2256 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 2256 2257 rc = VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.