Changeset 47819 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Aug 16, 2013 7:45:01 PM (11 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r47769 r47819 94 94 #ifdef VBOX_WITH_RAW_MODE_NOT_R0 95 95 # include <VBox/vmm/patm.h> 96 # if defined(VBOX_WITH_CALL_RECORD) || defined(REM_MONITOR_CODE_PAGES) 97 # include <VBox/vmm/csam.h> 98 # endif 96 99 #endif 97 100 #include "IEMInternal.h" … … 1019 1022 * Read the bytes at this address. 1020 1023 */ 1021 uint32_t cbLeftOnPage = PAGE_SIZE - (GCPtrPC & PAGE_OFFSET_MASK); 1022 if (cbToTryRead > cbLeftOnPage) 1023 cbToTryRead = cbLeftOnPage; 1024 if (cbToTryRead > sizeof(pIemCpu->abOpcode)) 1025 cbToTryRead = sizeof(pIemCpu->abOpcode); 1026 /** @todo PATM: Read original, unpatched bytes? EMAll.cpp doesn't seem to be 1027 * doing that. */ 1028 if (!pIemCpu->fBypassHandlers) 1029 rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhys, pIemCpu->abOpcode, cbToTryRead); 1024 PVM pVM = IEMCPU_TO_VM(pIemCpu); 1025 #if defined(IN_RING3) && defined(VBOX_WITH_RAW_MODE_NOT_R0) 1026 size_t cbActual; 1027 if ( PATMIsEnabled(pVM) 1028 && RT_SUCCESS(PATMR3ReadOrgInstr(pVM, GCPtrPC, pIemCpu->abOpcode, sizeof(pIemCpu->abOpcode), &cbActual))) 1029 { 1030 Log4(("decode - Read %u unpatched bytes at %RGv\n", cbActual, GCPtrPC)); 1031 Assert(cbActual > 0); 1032 pIemCpu->cbOpcode = (uint8_t)cbActual; 1033 } 1030 1034 else 1031 rc = PGMPhysSimpleReadGCPhys(IEMCPU_TO_VM(pIemCpu), pIemCpu->abOpcode, GCPhys, cbToTryRead); 1032 if (rc != VINF_SUCCESS) 1033 { 1034 /** @todo status code handling */ 1035 Log(("iemInitDecoderAndPrefetchOpcodes: %RGv/%RGp LB %#x - read error - rc=%Rrc (!!)\n", 1036 GCPtrPC, GCPhys, rc, cbToTryRead)); 1037 return rc; 1038 } 1039 pIemCpu->cbOpcode = cbToTryRead; 1035 #endif 1036 { 1037 uint32_t cbLeftOnPage = PAGE_SIZE - (GCPtrPC & PAGE_OFFSET_MASK); 1038 if (cbToTryRead > cbLeftOnPage) 1039 cbToTryRead = cbLeftOnPage; 1040 if (cbToTryRead > sizeof(pIemCpu->abOpcode)) 1041 cbToTryRead = sizeof(pIemCpu->abOpcode); 1042 1043 if (!pIemCpu->fBypassHandlers) 1044 rc = PGMPhysRead(pVM, GCPhys, pIemCpu->abOpcode, cbToTryRead); 1045 else 1046 rc = PGMPhysSimpleReadGCPhys(pVM, pIemCpu->abOpcode, GCPhys, cbToTryRead); 1047 if (rc != VINF_SUCCESS) 1048 { 1049 /** @todo status code handling */ 1050 Log(("iemInitDecoderAndPrefetchOpcodes: %RGv/%RGp LB %#x - read error - rc=%Rrc (!!)\n", 1051 GCPtrPC, GCPhys, rc, cbToTryRead)); 1052 return rc; 1053 } 1054 pIemCpu->cbOpcode = cbToTryRead; 1055 } 1040 1056 1041 1057 return VINF_SUCCESS; … … 1137 1153 /* 1138 1154 * Read the bytes at this address. 1155 * 1156 * We read all unpatched bytes in iemInitDecoderAndPrefetchOpcodes already, 1157 * and since PATM should only patch the start of an instruction there 1158 * should be no need to check again here. 1139 1159 */ 1140 1160 if (!pIemCpu->fBypassHandlers) -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r47749 r47819 814 814 if (rcStrict != VINF_SUCCESS) 815 815 return rcStrict; 816 817 #if defined(IN_RING3) && defined(VBOX_WITH_RAW_MODE) && defined(VBOX_WITH_CALL_RECORD) 818 /* 819 * CASM hook for recording interesting indirect calls. 820 */ 821 if ( !pCtx->eflags.Bits.u1IF 822 && (pCtx->cr0 & X86_CR0_PG) 823 && !CSAMIsEnabled(IEMCPU_TO_VM(pIemCpu)) 824 && pIemCpu->uCpl == 0) 825 { 826 EMSTATE enmState = EMGetState(IEMCPU_TO_VMCPU(pIemCpu)); 827 if ( enmState == EMSTATE_IEM_THEN_REM 828 || enmState == EMSTATE_IEM 829 || enmState == EMSTATE_REM) 830 CSAMR3RecordCallAddress(IEMCPU_TO_VM(pIemCpu), pCtx->eip); 831 } 832 #endif 816 833 817 834 pCtx->rip = uNewPC;
Note:
See TracChangeset
for help on using the changeset viewer.