Changeset 40450 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Mar 13, 2012 3:56:22 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 76807
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r40449 r40450 76 76 *******************************************************************************/ 77 77 #ifndef VBOX_WITH_IEM 78 DECLINLINE(VBOXSTRICTRC) emInterpretInstructionCPUOuter(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame,78 DECLINLINE(VBOXSTRICTRC) emInterpretInstructionCPUOuter(PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame, 79 79 RTGCPTR pvFault, EMCODETYPE enmCodeType, uint32_t *pcbSize); 80 80 #endif … … 474 474 * @retval VERR_* Fatal errors. 475 475 * 476 * @param pVM The VM handle.477 476 * @param pVCpu The VMCPU handle. 478 477 * @param pRegFrame The register frame. … … 485 484 * to worry about e.g. invalid modrm combinations (!) 486 485 */ 487 VMMDECL(VBOXSTRICTRC) EMInterpretInstruction(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault)486 VMMDECL(VBOXSTRICTRC) EMInterpretInstruction(PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault) 488 487 { 489 488 LogFlow(("EMInterpretInstruction %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault)); … … 511 510 Assert(cbOp == pDis->opsize); 512 511 uint32_t cbIgnored; 513 rc = emInterpretInstructionCPUOuter(pV M, pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_SUPERVISOR, &cbIgnored);512 rc = emInterpretInstructionCPUOuter(pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_SUPERVISOR, &cbIgnored); 514 513 if (RT_SUCCESS(rc)) 515 514 pRegFrame->rip += cbOp; /* Move on to the next instruction. */ … … 567 566 { 568 567 Assert(cbOp == pDis->opsize); 569 rc = emInterpretInstructionCPUOuter(pV M, pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_SUPERVISOR, pcbWritten);568 rc = emInterpretInstructionCPUOuter(pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_SUPERVISOR, pcbWritten); 570 569 if (RT_SUCCESS(rc)) 571 570 pRegFrame->rip += cbOp; /* Move on to the next instruction. */ … … 607 606 * Make sure this can't happen!! (will add some assertions/checks later) 608 607 */ 609 VMMDECL(VBOXSTRICTRC) EMInterpretInstructionCpuUpdtPC(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame,608 VMMDECL(VBOXSTRICTRC) EMInterpretInstructionCpuUpdtPC(PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame, 610 609 RTGCPTR pvFault, EMCODETYPE enmCodeType) 611 610 { 612 611 STAM_PROFILE_START(&pVCpu->em.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Emulate), a); 613 612 uint32_t cbIgnored; 614 VBOXSTRICTRC rc = emInterpretInstructionCPUOuter(pV M, pVCpu, pDis, pRegFrame, pvFault, enmCodeType, &cbIgnored);613 VBOXSTRICTRC rc = emInterpretInstructionCPUOuter(pVCpu, pDis, pRegFrame, pvFault, enmCodeType, &cbIgnored); 615 614 STAM_PROFILE_STOP(&pVCpu->em.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Emulate), a); 616 615 if (RT_SUCCESS(rc)) … … 3345 3344 * @retval VERR_* Fatal errors. 3346 3345 * 3347 * @param pVM The VM handle.3348 3346 * @param pVCpu The VMCPU handle. 3349 3347 * @param pDis The disassembler cpu state for the instruction to be … … 3361 3359 * Make sure this can't happen!! (will add some assertions/checks later) 3362 3360 */ 3363 DECLINLINE(VBOXSTRICTRC) emInterpretInstructionCPUOuter(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame,3361 DECLINLINE(VBOXSTRICTRC) emInterpretInstructionCPUOuter(PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame, 3364 3362 RTGCPTR pvFault, EMCODETYPE enmCodeType, uint32_t *pcbSize) 3365 3363 { 3366 3364 STAM_PROFILE_START(&pVCpu->em.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Emulate), a); 3367 VBOXSTRICTRC rc = emInterpretInstructionCPU(pV M, pVCpu, pDis, pRegFrame, pvFault, enmCodeType, pcbSize);3365 VBOXSTRICTRC rc = emInterpretInstructionCPU(pVCpu->CTX_SUFF(pVM), pVCpu, pDis, pRegFrame, pvFault, enmCodeType, pcbSize); 3368 3366 STAM_PROFILE_STOP(&pVCpu->em.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Emulate), a); 3369 3367 if (RT_SUCCESS(rc)) -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r40447 r40450 807 807 VMMDECL(VBOXSTRICTRC) PGMInterpretInstruction(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault) 808 808 { 809 VBOXSTRICTRC rc = EMInterpretInstruction(pV M, pVCpu, pRegFrame, pvFault);809 VBOXSTRICTRC rc = EMInterpretInstruction(pVCpu, pRegFrame, pvFault); 810 810 if (rc == VERR_EM_INTERPRETER) 811 811 rc = VINF_EM_RAW_EMULATE_INSTR; -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r40442 r40450 840 840 * Must do this in raw mode (!); XP boot will fail otherwise. 841 841 */ 842 VBOXSTRICTRC rc2 = EMInterpretInstructionCpuUpdtPC(pV M, pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_ALL);842 VBOXSTRICTRC rc2 = EMInterpretInstructionCpuUpdtPC(pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_ALL); 843 843 if (RT_SUCCESS(rc2)) 844 844 AssertMsg(rc2 == VINF_SUCCESS, ("%Rrc\n", VBOXSTRICTRC_VAL(rc2))); /* ASSUMES no complicated stuff here. */ … … 979 979 * Interpret the instruction. 980 980 */ 981 VBOXSTRICTRC rc = EMInterpretInstructionCpuUpdtPC(pV M, pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_ALL);981 VBOXSTRICTRC rc = EMInterpretInstructionCpuUpdtPC(pVCpu, pDis, pRegFrame, pvFault, EMCODETYPE_ALL); 982 982 if (RT_SUCCESS(rc)) 983 983 AssertMsg(rc == VINF_SUCCESS, ("%Rrc\n", VBOXSTRICTRC_VAL(rc))); /* ASSUMES no complicated stuff here. */ -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r40449 r40450 2057 2057 Log2(("SVM: %RGv mov cr%d, \n", (RTGCPTR)pCtx->rip, exitCode - SVM_EXIT_WRITE_CR0)); 2058 2058 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxWrite[exitCode - SVM_EXIT_WRITE_CR0]); 2059 rc = EMInterpretInstruction(pV M, pVCpu, CPUMCTX2CORE(pCtx), 0);2059 rc = EMInterpretInstruction(pVCpu, CPUMCTX2CORE(pCtx), 0); 2060 2060 2061 2061 switch (exitCode - SVM_EXIT_WRITE_CR0) … … 2096 2096 Log2(("SVM: %RGv mov x, cr%d\n", (RTGCPTR)pCtx->rip, exitCode - SVM_EXIT_READ_CR0)); 2097 2097 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxRead[exitCode - SVM_EXIT_READ_CR0]); 2098 rc = EMInterpretInstruction(pV M, pVCpu, CPUMCTX2CORE(pCtx), 0);2098 rc = EMInterpretInstruction(pVCpu, CPUMCTX2CORE(pCtx), 0); 2099 2099 if (rc == VINF_SUCCESS) 2100 2100 { … … 2131 2131 } 2132 2132 2133 rc = EMInterpretInstruction(pV M, pVCpu, CPUMCTX2CORE(pCtx), 0);2133 rc = EMInterpretInstruction(pVCpu, CPUMCTX2CORE(pCtx), 0); 2134 2134 if (rc == VINF_SUCCESS) 2135 2135 { … … 2166 2166 } 2167 2167 2168 rc = EMInterpretInstruction(pV M, pVCpu, CPUMCTX2CORE(pCtx), 0);2168 rc = EMInterpretInstruction(pVCpu, CPUMCTX2CORE(pCtx), 0); 2169 2169 if (rc == VINF_SUCCESS) 2170 2170 { … … 2450 2450 STAM_COUNTER_INC((pVMCB->ctrl.u64ExitInfo1 == 0) ? &pVCpu->hwaccm.s.StatExitRdmsr : &pVCpu->hwaccm.s.StatExitWrmsr); 2451 2451 Log(("SVM: %s\n", (pVMCB->ctrl.u64ExitInfo1 == 0) ? "rdmsr" : "wrmsr")); 2452 rc = EMInterpretInstruction(pV M, pVCpu, CPUMCTX2CORE(pCtx), 0);2452 rc = EMInterpretInstruction(pVCpu, CPUMCTX2CORE(pCtx), 0); 2453 2453 if (rc == VINF_SUCCESS) 2454 2454 { -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r40449 r40450 3335 3335 3336 3336 default: 3337 rc = EMInterpretInstructionCpuUpdtPC(pV M, pVCpu, pDis, CPUMCTX2CORE(pCtx), 0, EMCODETYPE_SUPERVISOR);3337 rc = EMInterpretInstructionCpuUpdtPC(pVCpu, pDis, CPUMCTX2CORE(pCtx), 0, EMCODETYPE_SUPERVISOR); 3338 3338 fUpdateRIP = false; 3339 3339 break; … … 3660 3660 /* Note: the intel manual claims there's a REX version of RDMSR that's slightly different, so we play safe by completely disassembling the instruction. */ 3661 3661 Log2(("VMX: %s\n", (exitReason == VMX_EXIT_RDMSR) ? "rdmsr" : "wrmsr")); 3662 rc = EMInterpretInstruction(pV M, pVCpu, CPUMCTX2CORE(pCtx), 0);3662 rc = EMInterpretInstruction(pVCpu, CPUMCTX2CORE(pCtx), 0); 3663 3663 if (rc == VINF_SUCCESS) 3664 3664 { -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r40449 r40450 605 605 AssertRC(rc); 606 606 607 rc = VBOXSTRICTRC_TODO(EMInterpretInstructionCpuUpdtPC(pV M, pVCpu, &cpu, CPUMCTX2CORE(pCtx), 0, EMCODETYPE_SUPERVISOR));607 rc = VBOXSTRICTRC_TODO(EMInterpretInstructionCpuUpdtPC(pVCpu, &cpu, CPUMCTX2CORE(pCtx), 0, EMCODETYPE_SUPERVISOR)); 608 608 if (RT_SUCCESS(rc)) 609 609 return rc; … … 1094 1094 #endif 1095 1095 1096 rc = VBOXSTRICTRC_TODO(EMInterpretInstructionCpuUpdtPC(pV M, pVCpu, &Cpu, CPUMCTX2CORE(pCtx), 0, EMCODETYPE_SUPERVISOR));1096 rc = VBOXSTRICTRC_TODO(EMInterpretInstructionCpuUpdtPC(pVCpu, &Cpu, CPUMCTX2CORE(pCtx), 0, EMCODETYPE_SUPERVISOR)); 1097 1097 if (RT_SUCCESS(rc)) 1098 1098 { -
trunk/src/VBox/VMM/VMMRC/PATMRC.cpp
r40449 r40450 112 112 /* This part of the page was not patched; try to emulate the instruction. */ 113 113 LogFlow(("PATMHandleWriteToPatchPage: Interpret %x accessing %RRv\n", pRegFrame->eip, GCPtr)); 114 int rc = EMInterpretInstruction( pVM,VMMGetCpu0(pVM), pRegFrame, (RTGCPTR)(RTRCUINTPTR)GCPtr);114 int rc = EMInterpretInstruction(VMMGetCpu0(pVM), pRegFrame, (RTGCPTR)(RTRCUINTPTR)GCPtr); 115 115 if (rc == VINF_SUCCESS) 116 116 { … … 520 520 } 521 521 522 rc = EMInterpretInstructionCpuUpdtPC( pVM,VMMGetCpu0(pVM), &cpu, pRegFrame, 0 /* not relevant here */,522 rc = EMInterpretInstructionCpuUpdtPC(VMMGetCpu0(pVM), &cpu, pRegFrame, 0 /* not relevant here */, 523 523 EMCODETYPE_SUPERVISOR); 524 524 if (rc != VINF_SUCCESS) -
trunk/src/VBox/VMM/VMMRC/SELMRC.cpp
r40447 r40450 194 194 /** @todo should check if any affected selectors are loaded. */ 195 195 uint32_t cb; 196 rc = EMInterpretInstructionEx(pV M, pVCpu, pRegFrame, (RTGCPTR)(RTRCUINTPTR)pvFault, &cb);196 rc = EMInterpretInstructionEx(pVCpu, pRegFrame, (RTGCPTR)(RTRCUINTPTR)pvFault, &cb); 197 197 if (RT_SUCCESS(rc) && cb) 198 198 { … … 305 305 */ 306 306 uint32_t cb; 307 int rc = EMInterpretInstructionEx(pV M, pVCpu, pRegFrame, (RTGCPTR)(RTRCUINTPTR)pvFault, &cb);307 int rc = EMInterpretInstructionEx(pVCpu, pRegFrame, (RTGCPTR)(RTRCUINTPTR)pvFault, &cb); 308 308 if (RT_SUCCESS(rc) && cb) 309 309 { -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r40449 r40450 556 556 { 557 557 LogFlow(("TRPMGCTrap06Handler: -> EMInterpretInstructionCPU\n")); 558 rc = EMInterpretInstructionCpuUpdtPC(pV M, pVCpu, &Cpu, pRegFrame, PC, EMCODETYPE_SUPERVISOR);558 rc = EMInterpretInstructionCpuUpdtPC(pVCpu, &Cpu, pRegFrame, PC, EMCODETYPE_SUPERVISOR); 559 559 } 560 560 /* Never generate a raw trap here; it might be an instruction, that requires emulation. */ … … 798 798 case OP_WRMSR: 799 799 { 800 rc = EMInterpretInstructionCpuUpdtPC(pV M, pVCpu, pCpu, pRegFrame, PC, EMCODETYPE_SUPERVISOR);800 rc = EMInterpretInstructionCpuUpdtPC(pVCpu, pCpu, pRegFrame, PC, EMCODETYPE_SUPERVISOR); 801 801 if (rc == VERR_EM_INTERPRETER) 802 802 rc = VINF_EM_RAW_EXCEPTION_PRIVILEGED; … … 874 874 case OP_RDPMC: 875 875 { 876 rc = EMInterpretInstructionCpuUpdtPC(pV M, pVCpu, pCpu, pRegFrame, PC, EMCODETYPE_SUPERVISOR);876 rc = EMInterpretInstructionCpuUpdtPC(pVCpu, pCpu, pRegFrame, PC, EMCODETYPE_SUPERVISOR); 877 877 if (rc == VERR_EM_INTERPRETER) 878 878 rc = VINF_EM_RAW_EXCEPTION_PRIVILEGED;
Note:
See TracChangeset
for help on using the changeset viewer.