VirtualBox

Ignore:
Timestamp:
Oct 21, 2015 10:13:47 AM (9 years ago)
Author:
vboxsync
Message:

IOMIOPortReadString,IOMIOPortWriteString: Must return to ring-3 when there aren't ring-0/raw-mode handlers for a range, and set *pcTransfers to zero for unused ports (read also store 0xff in pvDst).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IOMAll.cpp

    r58126 r58354  
    299299        else
    300300        {
    301             STAM_STATS({ if (pStats)
    302                     STAM_COUNTER_INC(&pStats->InRZToR3); });
     301            STAM_STATS({ if (pStats) STAM_COUNTER_INC(&pStats->InRZToR3); });
    303302            IOM_UNLOCK_SHARED(pVM);
    304             return VINF_SUCCESS;
     303            return VINF_IOM_R3_IOPORT_READ;
    305304        }
    306305#endif
     
    411410     * Ok, no handler for this port.
    412411     */
     412    *pcTransfers = 0;
     413    memset(pvDst, 0xff, cRequestedTransfers * cb);
    413414#ifdef VBOX_WITH_STATISTICS
    414415    if (pStats)
    415416        STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(In));
    416417#endif
    417 
    418     Log3(("IOMIOPortReadStr: uPort=%RTiop pvDst=%p pcTransfer=%p:{%#x->%#x} cb=%d rc=VINF_SUCCESS\n",
     418    Log3(("IOMIOPortReadStr: uPort=%RTiop (unused) pvDst=%p pcTransfer=%p:{%#x->%#x} cb=%d rc=VINF_SUCCESS\n",
    419419          uPort, pvDst, pcTransfers, cRequestedTransfers, *pcTransfers, cb));
    420420    IOM_UNLOCK_SHARED(pVM);
     
    641641            STAM_STATS({ if (pStats) STAM_COUNTER_INC(&pStats->OutRZToR3); });
    642642            IOM_UNLOCK_SHARED(pVM);
    643             return VINF_SUCCESS;
     643            return VINF_IOM_R3_IOPORT_WRITE;
    644644        }
    645645#endif
     
    744744     * Ok, no handler for this port.
    745745     */
     746    *pcTransfers = 0;
    746747#ifdef VBOX_WITH_STATISTICS
    747748    if (pStats)
    748749        STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(Out));
    749750#endif
    750 
    751     Log3(("IOMIOPortWriteStr: uPort=%RTiop pvSrc=%p pcTransfer=%p:{%#x->%#x} cb=%d rc=VINF_SUCCESS\n",
     751    Log3(("IOMIOPortWriteStr: uPort=%RTiop (unused) pvSrc=%p pcTransfer=%p:{%#x->%#x} cb=%d rc=VINF_SUCCESS\n",
    752752          uPort, pvSrc, pcTransfers, cRequestedTransfers, *pcTransfers, cb));
    753753    IOM_UNLOCK_SHARED(pVM);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette