Changeset 22331 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 18, 2009 4:12:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r20874 r22331 961 961 PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysFault, RTGCPTR pvFault) 962 962 { 963 Assert(pDis->mode == CPUMODE_32BIT); 963 unsigned uIncrement; 964 965 Assert(pDis->mode == CPUMODE_32BIT || pDis->mode == CPUMODE_64BIT); 966 Assert(pRegFrame->rcx <= 0x20); 967 968 if (pDis->mode == CPUMODE_32BIT) 969 uIncrement = 4; 970 else 971 uIncrement = 8; 964 972 965 973 Log3(("pgmPoolAccessHandlerSTOSD\n")); … … 980 988 PVMCPU pVCpu = VMMGetCpu(pPool->CTX_SUFF(pVM)); 981 989 RTGCUINTPTR pu32 = (RTGCUINTPTR)pvFault; 982 while (pRegFrame-> ecx)990 while (pRegFrame->rcx) 983 991 { 984 992 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 … … 992 1000 *(uint32_t *)pu32 = pRegFrame->eax; 993 1001 #else 994 PGMPhysSimpleWriteGCPhys(pVM, GCPhysFault, &pRegFrame-> eax, 4);995 #endif 996 pu32 += 4;997 GCPhysFault += 4;998 pRegFrame-> edi += 4;999 pRegFrame-> ecx--;1002 PGMPhysSimpleWriteGCPhys(pVM, GCPhysFault, &pRegFrame->rax, uIncrement); 1003 #endif 1004 pu32 += uIncrement; 1005 GCPhysFault += uIncrement; 1006 pRegFrame->rdi += uIncrement; 1007 pRegFrame->rcx--; 1000 1008 } 1001 1009 pRegFrame->rip += pDis->opsize; … … 1155 1163 if ( pDis->pCurInstr->opcode == OP_STOSWD 1156 1164 && CPUMGetGuestCPL(pVCpu, pRegFrame) == 0 1157 && pRegFrame->ecx <= 0x201158 && pRegFrame->ecx * 4 <= PAGE_SIZE - ((uintptr_t)pvFault & PAGE_OFFSET_MASK)1159 && !((uintptr_t)pvFault & 3)1160 && (pRegFrame->eax == 0 || pRegFrame->eax == 0x80) /* the two values observed. */1161 && pDis->mode == CPUMODE_32BIT1162 && pDis->opmode == CPUMODE_32BIT1163 && pDis->addrmode == CPUMODE_32BIT1164 1165 && pDis->prefix == PREFIX_REP 1165 1166 && !pRegFrame->eflags.Bits.u1DF 1166 ) 1167 { 1168 rc = pgmPoolAccessHandlerSTOSD(pVM, pPool, pPage, pDis, pRegFrame, GCPhysFault, pvFault); 1169 STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), &pPool->CTX_MID_Z(StatMonitor,RepStosd), a); 1170 pgmUnlock(pVM); 1171 return rc; 1167 && pDis->opmode == pDis->mode 1168 && pDis->addrmode == pDis->mode) 1169 { 1170 bool fValidStosd = false; 1171 1172 if ( pDis->mode == CPUMODE_32BIT 1173 && pRegFrame->ecx <= 0x20 1174 && pRegFrame->ecx * 4 <= PAGE_SIZE - ((uintptr_t)pvFault & PAGE_OFFSET_MASK) 1175 && !((uintptr_t)pvFault & 3) 1176 && (pRegFrame->eax == 0 || pRegFrame->eax == 0x80) /* the two values observed. */ 1177 ) 1178 { 1179 fValidStosd = true; 1180 pRegFrame->rcx &= 0xffffffff; /* paranoia */ 1181 } 1182 else 1183 if ( pDis->mode == CPUMODE_64BIT 1184 && pRegFrame->rcx <= 0x20 1185 && pRegFrame->rcx * 4 <= PAGE_SIZE - ((uintptr_t)pvFault & PAGE_OFFSET_MASK) 1186 && !((uintptr_t)pvFault & 3) 1187 && (pRegFrame->rax == 0 || pRegFrame->rax == 0x80) /* the two values observed. */ 1188 ) 1189 { 1190 fValidStosd = true; 1191 } 1192 1193 if (fValidStosd) 1194 { 1195 rc = pgmPoolAccessHandlerSTOSD(pVM, pPool, pPage, pDis, pRegFrame, GCPhysFault, pvFault); 1196 STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), &pPool->CTX_MID_Z(StatMonitor,RepStosd), a); 1197 pgmUnlock(pVM); 1198 return rc; 1199 } 1172 1200 } 1173 1201
Note:
See TracChangeset
for help on using the changeset viewer.