Changeset 97200 in vbox
- Timestamp:
- Oct 18, 2022 11:38:42 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154175
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/em.h
r97197 r97200 272 272 PDISCPUSTATE pDISState, unsigned *pcbInstr); 273 273 VMM_INT_DECL(VBOXSTRICTRC) EMInterpretInstruction(PVMCPUCC pVCpu); 274 VMM_INT_DECL(VBOXSTRICTRC) EMInterpretInstructionEx(PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbWritten); 275 VMM_INT_DECL(VBOXSTRICTRC) EMInterpretInstructionDisasState(PVMCPUCC pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pCoreCtx, 276 RTGCPTR pvFault, EMCODETYPE enmCodeType); 274 VMM_INT_DECL(VBOXSTRICTRC) EMInterpretInstructionDisasState(PVMCPUCC pVCpu, PDISCPUSTATE pDis, uint64_t rip); 277 275 VMM_INT_DECL(int) EMInterpretRdpmc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame); 278 276 VMM_INT_DECL(int) EMInterpretDRxWrite(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegDrx, uint32_t SrcRegGen); -
trunk/include/VBox/vmm/iem.h
r97197 r97200 289 289 290 290 VMMDECL(VBOXSTRICTRC) IEMExecOne(PVMCPUCC pVCpu); 291 VMMDECL(VBOXSTRICTRC) IEMExecOneEx(PVMCPUCC pVCpu, PCPUMCTXCORE pCtxCore,uint32_t *pcbWritten);292 VMMDECL(VBOXSTRICTRC) IEMExecOneWithPrefetchedByPC(PVMCPUCC pVCpu, PCPUMCTXCORE pCtxCore,uint64_t OpcodeBytesPC,291 VMMDECL(VBOXSTRICTRC) IEMExecOneEx(PVMCPUCC pVCpu, uint32_t *pcbWritten); 292 VMMDECL(VBOXSTRICTRC) IEMExecOneWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC, 293 293 const void *pvOpcodeBytes, size_t cbOpcodeBytes); 294 294 VMMDECL(VBOXSTRICTRC) IEMExecOneBypassEx(PVMCPUCC pVCpu, uint32_t *pcbWritten); 295 VMMDECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPC(PVMCPUCC pVCpu, PCPUMCTXCORE pCtxCore,uint64_t OpcodeBytesPC,295 VMMDECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC, 296 296 const void *pvOpcodeBytes, size_t cbOpcodeBytes); 297 VMMDECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPCWritten(PVMCPUCC pVCpu, PCPUMCTXCORE pCtxCore, uint64_t OpcodeBytesPC,298 const void *pvOpcodeBytes, size_t cbOpcodeBytes,299 uint32_t *pcbWritten);300 297 VMMDECL(VBOXSTRICTRC) IEMExecOneIgnoreLock(PVMCPUCC pVCpu); 301 298 VMMDECL(VBOXSTRICTRC) IEMExecLots(PVMCPUCC pVCpu, uint32_t cMaxInstructions, uint32_t cPollRate, uint32_t *pcInstructions); -
trunk/src/VBox/VMM/VMMAll/DBGFAllBp.cpp
r97196 r97200 194 194 /* Replace the int3 with the original instruction byte. */ 195 195 abInstr[0] = pBp->Pub.u.Int3.bOrg; 196 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx),GCPtrInstr, &abInstr[0], sizeof(abInstr));196 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, GCPtrInstr, &abInstr[0], sizeof(abInstr)); 197 197 if ( rcStrict == VINF_SUCCESS 198 198 && DBGF_BP_PUB_IS_EXEC_AFTER(&pBp->Pub)) -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r97197 r97200 993 993 * @param pDis The disassembler cpu state for the instruction to be 994 994 * interpreted. 995 * @param pRegFrame The register frame. IP/EIP/RIP *IS* changed! 996 * @param pvFault The fault address (CR2). 997 * @param enmCodeType Code type (user/supervisor) 995 * @param rip The instruction pointer value. 998 996 * 999 997 * @remark Invalid opcode exceptions have a higher priority than GP (see Intel … … 1004 1002 * Make sure this can't happen!! (will add some assertions/checks later) 1005 1003 */ 1006 VMM_INT_DECL(VBOXSTRICTRC) EMInterpretInstructionDisasState(PVMCPUCC pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame, 1007 RTGCPTR pvFault, EMCODETYPE enmCodeType) 1008 { 1009 LogFlow(("EMInterpretInstructionDisasState %RGv fault %RGv\n", (RTGCPTR)pRegFrame->rip, pvFault)); 1010 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu)); 1011 NOREF(pDis); NOREF(pvFault); NOREF(enmCodeType); 1012 1013 VBOXSTRICTRC rc = IEMExecOneBypassWithPrefetchedByPC(pVCpu, pRegFrame, pRegFrame->rip, pDis->abInstr, pDis->cbCachedInstr); 1004 VMM_INT_DECL(VBOXSTRICTRC) EMInterpretInstructionDisasState(PVMCPUCC pVCpu, PDISCPUSTATE pDis, uint64_t rip) 1005 { 1006 LogFlow(("EMInterpretInstructionDisasState %RGv\n", (RTGCPTR)rip)); 1007 1008 VBOXSTRICTRC rc = IEMExecOneBypassWithPrefetchedByPC(pVCpu, rip, pDis->abInstr, pDis->cbCachedInstr); 1014 1009 if (RT_UNLIKELY( rc == VERR_IEM_ASPECT_NOT_IMPLEMENTED 1015 1010 || rc == VERR_IEM_INSTR_NOT_IMPLEMENTED)) -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r97197 r97200 9797 9797 9798 9798 9799 VMMDECL(VBOXSTRICTRC) IEMExecOneEx(PVMCPUCC pVCpu, PCPUMCTXCORE pCtxCore, uint32_t *pcbWritten) 9800 { 9801 AssertReturn(CPUMCTX2CORE(IEM_GET_CTX(pVCpu)) == pCtxCore, VERR_IEM_IPE_3); 9802 9799 VMMDECL(VBOXSTRICTRC) IEMExecOneEx(PVMCPUCC pVCpu, uint32_t *pcbWritten) 9800 { 9803 9801 uint32_t const cbOldWritten = pVCpu->iem.s.cbWritten; 9804 9802 VBOXSTRICTRC rcStrict = iemInitDecoderAndPrefetchOpcodes(pVCpu, false, false); … … 9816 9814 9817 9815 9818 VMMDECL(VBOXSTRICTRC) IEMExecOneWithPrefetchedByPC(PVMCPUCC pVCpu, PCPUMCTXCORE pCtxCore,uint64_t OpcodeBytesPC,9816 VMMDECL(VBOXSTRICTRC) IEMExecOneWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC, 9819 9817 const void *pvOpcodeBytes, size_t cbOpcodeBytes) 9820 9818 { 9821 AssertReturn(CPUMCTX2CORE(IEM_GET_CTX(pVCpu)) == pCtxCore, VERR_IEM_IPE_3);9822 9823 9819 VBOXSTRICTRC rcStrict; 9824 9820 if ( cbOpcodeBytes … … 9866 9862 9867 9863 9868 VMMDECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPC(PVMCPUCC pVCpu, PCPUMCTXCORE pCtxCore,uint64_t OpcodeBytesPC,9864 VMMDECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPC(PVMCPUCC pVCpu, uint64_t OpcodeBytesPC, 9869 9865 const void *pvOpcodeBytes, size_t cbOpcodeBytes) 9870 9866 { 9871 AssertReturn(CPUMCTX2CORE(IEM_GET_CTX(pVCpu)) == pCtxCore, VERR_IEM_IPE_3);9872 9873 9867 VBOXSTRICTRC rcStrict; 9874 9868 if ( cbOpcodeBytes … … 9892 9886 if (rcStrict == VINF_SUCCESS) 9893 9887 rcStrict = iemExecOneInner(pVCpu, false, "IEMExecOneBypassWithPrefetchedByPC"); 9894 else if (pVCpu->iem.s.cActiveMappings > 0)9895 iemMemRollback(pVCpu);9896 9897 return rcStrict;9898 }9899 9900 9901 /**9902 * For debugging DISGetParamSize, may come in handy.9903 *9904 * @returns Strict VBox status code.9905 * @param pVCpu The cross context virtual CPU structure of the9906 * calling EMT.9907 * @param pCtxCore The context core structure.9908 * @param OpcodeBytesPC The PC of the opcode bytes.9909 * @param pvOpcodeBytes Prefeched opcode bytes.9910 * @param cbOpcodeBytes Number of prefetched bytes.9911 * @param pcbWritten Where to return the number of bytes written.9912 * Optional.9913 */9914 VMMDECL(VBOXSTRICTRC) IEMExecOneBypassWithPrefetchedByPCWritten(PVMCPUCC pVCpu, PCPUMCTXCORE pCtxCore, uint64_t OpcodeBytesPC,9915 const void *pvOpcodeBytes, size_t cbOpcodeBytes,9916 uint32_t *pcbWritten)9917 {9918 AssertReturn(CPUMCTX2CORE(IEM_GET_CTX(pVCpu)) == pCtxCore, VERR_IEM_IPE_3);9919 9920 uint32_t const cbOldWritten = pVCpu->iem.s.cbWritten;9921 VBOXSTRICTRC rcStrict;9922 if ( cbOpcodeBytes9923 && pVCpu->cpum.GstCtx.rip == OpcodeBytesPC)9924 {9925 iemInitDecoder(pVCpu, true, false);9926 #ifdef IEM_WITH_CODE_TLB9927 pVCpu->iem.s.uInstrBufPc = OpcodeBytesPC;9928 pVCpu->iem.s.pbInstrBuf = (uint8_t const *)pvOpcodeBytes;9929 pVCpu->iem.s.cbInstrBufTotal = (uint16_t)RT_MIN(X86_PAGE_SIZE, cbOpcodeBytes);9930 pVCpu->iem.s.offCurInstrStart = 0;9931 pVCpu->iem.s.offInstrNextByte = 0;9932 #else9933 pVCpu->iem.s.cbOpcode = (uint8_t)RT_MIN(cbOpcodeBytes, sizeof(pVCpu->iem.s.abOpcode));9934 memcpy(pVCpu->iem.s.abOpcode, pvOpcodeBytes, pVCpu->iem.s.cbOpcode);9935 #endif9936 rcStrict = VINF_SUCCESS;9937 }9938 else9939 rcStrict = iemInitDecoderAndPrefetchOpcodes(pVCpu, true, false);9940 if (rcStrict == VINF_SUCCESS)9941 {9942 rcStrict = iemExecOneInner(pVCpu, false, "IEMExecOneBypassWithPrefetchedByPCWritten");9943 if (pcbWritten)9944 *pcbWritten = pVCpu->iem.s.cbWritten - cbOldWritten;9945 }9946 9888 else if (pVCpu->iem.s.cActiveMappings > 0) 9947 9889 iemMemRollback(pVCpu); -
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r97178 r97200 1544 1544 // Log4(("InstructionByteCount=%#x %.16Rhxs\n", pMsg->InstructionByteCount, pMsg->InstructionBytes)); 1545 1545 if (pExit->MemoryAccess.InstructionByteCount > 0) 1546 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx), pExit->VpContext.Rip, 1547 pExit->MemoryAccess.InstructionBytes, pExit->MemoryAccess.InstructionByteCount); 1546 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, pExit->VpContext.Rip, pExit->MemoryAccess.InstructionBytes, pExit->MemoryAccess.InstructionByteCount); 1548 1547 else 1549 1548 rcStrict = IEMExecOne(pVCpu); … … 2174 2173 pExit->VpContext.ExecutionState.EferLma && pExit->VpContext.Cs.Long )) 2175 2174 { 2176 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx),pExit->VpContext.Rip,2175 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, pExit->VpContext.Rip, 2177 2176 pExit->VpException.InstructionBytes, 2178 2177 pExit->VpException.InstructionByteCount); … … 2203 2202 { 2204 2203 #if 1 /** @todo Need to emulate instruction or we get a triple fault when trying to inject the \#GP... */ 2205 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx),pExit->VpContext.Rip,2204 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, pExit->VpContext.Rip, 2206 2205 pExit->VpException.InstructionBytes, 2207 2206 pExit->VpException.InstructionByteCount); -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r97199 r97200 901 901 */ 902 902 int rc = VINF_SUCCESS; 903 VBOXSTRICTRC rc2 = EMInterpretInstructionDisasState(pVCpu, pDis, CPUMCTX2CORE(pCtx), pvFault, EMCODETYPE_ALL);903 VBOXSTRICTRC rc2 = EMInterpretInstructionDisasState(pVCpu, pDis, pCtx->rip); 904 904 if (rc2 == VINF_SUCCESS) 905 905 { /* do nothing */ } … … 1036 1036 * Interpret the instruction. 1037 1037 */ 1038 VBOXSTRICTRC rc = EMInterpretInstructionDisasState(pVCpu, pDis, CPUMCTX2CORE(pCtx), pvFault, EMCODETYPE_ALL);1038 VBOXSTRICTRC rc = EMInterpretInstructionDisasState(pVCpu, pDis, pCtx->rip); 1039 1039 if (RT_SUCCESS(rc)) 1040 1040 AssertMsg(rc == VINF_SUCCESS, ("%Rrc\n", VBOXSTRICTRC_VAL(rc))); /* ASSUMES no complicated stuff here. */ -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r97197 r97200 8463 8463 | CPUMCTX_EXTRN_SREG_MASK /* without ES+DS+GS the app will #GP later - go figure */); 8464 8464 Log6(("hmR0SvmExitXcptUD: sysenter/sysexit: %.*Rhxs at %#llx CPL=%u\n", cbInstr, abInstr, GCPtrInstr, uCpl)); 8465 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx),GCPtrInstr, abInstr, cbInstr);8465 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, GCPtrInstr, abInstr, cbInstr); 8466 8466 Log6(("hmR0SvmExitXcptUD: sysenter/sysexit: rcStrict=%Rrc %04x:%08RX64 %08RX64 %04x:%08RX64\n", 8467 8467 VBOXSTRICTRC_VAL(rcStrict), pVCpu->cpum.GstCtx.cs.Sel, pVCpu->cpum.GstCtx.rip, pVCpu->cpum.GstCtx.rflags.u, -
trunk/src/VBox/VMM/VMMR3/DBGFR3Bp.cpp
r96407 r97200 1987 1987 /* Replace the int3 with the original instruction byte. */ 1988 1988 abInstr[0] = pBp->Pub.u.Int3.bOrg; 1989 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx), GCPtrInstr, 1990 &abInstr[0], sizeof(abInstr)); 1989 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, GCPtrInstr, &abInstr[0], sizeof(abInstr)); 1991 1990 if ( rcStrict == VINF_SUCCESS 1992 1991 && DBGF_BP_PUB_IS_EXEC_AFTER(&pBp->Pub))
Note:
See TracChangeset
for help on using the changeset viewer.