Lines Matching defs:pVM

109      * @param   pVM             Pointer to the VM.
113 DECLRCCALLBACKMEMBER(int, pfnHandler, (PVM pVM, PCPUMCTXCORE pRegFrame, uintptr_t uUser));
139 DECLCALLBACK(int) trpmRCTrapInGeneric(PVM pVM, PCPUMCTXCORE pRegFrame, uintptr_t uUser);
152 * @param pVM Pointer to the VM.
159 static int trpmGCExitTrap(PVM pVM, PVMCPU pVCpu, int rc, PCPUMCTXCORE pRegFrame)
182 TMTimerPollVoid(pVM, pVCpu);
184 VM_FF_IS_PENDING(pVM, VM_FF_TM_VIRTUAL_SYNC), VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_TIMER)));
211 && ( VM_FF_IS_PENDING(pVM, VM_FF_TM_VIRTUAL_SYNC | VM_FF_REQUEST | VM_FF_PGM_NO_MEMORY | VM_FF_PDM_DMA)
221 if (RT_UNLIKELY(VM_FF_IS_PENDING(pVM, VM_FF_PGM_NO_MEMORY)))
233 else if (VM_FF_IS_PENDING(pVM, VM_FF_TM_VIRTUAL_SYNC))
236 else if (VM_FF_IS_PENDING(pVM, VM_FF_PDM_DMA))
240 else if ( VM_FF_IS_PENDING(pVM, VM_FF_REQUEST)
249 && PATMAreInterruptsEnabledByCtx(pVM, CPUMCTX_FROM_CORE(pRegFrame))
262 STAM_PROFILE_ADV_STOP(&pVM->trpm.s.aStatGCTraps[uOldActiveVector], a);
267 STAM_PROFILE_ADV_START(&pVM->trpm.s.aStatGCTraps[uOldActiveVector], a);
305 PVM pVM = TRPMCPU_2_VM(pTrpmCpu);
324 int rc = DBGFRZTrap01Handler(pVM, pVCpu, pRegFrame, uDr6, false /*fAltStepping*/);
334 rc = trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
359 PVM pVM = TRPMCPU_2_VM(pTrpmCpu);
377 int rc = DBGFRZTrap01Handler(pVM, pVCpu, pRegFrame, uDr6, false /*fAltStepping*/);
450 PVM pVM = TRPMCPU_2_VM(pTrpmCpu);
461 || (EMIsRawRing1Enabled(pVM) && (pRegFrame->ss.Sel & X86_SEL_RPL) == 2) )
464 rc = PATMRCHandleInt3PatchTrap(pVM, pRegFrame);
470 rc = trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
476 rc = DBGFRZTrap03Handler(pVM, pVCpu, pRegFrame);
479 rc = trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
502 PVM pVM = TRPMCPU_2_VM(pTrpmCpu);
510 int rc = DBGFRZTrap03Handler(pVM, pVCpu, pRegFrame);
532 PVM pVM = TRPMCPU_2_VM(pTrpmCpu);
539 if (CPUMGetGuestCPL(pVCpu) <= (EMIsRawRing1Enabled(pVM) ? 1U : 0U))
550 rc = trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_GUEST_TRAP, pRegFrame);
558 rc = EMInterpretDisasOneEx(pVM, pVCpu, (RTGCUINTPTR)PC, pRegFrame, &Cpu, &cbOp);
561 rc = trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_EMULATE_INSTR, pRegFrame);
572 && PATMIsPatchGCAddr(pVM, pRegFrame->eip))
575 rc = PATMRCHandleIllegalInstrTrap(pVM, pRegFrame);
584 rc = trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
597 Assert(!PATMIsPatchGCAddr(pVM, pRegFrame->eip));
636 rc = trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
658 PVM pVM = TRPMCPU_2_VM(pTrpmCpu);
665 rc = trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
685 PVM pVM = TRPMCPU_2_VM(pTrpmCpu);
786 * @param pVM Pointer to the VM.
792 static int trpmGCTrap0dHandlerRing0(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu, RTGCPTR PC)
812 Assert(!(PATMIsPatchGCAddr(pVM, PC)));
816 if (PATMRCHandleInt3PatchTrap(pVM, pRegFrame) == VINF_SUCCESS)
819 return trpmGCExitTrap(pVM, pVCpu, VINF_SUCCESS, pRegFrame);
826 return trpmGCExitTrap(pVM, pVCpu, VINF_SUCCESS, pRegFrame);
831 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_RING_SWITCH_INT, pRegFrame);
837 rc = PATMSysCall(pVM, CPUMCTX_FROM_CORE(pRegFrame), pCpu);
839 return trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
844 if (PATMIsPatchGCAddr(pVM, PC))
849 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_HALT, pRegFrame);
861 if ( !PATMIsPatchGCAddr(pVM, PC)
862 && !CSAMIsKnownDangerousInstr(pVM, PC))
878 return trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
883 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_EXCEPTION_PRIVILEGED, pRegFrame);
894 * @param pVM Pointer to the VM.
900 static int trpmGCTrap0dHandlerRing3(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu, RTGCPTR PC)
926 return trpmGCExitTrap(pVM, pVCpu, VINF_SUCCESS, pRegFrame);
932 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_RING_SWITCH_INT, pRegFrame);
941 rc = PATMSysCall(pVM, CPUMCTX_FROM_CORE(pRegFrame), pCpu);
945 return trpmGCExitTrap(pVM, pVCpu, VINF_SUCCESS, pRegFrame);
953 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_RING_SWITCH, pRegFrame);
965 return trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
980 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RESCHEDULE_REM, pRegFrame);
991 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_GUEST_TRAP, pRegFrame);
1000 * @param pVM Pointer to the VM.
1005 DECLINLINE(int) trpmGCTrap0dHandlerRdTsc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
1007 STAM_COUNTER_INC(&pVM->trpm.s.StatTrap0dRdTsc);
1013 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_EMULATE_INSTR, pRegFrame); /* will trap (optimize later). */
1021 return trpmGCExitTrap(pVM, pVCpu, VINF_SUCCESS, pRegFrame);
1032 * @param pVM Pointer to the VM.
1036 static int trpmGCTrap0dHandler(PVM pVM, PTRPMCPU pTrpmCpu, PCPUMCTXCORE pRegFrame)
1045 STAM_PROFILE_START(&pVM->trpm.s.StatTrap0dDisasm, a);
1054 STAM_PROFILE_STOP(&pVM->trpm.s.StatTrap0dDisasm, a);
1055 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_EMULATE_INSTR, pRegFrame);
1063 rc = EMInterpretDisasOneEx(pVM, pVCpu, PC, pRegFrame, &Cpu, &cbOp);
1068 STAM_PROFILE_STOP(&pVM->trpm.s.StatTrap0dDisasm, a);
1069 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_EMULATE_INSTR, pRegFrame);
1071 STAM_PROFILE_STOP(&pVM->trpm.s.StatTrap0dDisasm, a);
1081 return trpmGCTrap0dHandlerRdTsc(pVM, pVCpu, pRegFrame);
1089 VBOXSTRICTRC rcStrict = IOMRCIOPortHandler(pVM, pVCpu, pRegFrame, &Cpu);
1101 || DBGFBpIsHwIoArmed(pVM)))
1120 VBOXSTRICTRC rcStrict2 = DBGFBpCheckIo(pVM, pVCpu, CPUMCTX_FROM_CORE(pRegFrame), uPort, cbValue);
1138 return trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
1146 return trpmGCTrap0dHandlerRing0(pVM, pVCpu, pRegFrame, &Cpu, PC);
1152 return trpmGCTrap0dHandlerRing3(pVM, pVCpu, pRegFrame, &Cpu, PC);
1167 Assert(EMIsRawRing1Enabled(pVM) || eflags.Bits.u2IOPL == 0);
1172 return trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
1175 return trpmGCExitTrap(pVM, pVCpu, VINF_EM_RAW_EMULATE_INSTR, pRegFrame);
1192 PVM pVM = TRPMCPU_2_VM(pTrpmCpu);
1198 int rc = trpmGCTrap0dHandler(pVM, pTrpmCpu, pRegFrame);
1203 if (PATMIsPatchGCAddr(pVM, pRegFrame->eip))
1230 AssertMsg(PATMIsPatchGCAddr(pVM, pRegFrame->eip) == false, ("return code %d\n", rc));
1255 PVM pVM = TRPMCPU_2_VM(pTrpmCpu);
1273 if (PATMIsPatchGCAddr(pVM, pRegFrame->eip))
1278 if (PATMIsPatchGCAddr(pVM, pRegFrame->eip))
1307 AssertMsg(PATMIsPatchGCAddr(pVM, pRegFrame->eip) == false, ("Patch address for return code %d. eip=%08x\n", rc, pRegFrame->eip));
1310 rc = trpmGCExitTrap(pVM, pVCpu, rc, pRegFrame);
1324 * @param pVM Pointer to the VM.
1329 static int trpmGCHyperGeneric(PVM pVM, PCPUMCTXCORE pRegFrame, PCTRPMGCHYPER paHandlers, PCTRPMGCHYPER pEndRecord)
1352 return pCur->pfnHandler(pVM, pRegFrame, pCur->uUser);
1427 * @param pVM Pointer to the VM.
1431 DECLCALLBACK(int) trpmRCTrapInGeneric(PVM pVM, PCPUMCTXCORE pRegFrame, uintptr_t uUser)
1450 TRPMGCHyperReturnToHost(pVM, VINF_EM_RAW_STALE_SELECTOR);
1455 TRPMGCHyperReturnToHost(pVM, VINF_EM_RAW_IRET_TRAP);
1472 * @param pVM Pointer to the cross context VM structure.
1476 extern "C" DECLCALLBACK(int) TRPMRCTrapHyperHandlerSetEIP(PVM pVM, PCPUMCTXCORE pRegFrame, uintptr_t uUser)
1478 AssertReturn(MMHyperIsInsideArea(pVM, uUser), VERR_TRPM_IPE_3);