Changeset 82378 in vbox for trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
- Timestamp:
- Dec 4, 2019 12:13:45 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r82313 r82378 57 57 VMMDECL(VBOXSTRICTRC) IOMIOPortRead(PVMCC pVM, PVMCPU pVCpu, RTIOPORT Port, uint32_t *pu32Value, size_t cbValue) 58 58 { 59 STAM_COUNTER_INC(&pVM->iom.s.StatIoPortIn); 59 60 Assert(pVCpu->iom.s.PendingIOPortWrite.cbValue == 0); 60 61 … … 115 116 PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo)); 116 117 117 if (rcStrict == VINF_SUCCESS) 118 #ifndef IN_RING3 119 if (rcStrict == VINF_IOM_R3_IOPORT_READ) 120 STAM_COUNTER_INC(&pStats->InRZToR3); 121 else 122 #endif 123 { 118 124 STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(In)); 119 #ifndef IN_RING3 120 else if (rcStrict == VINF_IOM_R3_IOPORT_READ) 121 STAM_COUNTER_INC(&pStats->InRZToR3); 122 #endif 123 else if (rcStrict == VERR_IOM_IOPORT_UNUSED) 124 { 125 /* make return value */ 126 rcStrict = VINF_SUCCESS; 127 switch (cbValue) 125 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 126 if (rcStrict == VERR_IOM_IOPORT_UNUSED) 128 127 { 129 case 1: *(uint8_t *)pu32Value = 0xff; break; 130 case 2: *(uint16_t *)pu32Value = 0xffff; break; 131 case 4: *(uint32_t *)pu32Value = UINT32_C(0xffffffff); break; 132 default: 133 AssertMsgFailedReturn(("Invalid I/O port size %d. Port=%d\n", cbValue, Port), VERR_IOM_INVALID_IOPORT_SIZE); 128 /* make return value */ 129 rcStrict = VINF_SUCCESS; 130 switch (cbValue) 131 { 132 case 1: *(uint8_t *)pu32Value = 0xff; break; 133 case 2: *(uint16_t *)pu32Value = 0xffff; break; 134 case 4: *(uint32_t *)pu32Value = UINT32_C(0xffffffff); break; 135 default: 136 AssertMsgFailedReturn(("Invalid I/O port size %d. Port=%d\n", cbValue, Port), VERR_IOM_INVALID_IOPORT_SIZE); 137 } 134 138 } 135 139 } 136 140 Log3(("IOMIOPortRead: Port=%RTiop *pu32=%08RX32 cb=%d rc=%Rrc\n", Port, *pu32Value, cbValue, VBOXSTRICTRC_VAL(rcStrict))); 141 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 137 142 } 138 143 else … … 179 184 void *pvDst, uint32_t *pcTransfers, unsigned cb) 180 185 { 186 STAM_COUNTER_INC(&pVM->iom.s.StatIoPortInS); 181 187 Assert(pVCpu->iom.s.PendingIOPortWrite.cbValue == 0); 182 188 … … 279 285 280 286 #ifdef VBOX_WITH_STATISTICS 281 if (rcStrict == VINF_SUCCESS && pStats) 287 # ifndef IN_RING3 288 if (rcStrict == VINF_IOM_R3_IOPORT_READ) 289 STAM_COUNTER_INC(&pStats->InRZToR3); 290 else 291 # endif 292 { 282 293 STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(In)); 283 # ifndef IN_RING3 284 else if (rcStrict == VINF_IOM_R3_IOPORT_READ && pStats) 285 STAM_COUNTER_INC(&pStats->InRZToR3); 286 # endif 294 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 295 } 287 296 #endif 288 297 Log3(("IOMIOPortReadStr: uPort=%RTiop pvDst=%p pcTransfer=%p:{%#x->%#x} cb=%d rc=%Rrc\n", … … 349 358 VMMDECL(VBOXSTRICTRC) IOMIOPortWrite(PVMCC pVM, PVMCPU pVCpu, RTIOPORT Port, uint32_t u32Value, size_t cbValue) 350 359 { 360 STAM_COUNTER_INC(&pVM->iom.s.StatIoPortOut); 351 361 #ifndef IN_RING3 352 362 Assert(pVCpu->iom.s.PendingIOPortWrite.cbValue == 0); … … 408 418 409 419 #ifdef VBOX_WITH_STATISTICS 410 if (rcStrict == VINF_SUCCESS) 420 # ifndef IN_RING3 421 if (rcStrict != VINF_IOM_R3_IOPORT_WRITE) 422 # endif 423 { 411 424 STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(Out)); 425 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 426 } 412 427 #endif 413 428 Log3(("IOMIOPortWrite: Port=%RTiop u32=%08RX32 cb=%d rc=%Rrc\n", Port, u32Value, cbValue, VBOXSTRICTRC_VAL(rcStrict))); … … 454 469 uint32_t *pcTransfers, unsigned cb) 455 470 { 471 STAM_COUNTER_INC(&pVM->iom.s.StatIoPortOutS); 456 472 Assert(pVCpu->iom.s.PendingIOPortWrite.cbValue == 0); 457 473 Assert(cb == 1 || cb == 2 || cb == 4); … … 549 565 550 566 #ifdef VBOX_WITH_STATISTICS 551 if (rcStrict == VINF_SUCCESS) 567 # ifndef IN_RING3 568 if (rcStrict == VINF_IOM_R3_IOPORT_WRITE) 569 STAM_COUNTER_INC(&pStats->OutRZToR3); 570 else 571 # endif 572 { 552 573 STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(Out)); 553 # ifndef IN_RING3 554 else if (rcStrict == VINF_IOM_R3_IOPORT_WRITE) 555 STAM_COUNTER_INC(&pStats->OutRZToR3); 556 # endif 574 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 575 } 557 576 #endif 558 577 Log3(("IOMIOPortWriteStr: uPort=%RTiop pvSrc=%p pcTransfer=%p:{%#x->%#x} cb=%d rcStrict=%Rrc\n",
Note:
See TracChangeset
for help on using the changeset viewer.