Lines Matching refs:pVCpu

118  * @param   pVCpu       Pointer to the VMCPU.
120 VMMDECL(void) TMNotifyStartOfExecution(PVMCPU pVCpu)
122 PVM pVM = pVCpu->CTX_SUFF(pVM);
125 pVCpu->tm.s.u64NsTsStartExecuting = RTTimeNanoTS();
128 tmCpuTickResume(pVM, pVCpu);
140 * @param pVCpu Pointer to the VMCPU.
142 VMMDECL(void) TMNotifyEndOfExecution(PVMCPU pVCpu)
144 PVM pVM = pVCpu->CTX_SUFF(pVM);
147 tmCpuTickPause(pVCpu);
151 uint64_t const cNsTotalNew = u64NsTs - pVCpu->tm.s.u64NsTsStartTotal;
152 uint64_t const cNsExecutingDelta = u64NsTs - pVCpu->tm.s.u64NsTsStartExecuting;
153 uint64_t const cNsExecutingNew = pVCpu->tm.s.cNsExecuting + cNsExecutingDelta;
154 uint64_t const cNsOtherNew = cNsTotalNew - cNsExecutingNew - pVCpu->tm.s.cNsHalted;
157 STAM_REL_PROFILE_ADD_PERIOD(&pVCpu->tm.s.StatNsExecuting, cNsExecutingDelta);
159 STAM_REL_PROFILE_ADD_PERIOD(&pVCpu->tm.s.StatNsExecTiny, cNsExecutingDelta);
161 STAM_REL_PROFILE_ADD_PERIOD(&pVCpu->tm.s.StatNsExecShort, cNsExecutingDelta);
163 STAM_REL_PROFILE_ADD_PERIOD(&pVCpu->tm.s.StatNsExecLong, cNsExecutingDelta);
164 STAM_REL_COUNTER_ADD(&pVCpu->tm.s.StatNsTotal, cNsTotalNew - pVCpu->tm.s.cNsTotal);
165 int64_t const cNsOtherNewDelta = cNsOtherNew - pVCpu->tm.s.cNsOther;
167 STAM_REL_PROFILE_ADD_PERIOD(&pVCpu->tm.s.StatNsOther, cNsOtherNewDelta); /* (the period before execution) */
170 uint32_t uGen = ASMAtomicIncU32(&pVCpu->tm.s.uTimesGen); Assert(uGen & 1);
171 pVCpu->tm.s.cNsExecuting = cNsExecutingNew;
172 pVCpu->tm.s.cNsTotal = cNsTotalNew;
173 pVCpu->tm.s.cNsOther = cNsOtherNew;
174 pVCpu->tm.s.cPeriodsExecuting++;
175 ASMAtomicWriteU32(&pVCpu->tm.s.uTimesGen, (uGen | 1) + 1);
188 * @param pVCpu Pointer to the VMCPU.
190 VMM_INT_DECL(void) TMNotifyStartOfHalt(PVMCPU pVCpu)
192 PVM pVM = pVCpu->CTX_SUFF(pVM);
195 pVCpu->tm.s.u64NsTsStartHalting = RTTimeNanoTS();
200 tmCpuTickResume(pVM, pVCpu);
212 * @param pVCpu Pointer to the VMCPU.
214 VMM_INT_DECL(void) TMNotifyEndOfHalt(PVMCPU pVCpu)
216 PVM pVM = pVCpu->CTX_SUFF(pVM);
220 tmCpuTickPause(pVCpu);
224 uint64_t const cNsTotalNew = u64NsTs - pVCpu->tm.s.u64NsTsStartTotal;
225 uint64_t const cNsHaltedDelta = u64NsTs - pVCpu->tm.s.u64NsTsStartHalting;
226 uint64_t const cNsHaltedNew = pVCpu->tm.s.cNsHalted + cNsHaltedDelta;
227 uint64_t const cNsOtherNew = cNsTotalNew - pVCpu->tm.s.cNsExecuting - cNsHaltedNew;
230 STAM_REL_PROFILE_ADD_PERIOD(&pVCpu->tm.s.StatNsHalted, cNsHaltedDelta);
231 STAM_REL_COUNTER_ADD(&pVCpu->tm.s.StatNsTotal, cNsTotalNew - pVCpu->tm.s.cNsTotal);
232 int64_t const cNsOtherNewDelta = cNsOtherNew - pVCpu->tm.s.cNsOther;
234 STAM_REL_PROFILE_ADD_PERIOD(&pVCpu->tm.s.StatNsOther, cNsOtherNewDelta); /* (the period before halting) */
237 uint32_t uGen = ASMAtomicIncU32(&pVCpu->tm.s.uTimesGen); Assert(uGen & 1);
238 pVCpu->tm.s.cNsHalted = cNsHaltedNew;
239 pVCpu->tm.s.cNsTotal = cNsTotalNew;
240 pVCpu->tm.s.cNsOther = cNsOtherNew;
241 pVCpu->tm.s.cPeriodsHalted++;
242 ASMAtomicWriteU32(&pVCpu->tm.s.uTimesGen, (uGen | 1) + 1);
737 * @param pVCpu Pointer to the shared VMCPU structure of the
745 DECL_FORCE_INLINE(uint64_t) tmTimerPollReturnHit(PVM pVM, PVMCPU pVCpu, PVMCPU pVCpuDst, uint64_t u64Now,
749 if (pVCpuDst != pVCpu)
764 * @param pVCpu Pointer to the shared VMCPU structure of the caller.
771 DECL_FORCE_INLINE(uint64_t) tmTimerPollInternal(PVM pVM, PVMCPU pVCpu, uint64_t *pu64Delta)
781 return tmTimerPollReturnHit(pVM, pVCpu, pVCpuDst, u64Now, pu64Delta, &pVM->tm.s.StatPollAlreadySet);
808 return tmTimerPollReturnHit(pVM, pVCpu, pVCpuDst, u64Now, pu64Delta, &pVM->tm.s.StatPollVirtual);
839 if (pVCpu == pVCpuDst)
856 return tmTimerPollReturnHit(pVM, pVCpu, pVCpuDst, u64Now, pu64Delta, &pVM->tm.s.StatPollVirtualSync);
864 return tmTimerPollReturnHit(pVM, pVCpu, pVCpuDst, u64Now, pu64Delta, &pVM->tm.s.StatPollVirtualSync);
921 return tmTimerPollReturnHit(pVM, pVCpu, pVCpuDst, u64Now, pu64Delta, &pVM->tm.s.StatPollAlreadySet);
930 return tmTimerPollReturnHit(pVM, pVCpu, pVCpuDst, u64Now, pu64Delta, &pVM->tm.s.StatPollVirtualSync);
954 return tmTimerPollReturnHit(pVM, pVCpu, pVCpuDst, u64Now, pu64Delta, &pVM->tm.s.StatPollVirtualSync);
961 if (pVCpu == pVCpuDst)
979 * @param pVCpu Pointer to the shared VMCPU structure of the caller.
982 VMMDECL(bool) TMTimerPollBool(PVM pVM, PVMCPU pVCpu)
986 tmTimerPollInternal(pVM, pVCpu, &off);
997 * @param pVCpu Pointer to the shared VMCPU structure of the caller.
1000 VMM_INT_DECL(void) TMTimerPollVoid(PVM pVM, PVMCPU pVCpu)
1003 tmTimerPollInternal(pVM, pVCpu, &off);
1015 * @param pVCpu Pointer to the shared VMCPU structure of the caller.
1019 VMM_INT_DECL(uint64_t) TMTimerPollGIP(PVM pVM, PVMCPU pVCpu, uint64_t *pu64Delta)
1021 return tmTimerPollInternal(pVM, pVCpu, pu64Delta);
2529 * @param pVCpu The current CPU.
2531 VMM_INT_DECL(uint32_t) TMCalcHostTimerFrequency(PVM pVM, PVMCPU pVCpu)
2565 if (pVCpu->idCpu == pVM->tm.s.idTimerCpu)