Changeset 40453 in vbox
- Timestamp:
- Mar 13, 2012 6:38:06 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/em.h
r40451 r40453 161 161 VMMDECL(VBOXSTRICTRC) EMInterpretInstructionDisasState(PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pCoreCtx, RTGCPTR pvFault, EMCODETYPE enmCodeType); 162 162 163 #ifdef IN_RC 164 VMMDECL(int) EMInterpretIretV86ForPatm(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame); 165 #endif 166 163 167 #ifndef VBOX_WITH_IEM 164 168 VMMDECL(int) EMInterpretCpuId(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame); … … 167 171 VMMDECL(int) EMInterpretRdtscp(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx); 168 172 VMMDECL(VBOXSTRICTRC) EMInterpretInvlpg(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pAddrGC); 169 VMMDECL(int) EMInterpretIret(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);170 173 VMMDECL(VBOXSTRICTRC) EMInterpretMWait(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame); 171 174 VMMDECL(int) EMInterpretMonitor(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame); -
trunk/include/VBox/vmm/iem.h
r40274 r40453 40 40 41 41 VMMDECL(VBOXSTRICTRC) IEMExecOne(PVMCPU pVCpu); 42 VMMDECL(VBOXSTRICTRC) IEMExecOneEx(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore, uint32_t *pcbWritten); 42 43 VMMDECL(VBOXSTRICTRC) IEMExecLots(PVMCPU pVCpu); 43 44 VMM_INT_DECL(VBOXSTRICTRC) IEMInjectTrap(PVMCPU pVCpu, uint8_t u8TrapNo, TRPMEVENT enmType, uint16_t uErrCode, RTGCPTR uCr2); … … 45 46 VMM_INT_DECL(int) IEMBreakpointSet(PVM pVM, RTGCPTR GCPtrBp); 46 47 VMM_INT_DECL(int) IEMBreakpointClear(PVM pVM, RTGCPTR GCPtrBp); 48 49 /** @name Given Instruction Interpreters 50 * @{ */ 51 52 /** @} */ 47 53 48 54 #if defined(IEM_VERIFICATION_MODE) && defined(IN_RING3) -
trunk/include/VBox/vmm/patm.h
r35361 r40453 314 314 * @param pCtxCore The relevant core context. 315 315 */ 316 VMMDECL(int) PATM GCHandleIllegalInstrTrap(PVM pVM, PCPUMCTXCORE pRegFrame);316 VMMDECL(int) PATMRCHandleIllegalInstrTrap(PVM pVM, PCPUMCTXCORE pRegFrame); 317 317 318 318 /** @} */ -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r40451 r40453 26 26 #include <VBox/vmm/csam.h> 27 27 #include <VBox/vmm/pgm.h> 28 #ifdef VBOX_WITH_IEM 29 # include <VBox/vmm/iem.h> 30 #endif 28 31 #include <VBox/vmm/iom.h> 29 32 #include <VBox/vmm/stam.h> … … 488 491 LogFlow(("EMInterpretInstruction %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault)); 489 492 #ifdef VBOX_WITH_IEM 490 int rc = IEMExecOneEx(pVCpu, pRegFrame, IEM_EXEC_ONE_EX_FLAGS_, pcbSize); 491 if (RT_FAILURE(rc)) 492 switch (rc) 493 { 494 case VERR_IEM_ASPECT_NOT_IMPLEMENTED: 495 case VERR_IEM_INSTR_NOT_IMPLEMENTED: 496 return VERR_EM_INTERPRETER; 497 } 493 NOREF(pvFault); 494 VBOXSTRICTRC rc = IEMExecOneEx(pVCpu, pRegFrame, NULL); 495 if (RT_UNLIKELY( rc == VERR_IEM_ASPECT_NOT_IMPLEMENTED 496 || rc == VERR_IEM_INSTR_NOT_IMPLEMENTED)) 497 return VERR_EM_INTERPRETER; 498 498 return rc; 499 499 #else … … 545 545 LogFlow(("EMInterpretInstructionEx %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault)); 546 546 #ifdef VBOX_WITH_IEM 547 int rc = IEMExecOneEx(pVCpu, pRegFrame, IEM_EXEC_ONE_EX_FLAGS_, pcbWritten); 548 if (RT_FAILURE(rc)) 549 switch (rc) 550 { 551 case VERR_IEM_ASPECT_NOT_IMPLEMENTED: 552 case VERR_IEM_INSTR_NOT_IMPLEMENTED: 553 return VERR_EM_INTERPRETER; 554 } 547 NOREF(pvFault); 548 VBOXSTRICTRC rc = IEMExecOneEx(pVCpu, pRegFrame, pcbWritten); 549 if (RT_UNLIKELY( rc == VERR_IEM_ASPECT_NOT_IMPLEMENTED 550 || rc == VERR_IEM_INSTR_NOT_IMPLEMENTED)) 551 return VERR_EM_INTERPRETER; 555 552 return rc; 556 553 #else … … 609 606 RTGCPTR pvFault, EMCODETYPE enmCodeType) 610 607 { 611 STAM_PROFILE_START(&pVCpu->em.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Emulate), a); 608 LogFlow(("EMInterpretInstructionDisasState %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault)); 609 #ifdef VBOX_WITH_IEM 610 NOREF(pDis); NOREF(pvFault); NOREF(enmCodeType); 611 VBOXSTRICTRC rc = IEMExecOneEx(pVCpu, pRegFrame, NULL); 612 if (RT_UNLIKELY( rc == VERR_IEM_ASPECT_NOT_IMPLEMENTED 613 || rc == VERR_IEM_INSTR_NOT_IMPLEMENTED)) 614 return VERR_EM_INTERPRETER; 615 return rc; 616 #else 612 617 uint32_t cbIgnored; 613 618 VBOXSTRICTRC rc = emInterpretInstructionCPUOuter(pVCpu, pDis, pRegFrame, pvFault, enmCodeType, &cbIgnored); 614 STAM_PROFILE_STOP(&pVCpu->em.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Emulate), a);615 619 if (RT_SUCCESS(rc)) 616 {617 620 pRegFrame->rip += pDis->opsize; /* Move on to the next instruction. */ 618 STAM_COUNTER_INC(&pVCpu->em.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InterpretSucceeded));619 }620 else621 STAM_COUNTER_INC(&pVCpu->em.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InterpretFailed));622 621 return rc; 623 } 624 622 #endif 623 } 624 625 #if defined(IN_RC) /*&& defined(VBOX_WITH_PATM)*/ 626 627 DECLINLINE(int) emRCStackRead(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pCtxCore, void *pvDst, RTGCPTR GCPtrSrc, uint32_t cb) 628 { 629 int rc = MMGCRamRead(pVM, pvDst, (void *)(uintptr_t)GCPtrSrc, cb); 630 if (RT_LIKELY(rc != VERR_ACCESS_DENIED)) 631 return rc; 632 return PGMPhysInterpretedReadNoHandlers(pVCpu, pCtxCore, pvDst, GCPtrSrc, cb, /*fMayTrap*/ false); 633 } 634 635 636 /** 637 * Interpret IRET (currently only to V86 code) - PATM only. 638 * 639 * @returns VBox status code. 640 * @param pVM The VM handle. 641 * @param pVCpu The VMCPU handle. 642 * @param pRegFrame The register frame. 643 * 644 */ 645 VMMDECL(int) EMInterpretIretV86ForPatm(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame) 646 { 647 RTGCUINTPTR pIretStack = (RTGCUINTPTR)pRegFrame->esp; 648 RTGCUINTPTR eip, cs, esp, ss, eflags, ds, es, fs, gs, uMask; 649 int rc; 650 651 Assert(!CPUMIsGuestIn64BitCode(pVCpu, pRegFrame)); 652 /** @todo Rainy day: Test what happens when VERR_EM_INTERPRETER is returned by 653 * this function. Faire that it may guru on us, thus not converted to 654 * IEM. */ 655 656 rc = emRCStackRead(pVM, pVCpu, pRegFrame, &eip, (RTGCPTR)pIretStack , 4); 657 rc |= emRCStackRead(pVM, pVCpu, pRegFrame, &cs, (RTGCPTR)(pIretStack + 4), 4); 658 rc |= emRCStackRead(pVM, pVCpu, pRegFrame, &eflags, (RTGCPTR)(pIretStack + 8), 4); 659 AssertRCReturn(rc, VERR_EM_INTERPRETER); 660 AssertReturn(eflags & X86_EFL_VM, VERR_EM_INTERPRETER); 661 662 rc |= emRCStackRead(pVM, pVCpu, pRegFrame, &esp, (RTGCPTR)(pIretStack + 12), 4); 663 rc |= emRCStackRead(pVM, pVCpu, pRegFrame, &ss, (RTGCPTR)(pIretStack + 16), 4); 664 rc |= emRCStackRead(pVM, pVCpu, pRegFrame, &es, (RTGCPTR)(pIretStack + 20), 4); 665 rc |= emRCStackRead(pVM, pVCpu, pRegFrame, &ds, (RTGCPTR)(pIretStack + 24), 4); 666 rc |= emRCStackRead(pVM, pVCpu, pRegFrame, &fs, (RTGCPTR)(pIretStack + 28), 4); 667 rc |= emRCStackRead(pVM, pVCpu, pRegFrame, &gs, (RTGCPTR)(pIretStack + 32), 4); 668 AssertRCReturn(rc, VERR_EM_INTERPRETER); 669 670 pRegFrame->eip = eip & 0xffff; 671 pRegFrame->cs = cs; 672 673 /* Mask away all reserved bits */ 674 uMask = X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_TF | X86_EFL_IF | X86_EFL_DF | X86_EFL_OF | X86_EFL_IOPL | X86_EFL_NT | X86_EFL_RF | X86_EFL_VM | X86_EFL_AC | X86_EFL_VIF | X86_EFL_VIP | X86_EFL_ID; 675 eflags &= uMask; 676 677 CPUMRawSetEFlags(pVCpu, pRegFrame, eflags); 678 Assert((pRegFrame->eflags.u32 & (X86_EFL_IF|X86_EFL_IOPL)) == X86_EFL_IF); 679 680 pRegFrame->esp = esp; 681 pRegFrame->ss = ss; 682 pRegFrame->ds = ds; 683 pRegFrame->es = es; 684 pRegFrame->fs = fs; 685 pRegFrame->gs = gs; 686 687 return VINF_SUCCESS; 688 } 689 690 #endif /* IN_RC && VBOX_WITH_PATM */ 625 691 #ifndef VBOX_WITH_IEM 626 692 … … 1925 1991 return VERR_EM_INTERPRETER; 1926 1992 #endif 1927 }1928 #endif /* IN_RC */1929 1930 1931 #ifdef IN_RC1932 /**1933 * Interpret IRET (currently only to V86 code)1934 *1935 * @returns VBox status code.1936 * @param pVM The VM handle.1937 * @param pVCpu The VMCPU handle.1938 * @param pRegFrame The register frame.1939 *1940 */1941 VMMDECL(int) EMInterpretIret(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)1942 {1943 RTGCUINTPTR pIretStack = (RTGCUINTPTR)pRegFrame->esp;1944 RTGCUINTPTR eip, cs, esp, ss, eflags, ds, es, fs, gs, uMask;1945 int rc;1946 1947 Assert(!CPUMIsGuestIn64BitCode(pVCpu, pRegFrame));1948 1949 rc = emRamRead(pVM, pVCpu, pRegFrame, &eip, (RTGCPTR)pIretStack , 4);1950 rc |= emRamRead(pVM, pVCpu, pRegFrame, &cs, (RTGCPTR)(pIretStack + 4), 4);1951 rc |= emRamRead(pVM, pVCpu, pRegFrame, &eflags, (RTGCPTR)(pIretStack + 8), 4);1952 AssertRCReturn(rc, VERR_EM_INTERPRETER);1953 AssertReturn(eflags & X86_EFL_VM, VERR_EM_INTERPRETER);1954 1955 rc |= emRamRead(pVM, pVCpu, pRegFrame, &esp, (RTGCPTR)(pIretStack + 12), 4);1956 rc |= emRamRead(pVM, pVCpu, pRegFrame, &ss, (RTGCPTR)(pIretStack + 16), 4);1957 rc |= emRamRead(pVM, pVCpu, pRegFrame, &es, (RTGCPTR)(pIretStack + 20), 4);1958 rc |= emRamRead(pVM, pVCpu, pRegFrame, &ds, (RTGCPTR)(pIretStack + 24), 4);1959 rc |= emRamRead(pVM, pVCpu, pRegFrame, &fs, (RTGCPTR)(pIretStack + 28), 4);1960 rc |= emRamRead(pVM, pVCpu, pRegFrame, &gs, (RTGCPTR)(pIretStack + 32), 4);1961 AssertRCReturn(rc, VERR_EM_INTERPRETER);1962 1963 pRegFrame->eip = eip & 0xffff;1964 pRegFrame->cs = cs;1965 1966 /* Mask away all reserved bits */1967 uMask = X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_TF | X86_EFL_IF | X86_EFL_DF | X86_EFL_OF | X86_EFL_IOPL | X86_EFL_NT | X86_EFL_RF | X86_EFL_VM | X86_EFL_AC | X86_EFL_VIF | X86_EFL_VIP | X86_EFL_ID;1968 eflags &= uMask;1969 1970 #ifndef IN_RING01971 CPUMRawSetEFlags(pVCpu, pRegFrame, eflags);1972 #endif1973 Assert((pRegFrame->eflags.u32 & (X86_EFL_IF|X86_EFL_IOPL)) == X86_EFL_IF);1974 1975 pRegFrame->esp = esp;1976 pRegFrame->ss = ss;1977 pRegFrame->ds = ds;1978 pRegFrame->es = es;1979 pRegFrame->fs = fs;1980 pRegFrame->gs = gs;1981 1982 return VINF_SUCCESS;1983 1993 } 1984 1994 #endif /* IN_RC */ -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r40381 r40453 7918 7918 } 7919 7919 7920 7921 /** 7922 * Updates the real CPU context structure with the context core (from the trap 7923 * stack frame) before interpreting any instructions. 7924 * 7925 * @param pCtx The real CPU context. 7926 * @param pCtxCore The trap stack CPU core context. 7927 */ 7928 DECLINLINE(void) iemCtxCoreToCtx(PCPUMCTX pCtx, PCCPUMCTXCORE pCtxCore) 7929 { 7930 PCPUMCTXCORE pDst = CPUMCTX2CORE(pCtx); 7931 if (pDst != pCtxCore) 7932 *pDst = *pCtxCore; 7933 } 7934 7935 7936 /** 7937 * Updates the context core (from the trap stack frame) with the updated values 7938 * from the real CPU context structure after instruction emulation. 7939 * 7940 * @param pCtx The real CPU context. 7941 * @param pCtxCore The trap stack CPU core context. 7942 */ 7943 DECLINLINE(void) iemCtxToCtxCore(PCPUMCTXCORE pCtxCore, PCCPUMCTX pCtx) 7944 { 7945 PCCPUMCTXCORE pSrc = CPUMCTX2CORE(pCtx); 7946 if (pSrc != pCtxCore) 7947 *pCtxCore = *pSrc; 7948 } 7949 7950 7951 #if 0 /* The IRET-to-v8086 mode in PATM is very optimistic, so I don't dare do this yet. */ 7952 /** 7953 * Executes a IRET instruction with default operand size. 7954 * 7955 * This is for PATM. 7956 * 7957 * @returns VBox status code. 7958 * @param pVCpu The current virtual CPU. 7959 * @param pCtxCore The register frame. 7960 */ 7961 VMM_INT_DECL(int) IEMExecInstr_iret(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore) 7962 { 7963 PIEMCPU pIemCpu = &pVCpu->iem.s; 7964 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx); 7965 7966 iemCtxCoreToCtx(pCtx, pCtxCore); 7967 iemInitDecoder(pIemCpu); 7968 VBOXSTRICTRC rcStrict = iemCImpl_iret(pIemCpu, 1, pIemCpu->enmDefOpSize); 7969 if (rcStrict == VINF_SUCCESS) 7970 iemCtxToCtxCore(pCtxCore, pCtx); 7971 else 7972 LogFlow(("IEMExecInstr_iret: cs:rip=%04x:%08RX64 ss:rsp=%04x:%08RX64 EFL=%06x - rcStrict=%Rrc\n", 7973 pCtx->cs, pCtx->rip, pCtx->ss, pCtx->rsp, pCtx->eflags.u, VBOXSTRICTRC_VAL(rcStrict))); 7974 return rcStrict; 7975 } 7976 #endif 7977 -
trunk/src/VBox/VMM/VMMRC/PATMRC.cpp
r40451 r40453 148 148 * @param pCtxCore The relevant core context. 149 149 */ 150 VMMDECL(int) PATM GCHandleIllegalInstrTrap(PVM pVM, PCPUMCTXCORE pRegFrame)150 VMMDECL(int) PATMRCHandleIllegalInstrTrap(PVM pVM, PCPUMCTXCORE pRegFrame) 151 151 { 152 152 PPATMPATCHREC pRec; 153 PVMCPU pVCpu = VMMGetCpu0(pVM); 153 154 int rc; 154 155 … … 160 161 if (CTXSUFF(pVM->patm.s.pGCState)->uPendingAction) 161 162 { 162 LogFlow(("PATM GC: Pending action %x at %x\n", CTXSUFF(pVM->patm.s.pGCState)->uPendingAction, pRegFrame->eip));163 LogFlow(("PATMRC: Pending action %x at %x\n", CTXSUFF(pVM->patm.s.pGCState)->uPendingAction, pRegFrame->eip)); 163 164 164 165 /* Private PATM interface (@todo hack due to lack of anything generic). */ … … 183 184 AssertMsg(!pRegFrame->edi || PATMIsPatchGCAddr(pVM, pRegFrame->edi), ("edx = %x\n", pRegFrame->edi)); 184 185 185 Log(("PATM GC: lookup %x jump table=%x\n", pRegFrame->edx, pRegFrame->edi));186 Log(("PATMRC: lookup %x jump table=%x\n", pRegFrame->edx, pRegFrame->edi)); 186 187 187 188 pRec = PATMQueryFunctionPatch(pVM, (RTRCPTR)(pRegFrame->edx)); … … 231 232 * edi = GC address to jump to 232 233 */ 233 Log(("PATM GC: Dispatch pending interrupt; eip=%x->%x\n", pRegFrame->eip, pRegFrame->edi));234 Log(("PATMRC: Dispatch pending interrupt; eip=%x->%x\n", pRegFrame->eip, pRegFrame->edi)); 234 235 235 236 /* Change EIP to the guest address the patch would normally jump to after setting IF. */ … … 257 258 * edi = GC address to jump to 258 259 */ 259 Log(("PATM GC: Dispatch pending interrupt (iret); eip=%x->%x\n", pRegFrame->eip, pRegFrame->edi));260 Log(("PATMRC: Dispatch pending interrupt (iret); eip=%x->%x\n", pRegFrame->eip, pRegFrame->edi)); 260 261 Assert(pVM->patm.s.CTXSUFF(pGCState)->Restore.uFlags == (PATM_RESTORE_EAX|PATM_RESTORE_ECX|PATM_RESTORE_EDI)); 261 262 Assert(pVM->patm.s.CTXSUFF(pGCState)->fPIF == 0); … … 276 277 case PATM_ACTION_DO_V86_IRET: 277 278 { 278 Log(("PATM GC: Do iret to V86 code; eip=%x\n", pRegFrame->eip));279 Log(("PATMRC: Do iret to V86 code; eip=%x\n", pRegFrame->eip)); 279 280 Assert(pVM->patm.s.CTXSUFF(pGCState)->Restore.uFlags == (PATM_RESTORE_EAX|PATM_RESTORE_ECX)); 280 281 Assert(pVM->patm.s.CTXSUFF(pGCState)->fPIF == 0); … … 284 285 pVM->patm.s.CTXSUFF(pGCState)->Restore.uFlags = 0; 285 286 286 rc = EMInterpretIret (pVM, VMMGetCpu0(pVM), pRegFrame);287 rc = EMInterpretIretV86ForPatm(pVM, pVCpu, pRegFrame); 287 288 if (RT_SUCCESS(rc)) 288 289 { … … 291 292 /* We are no longer executing PATM code; set PIF again. */ 292 293 pVM->patm.s.CTXSUFF(pGCState)->fPIF = 1; 293 PGMRZDynMapReleaseAutoSet( VMMGetCpu0(pVM));294 PGMRZDynMapReleaseAutoSet(pVCpu); 294 295 CPUMGCCallV86Code(pRegFrame); 295 296 /* does not return */ … … 302 303 #ifdef DEBUG 303 304 case PATM_ACTION_LOG_CLI: 304 Log(("PATM GC: CLI at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) ));305 Log(("PATMRC: CLI at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) )); 305 306 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; 306 307 return VINF_SUCCESS; 307 308 308 309 case PATM_ACTION_LOG_STI: 309 Log(("PATM GC: STI at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) ));310 Log(("PATMRC: STI at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) )); 310 311 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; 311 312 return VINF_SUCCESS; 312 313 313 314 case PATM_ACTION_LOG_POPF_IF1: 314 Log(("PATM GC: POPF setting IF at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));315 Log(("PATMRC: POPF setting IF at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags))); 315 316 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; 316 317 return VINF_SUCCESS; 317 318 318 319 case PATM_ACTION_LOG_POPF_IF0: 319 Log(("PATM GC: POPF at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));320 Log(("PATMRC: POPF at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags))); 320 321 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; 321 322 return VINF_SUCCESS; 322 323 323 324 case PATM_ACTION_LOG_PUSHF: 324 Log(("PATM GC: PUSHF at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) ));325 Log(("PATMRC: PUSHF at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) )); 325 326 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; 326 327 return VINF_SUCCESS; 327 328 328 329 case PATM_ACTION_LOG_IF1: 329 Log(("PATM GC: IF=1 escape from %x\n", pRegFrame->eip));330 Log(("PATMRC: IF=1 escape from %x\n", pRegFrame->eip)); 330 331 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; 331 332 return VINF_SUCCESS; … … 358 359 if (rc == VINF_SUCCESS) 359 360 { 360 Log(("PATM GC: IRET->VM stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp));361 Log(("PATM GC: IRET->VM stack frame: DS=%04X ES=%04X FS=%04X GS=%04X\n", selDS, selES, selFS, selGS));361 Log(("PATMRC: IRET->VM stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp)); 362 Log(("PATMRC: IRET->VM stack frame: DS=%04X ES=%04X FS=%04X GS=%04X\n", selDS, selES, selFS, selGS)); 362 363 } 363 364 } 364 365 else 365 Log(("PATM GC: IRET stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp));366 Log(("PATMRC: IRET stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp)); 366 367 } 367 368 else 368 Log(("PATM GC: IRET stack frame: return address %04X:%x eflags=%08x\n", selCS, eip, uEFlags));369 Log(("PATMRC: IRET stack frame: return address %04X:%x eflags=%08x\n", selCS, eip, uEFlags)); 369 370 } 370 Log(("PATM GC: IRET from %x (IF->1) current eflags=%x\n", pRegFrame->eip, pVM->patm.s.CTXSUFF(pGCState)->uVMFlags));371 Log(("PATMRC: IRET from %x (IF->1) current eflags=%x\n", pRegFrame->eip, pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)); 371 372 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; 372 373 return VINF_SUCCESS; … … 400 401 if (rc == VINF_SUCCESS) 401 402 { 402 Log(("PATM GC: GATE->VM stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp));403 Log(("PATM GC: GATE->VM stack frame: DS=%04X ES=%04X FS=%04X GS=%04X\n", selDS, selES, selFS, selGS));403 Log(("PATMRC: GATE->VM stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp)); 404 Log(("PATMRC: GATE->VM stack frame: DS=%04X ES=%04X FS=%04X GS=%04X\n", selDS, selES, selFS, selGS)); 404 405 } 405 406 } 406 407 else 407 Log(("PATM GC: GATE stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp));408 Log(("PATMRC: GATE stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp)); 408 409 } 409 410 else 410 Log(("PATM GC: GATE stack frame: return address %04X:%x eflags=%08x\n", selCS, eip, uEFlags));411 Log(("PATMRC: GATE stack frame: return address %04X:%x eflags=%08x\n", selCS, eip, uEFlags)); 411 412 } 412 413 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; … … 415 416 416 417 case PATM_ACTION_LOG_RET: 417 Log(("PATM GC: RET from %x to %x ESP=%x iopl=%d\n", pRegFrame->eip, pRegFrame->edx, pRegFrame->ebx, X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));418 Log(("PATMRC: RET from %x to %x ESP=%x iopl=%d\n", pRegFrame->eip, pRegFrame->edx, pRegFrame->ebx, X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags))); 418 419 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; 419 420 return VINF_SUCCESS; 420 421 421 422 case PATM_ACTION_LOG_CALL: 422 Log(("PATM GC: CALL to %RRv return addr %RRv ESP=%x iopl=%d\n", pVM->patm.s.CTXSUFF(pGCState)->GCCallPatchTargetAddr, pVM->patm.s.CTXSUFF(pGCState)->GCCallReturnAddr, pRegFrame->edx, X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));423 Log(("PATMRC: CALL to %RRv return addr %RRv ESP=%x iopl=%d\n", pVM->patm.s.CTXSUFF(pGCState)->GCCallPatchTargetAddr, pVM->patm.s.CTXSUFF(pGCState)->GCCallReturnAddr, pRegFrame->edx, X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags))); 423 424 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE; 424 425 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r40451 r40453 521 521 && PATMIsPatchGCAddr(pVM, pRegFrame->eip)) 522 522 { 523 LogFlow(("TRPMGCTrap06Handler: -> PATM GCHandleIllegalInstrTrap\n"));524 rc = PATM GCHandleIllegalInstrTrap(pVM, pRegFrame);523 LogFlow(("TRPMGCTrap06Handler: -> PATMRCHandleIllegalInstrTrap\n")); 524 rc = PATMRCHandleIllegalInstrTrap(pVM, pRegFrame); 525 525 /** @todo These tests are completely unnecessary, should just follow the 526 526 * flow and return at the end of the function. */
Note:
See TracChangeset
for help on using the changeset viewer.