VirtualBox

Changeset 44573 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Feb 6, 2013 3:24:36 PM (12 years ago)
Author:
vboxsync
Message:

IOM: Fixed IOMMMIO_FLAGS_WRITE_ONLY_DWORD and added IOMMMIO_FLAGS_WRITE_ONLY_DWORD_QWORD.

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

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

    r44564 r44573  
    7878 * Deals with complicated MMIO writes.
    7979 *
    80  * Complicatd means unaligned or non-dword/qword align accesses depending on
     80 * Complicated means unaligned or non-dword/qword sized accesses depending on
    8181 * the MMIO region's access mode flags.
    8282 *
     
    9898    AssertReturn(cbValue != 0 && cbValue <= 16, VERR_IOM_MMIO_IPE_2);
    9999    RTGCPHYS const GCPhysStart  = GCPhys; NOREF(GCPhysStart);
    100     bool const     fReadMissing = (pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) >= IOMMMIO_FLAGS_WRITE_DWORD_READ_MISSING;
     100    bool const     fReadMissing = (pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) == IOMMMIO_FLAGS_WRITE_DWORD_READ_MISSING
     101                               || (pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) == IOMMMIO_FLAGS_WRITE_DWORD_QWORD_READ_MISSING;
    101102
    102103    /*
     
    121122     * Check if we should ignore the write.
    122123     */
    123     if (pRange->fFlags & IOMMMIO_FLAGS_WRITE_ONLY_DWORD)
     124    if ((pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) == IOMMMIO_FLAGS_WRITE_ONLY_DWORD)
    124125    {
    125126        Assert(cbValue != 4 || (GCPhys & 3));
     127        return VINF_SUCCESS;
     128    }
     129    if ((pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) == IOMMMIO_FLAGS_WRITE_ONLY_DWORD_QWORD)
     130    {
     131        Assert((cbValue != 4 && cbValue != 8) || (GCPhys & (cbValue - 1)));
    126132        return VINF_SUCCESS;
    127133    }
     
    160166                    /** @todo What if we've split a transfer and already read
    161167                     * something?  Since writes generally have sideeffects we
    162                      * could be kind of screwed here... */
     168                     * could be kind of screwed here...
     169                     *
     170                     * Fix: Save the current state and resume it in ring-3. Requires EM to not go
     171                     *      to REM for MMIO accesses (like may currently do). */
     172
    163173                    LogFlow(("iomMMIODoComplicatedWrite: GCPhys=%RGp GCPhysStart=%RGp cbValue=%u rc=%Rrc [read]\n", GCPhys, GCPhysStart, cbValue, rc2));
    164174                    return rc2;
     
    206216        {
    207217            u32GivenValue <<= offAccess * 8;
    208             u32GivenMask <<= offAccess * 8;
     218            u32GivenMask  <<= offAccess * 8;
    209219        }
    210220
     
    226236                /** @todo What if we've split a transfer and already read
    227237                 * something?  Since reads can have sideeffects we could be
    228                  * kind of screwed here... */
     238                 * kind of screwed here...
     239                 *
     240                 * Fix: Save the current state and resume it in ring-3. Requires EM to not go
     241                 *      to REM for MMIO accesses (like may currently do). */
    229242                LogFlow(("iomMMIODoComplicatedWrite: GCPhys=%RGp GCPhysStart=%RGp cbValue=%u rc=%Rrc [write]\n", GCPhys, GCPhysStart, cbValue, rc2));
    230243                return rc2;
     
    274287        if (   (cb == 4 && !(GCPhysFault & 3))
    275288            || (pRange->fFlags & IOMMMIO_FLAGS_WRITE_MODE) == IOMMMIO_FLAGS_WRITE_PASSTHRU
    276             || (cb == 8 && !(GCPhysFault & 7)) )
     289            || (cb == 8 && !(GCPhysFault & 7) && IOMMMIO_DOES_WRITE_MODE_ALLOW_QWORD(pRange->fFlags)) )
    277290            rc = pRange->CTX_SUFF(pfnWriteCallback)(pRange->CTX_SUFF(pDevIns), pRange->CTX_SUFF(pvUser),
    278291                                                    GCPhysFault, (void *)pvData, cb); /** @todo fix const!! */
  • trunk/src/VBox/VMM/VMMR3/IOM.cpp

    r44564 r44573  
    14191419    AssertMsgReturn(   !(fFlags & ~IOMMMIO_FLAGS_VALID_MASK)
    14201420                    && (fFlags & IOMMMIO_FLAGS_READ_MODE)  <= IOMMMIO_FLAGS_READ_DWORD_QWORD
    1421                     && (fFlags & IOMMMIO_FLAGS_WRITE_MODE) <= IOMMMIO_FLAGS_WRITE_ONLY_DWORD,
     1421                    && (fFlags & IOMMMIO_FLAGS_WRITE_MODE) <= IOMMMIO_FLAGS_WRITE_ONLY_DWORD_QWORD,
    14221422                    ("%#x\n", fFlags),
    14231423                    VERR_INVALID_PARAMETER);
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