VirtualBox

Changeset 88329 in vbox for trunk


Ignore:
Timestamp:
Mar 31, 2021 7:02:46 AM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 WIP.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp

    r88328 r88329  
    405405static const uint8_t *g_apbRw1cMasks[] = { (uint8_t *)&g_au32Rw1cMasks0[0], (uint8_t *)&g_au32Rw1cMasks1[0] };
    406406
     407/* Masks arrays must be identical in size (even bounds checking code assumes this). */
     408AssertCompile(sizeof(g_apbRw1cMasks) == sizeof(g_apbRwMasks));
     409
    407410
    408411#ifndef VBOX_DEVICE_STRUCT_TESTCASE
     
    414417 * @param   pThis       The shared IOMMU device state.
    415418 * @param   offReg      The MMIO offset of the register.
    416  * @param   cbReg       The size of the access being made.
     419 * @param   cbReg       The size of the access being made (for bounds checking on
     420 *                      debug builds).
    417421 * @param   pIdxGroup   Where to store the index of the register group the register
    418422 *                      belongs to.
     
    475479    uint8_t idxGroup;
    476480    uint8_t const *pabRegs      = iommuIntelRegGetGroup(pThis, offReg, sizeof(uint64_t), &idxGroup);
     481    Assert(idxGroup < RT_ELEMENTS(g_apbRwMasks));
    477482    uint8_t const *pabRwMasks   = g_apbRwMasks[idxGroup];
    478483    uint8_t const *pabRw1cMasks = g_apbRw1cMasks[idxGroup];
     
    496501    uint8_t idxGroup;
    497502    uint8_t const *pabRegs      = iommuIntelRegGetGroup(pThis, offReg, sizeof(uint32_t), &idxGroup);
     503    Assert(idxGroup < RT_ELEMENTS(g_apbRwMasks));
    498504    uint8_t const *pabRwMasks   = g_apbRwMasks[idxGroup];
    499505    uint8_t const *pabRw1cMasks = g_apbRw1cMasks[idxGroup];
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