Changeset 80016 in vbox for trunk/src/VBox/VMM/VMMAll/EMAll.cpp
- Timestamp:
- Jul 26, 2019 5:06:38 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r80007 r80016 1006 1006 { 1007 1007 PVMCPU pVCpu = (PVMCPU)pDis->pvUser; 1008 #if defined(VBOX_WITH_RAW_MODE) && (defined(IN_RC) || defined(IN_RING3))1009 PVM pVM = pVCpu->CTX_SUFF(pVM);1010 #endif1011 1008 RTUINTPTR uSrcAddr = pDis->uInstrAddr + offInstr; 1012 int rc;1013 1009 1014 1010 /* … … 1021 1017 cbToRead = cbMinRead; 1022 1018 1023 #if defined(VBOX_WITH_RAW_MODE) && (defined(IN_RC) || defined(IN_RING3)) 1024 /* 1025 * We might be called upon to interpret an instruction in a patch. 1026 */ 1027 if (PATMIsPatchGCAddr(pVM, uSrcAddr)) 1019 int rc = PGMPhysSimpleReadGCPtr(pVCpu, &pDis->abInstr[offInstr], uSrcAddr, cbToRead); 1020 if (RT_FAILURE(rc)) 1028 1021 { 1029 # ifdef IN_RC 1030 memcpy(&pDis->abInstr[offInstr], (void *)(uintptr_t)uSrcAddr, cbToRead); 1031 # else 1032 memcpy(&pDis->abInstr[offInstr], PATMR3GCPtrToHCPtr(pVM, uSrcAddr), cbToRead); 1033 # endif 1034 rc = VINF_SUCCESS; 1035 } 1036 else 1037 #endif 1038 { 1039 # ifdef IN_RC 1040 /* 1041 * Try access it thru the shadow page tables first. Fall back on the 1042 * slower PGM method if it fails because the TLB or page table was 1043 * modified recently. 1044 */ 1045 rc = MMGCRamRead(pVCpu->pVMRC, &pDis->abInstr[offInstr], (void *)(uintptr_t)uSrcAddr, cbToRead); 1046 if (rc == VERR_ACCESS_DENIED && cbToRead > cbMinRead) 1022 if (cbToRead > cbMinRead) 1047 1023 { 1048 1024 cbToRead = cbMinRead; 1049 rc = MMGCRamRead(pVCpu->pVMRC, &pDis->abInstr[offInstr], (void *)(uintptr_t)uSrcAddr, cbToRead);1025 rc = PGMPhysSimpleReadGCPtr(pVCpu, &pDis->abInstr[offInstr], uSrcAddr, cbToRead); 1050 1026 } 1051 if (rc == VERR_ACCESS_DENIED) 1027 if (RT_FAILURE(rc)) 1028 { 1029 #ifndef IN_RC 1030 /* 1031 * If we fail to find the page via the guest's page tables 1032 * we invalidate the page in the host TLB (pertaining to 1033 * the guest in the NestedPaging case). See @bugref{6043}. 1034 */ 1035 if (rc == VERR_PAGE_TABLE_NOT_PRESENT || rc == VERR_PAGE_NOT_PRESENT) 1036 { 1037 HMInvalidatePage(pVCpu, uSrcAddr); 1038 if (((uSrcAddr + cbToRead - 1) >> PAGE_SHIFT) != (uSrcAddr >> PAGE_SHIFT)) 1039 HMInvalidatePage(pVCpu, uSrcAddr + cbToRead - 1); 1040 } 1052 1041 #endif 1053 {1054 rc = PGMPhysSimpleReadGCPtr(pVCpu, &pDis->abInstr[offInstr], uSrcAddr, cbToRead);1055 if (RT_FAILURE(rc))1056 {1057 if (cbToRead > cbMinRead)1058 {1059 cbToRead = cbMinRead;1060 rc = PGMPhysSimpleReadGCPtr(pVCpu, &pDis->abInstr[offInstr], uSrcAddr, cbToRead);1061 }1062 if (RT_FAILURE(rc))1063 {1064 #ifndef IN_RC1065 /*1066 * If we fail to find the page via the guest's page tables1067 * we invalidate the page in the host TLB (pertaining to1068 * the guest in the NestedPaging case). See @bugref{6043}.1069 */1070 if (rc == VERR_PAGE_TABLE_NOT_PRESENT || rc == VERR_PAGE_NOT_PRESENT)1071 {1072 HMInvalidatePage(pVCpu, uSrcAddr);1073 if (((uSrcAddr + cbToRead - 1) >> PAGE_SHIFT) != (uSrcAddr >> PAGE_SHIFT))1074 HMInvalidatePage(pVCpu, uSrcAddr + cbToRead - 1);1075 }1076 #endif1077 }1078 }1079 1042 } 1080 1043 }
Note:
See TracChangeset
for help on using the changeset viewer.