Changeset 60854 in vbox for trunk/src/VBox
- Timestamp:
- May 5, 2016 6:18:02 PM (9 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r60852 r60854 439 439 static VBOXSTRICTRC iomIOPortRing3WritePending(PVMCPU pVCpu, RTIOPORT Port, uint32_t u32Value, size_t cbValue) 440 440 { 441 Log (("iomIOPortRing3WritePending: %#x LB %u -> %RTiop\n", u32Value, cbValue, Port));441 Log5(("iomIOPortRing3WritePending: %#x LB %u -> %RTiop\n", u32Value, cbValue, Port)); 442 442 AssertReturn(pVCpu->iom.s.PendingIOPortWrite.cbValue == 0, VERR_IOM_IOPORT_IPE_1); 443 443 pVCpu->iom.s.PendingIOPortWrite.IOPort = Port; -
trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
r60852 r60854 249 249 static VBOXSTRICTRC iomMmioRing3WritePending(PVMCPU pVCpu, RTGCPHYS GCPhys, void const *pvBuf, size_t cbBuf, PIOMMMIORANGE pRange) 250 250 { 251 Log 3(("iomMmioRing3WritePending: %RGp LB %#x\n", GCPhys, cbBuf));251 Log5(("iomMmioRing3WritePending: %RGp LB %#x\n", GCPhys, cbBuf)); 252 252 AssertReturn(pVCpu->iom.s.PendingMmioWrite.cbValue == 0, VERR_IOM_MMIO_IPE_1); 253 253 pVCpu->iom.s.PendingMmioWrite.GCPhys = GCPhys; … … 271 271 * VINF_IOM_R3_MMIO_READ may be returned. 272 272 * 273 * @param pVM The cross context VM structure. 274 * @param pRange The range to write to. 275 * @param GCPhys The physical address to start writing. 276 * @param pvValue Where to store the value. 277 * @param cbValue The size of the value to write. 278 */ 279 static VBOXSTRICTRC iomMMIODoComplicatedWrite(PVM pVM, PIOMMMIORANGE pRange, RTGCPHYS GCPhys, void const *pvValue, unsigned cbValue) 273 * @param pVM The cross context VM structure. 274 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 275 * @param pRange The range to write to. 276 * @param GCPhys The physical address to start writing. 277 * @param pvValue Where to store the value. 278 * @param cbValue The size of the value to write. 279 */ 280 static VBOXSTRICTRC iomMMIODoComplicatedWrite(PVM pVM, PVMCPU pVCpu, PIOMMMIORANGE pRange, RTGCPHYS GCPhys, 281 void const *pvValue, unsigned cbValue) 280 282 { 281 283 AssertReturn( (pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) != IOMMMIO_FLAGS_WRITE_PASSTHRU … … 349 351 u32MissingValue = 0; 350 352 break; 353 #ifndef IN_RING3 351 354 case VINF_IOM_R3_MMIO_READ: 352 355 case VINF_IOM_R3_MMIO_READ_WRITE: 353 356 case VINF_IOM_R3_MMIO_WRITE: 354 /** @todo What if we've split a transfer and already read355 * something? Since writes generally have sideeffects we356 * could be kind of screwed here...357 *358 * Fix: VINF_IOM_R3_IOPORT_COMMIT_WRITE (part 2) */359 357 LogFlow(("iomMMIODoComplicatedWrite: GCPhys=%RGp GCPhysStart=%RGp cbValue=%u rc=%Rrc [read]\n", GCPhys, GCPhysStart, cbValue, rc2)); 360 return rc2; 358 rc2 = VBOXSTRICTRC_TODO(iomMmioRing3WritePending(pVCpu, GCPhys, pvValue, cbValue, pRange)); 359 if (rc == VINF_SUCCESS || rc2 < rc) 360 rc = rc2; 361 return rc; 362 #endif 361 363 default: 362 364 if (RT_FAILURE(rc2)) … … 417 419 case VINF_SUCCESS: 418 420 break; 421 #ifndef IN_RING3 419 422 case VINF_IOM_R3_MMIO_READ: 420 423 case VINF_IOM_R3_MMIO_READ_WRITE: 421 424 case VINF_IOM_R3_MMIO_WRITE: 422 /** @todo What if we've split a transfer and already read 423 * something? Since reads can have sideeffects we could be 424 * kind of screwed here... 425 * 426 * Fix: VINF_IOM_R3_IOPORT_COMMIT_WRITE (part 2) */ 427 LogFlow(("iomMMIODoComplicatedWrite: GCPhys=%RGp GCPhysStart=%RGp cbValue=%u rc=%Rrc [write]\n", GCPhys, GCPhysStart, cbValue, rc2)); 425 Log3(("iomMMIODoComplicatedWrite: deferring GCPhys=%RGp GCPhysStart=%RGp cbValue=%u rc=%Rrc [write]\n", GCPhys, GCPhysStart, cbValue, rc2)); 426 AssertReturn(pVCpu->iom.s.PendingMmioWrite.cbValue == 0, VERR_IOM_MMIO_IPE_1); 427 AssertReturn(cbValue + (GCPhys & 3) <= sizeof(pVCpu->iom.s.PendingMmioWrite.abValue), VERR_IOM_MMIO_IPE_2); 428 pVCpu->iom.s.PendingMmioWrite.GCPhys = GCPhys & ~(RTGCPHYS)3; 429 pVCpu->iom.s.PendingMmioWrite.cbValue = cbValue + (GCPhys & 3); 430 *(uint32_t *)pVCpu->iom.s.PendingMmioWrite.abValue = u32Value; 431 if (cbValue > cbThisPart) 432 memcpy(&pVCpu->iom.s.PendingMmioWrite.abValue[4], 433 (uint8_t const *)pvValue + cbThisPart, cbValue - cbThisPart); 434 VMCPU_FF_SET(pVCpu, VMCPU_FF_IOM); 435 if (rc == VINF_SUCCESS) 436 rc = VINF_IOM_R3_MMIO_COMMIT_WRITE; 428 437 return rc2; 438 #endif 429 439 default: 430 440 if (RT_FAILURE(rc2)) … … 487 497 GCPhysFault, (void *)pvData, cb); /** @todo fix const!! */ 488 498 else 489 rcStrict = iomMMIODoComplicatedWrite(pVM, p Range, GCPhysFault, pvData, cb);499 rcStrict = iomMMIODoComplicatedWrite(pVM, pVCpu, pRange, GCPhysFault, pvData, cb); 490 500 } 491 501 else … … 2311 2321 GCPhys, &u32Value, (unsigned)cbValue); 2312 2322 else 2313 rc = iomMMIODoComplicatedWrite(pVM, p Range, GCPhys, &u32Value, (unsigned)cbValue);2323 rc = iomMMIODoComplicatedWrite(pVM, pVCpu, pRange, GCPhys, &u32Value, (unsigned)cbValue); 2314 2324 STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfWrite), a); 2315 2325 #ifndef IN_RING3 -
trunk/src/VBox/VMM/include/IOMInternal.h
r60849 r60854 418 418 RTGCPHYS GCPhys; 419 419 /** The value to write. */ 420 uint8_t abValue[ 16];420 uint8_t abValue[24]; 421 421 /** The number of bytes to write (0 if nothing pending). */ 422 422 uint32_t cbValue;
Note:
See TracChangeset
for help on using the changeset viewer.