VirtualBox

Changeset 88416 in vbox


Ignore:
Timestamp:
Apr 8, 2021 1:27:05 PM (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

    r88414 r88416  
    449449
    450450#ifndef VBOX_DEVICE_STRUCT_TESTCASE
     451/**
     452 * Gets the number of supported adjusted guest-address width (SAGAW) in bits given a
     453 * CAP_REG.SAGAW value.
     454 *
     455 * @returns Number of SAGAW bits.
     456 * @param   uSagaw  The CAP_REG.SAGAW value.
     457 */
     458DECLINLINE(uint8_t) vtdGetSupGstAddrBits(uint8_t uSagaw)
     459{
     460    if (uSagaw > 0 && uSagaw < 4)
     461        return uSagaw + 2;
     462    return 0;
     463}
     464
    451465
    452466/**
     
    10131027    uint64_t const fCap     = dmarRegRead64(pThis, VTD_MMIO_OFF_CAP_REG);
    10141028    uint64_t const fExtCap  = dmarRegRead64(pThis, VTD_MMIO_OFF_ECAP_REG);
    1015     uint8_t const  uMaxGstAddrWidth = RT_BF_GET(fCap, VTD_BF_CAP_REG_MGAW) + 1;
    1016     LogRel(("%s: CAP=%#RX64 ECAP=%#RX64 (MGAW=%u)\n", DMAR_LOG_PFX, fCap, fExtCap, uMaxGstAddrWidth));
     1029    uint8_t const  uMaxGstAddrBits = RT_BF_GET(fCap, VTD_BF_CAP_REG_MGAW) + 1;
     1030    uint8_t const  uSupGstAddrBits = vtdGetSupGstAddrBits(RT_BF_GET(fCap, VTD_BF_CAP_REG_SAGAW));
     1031    LogRel(("%s: CAP=%#RX64 ECAP=%#RX64 (MGAW=%u bits, SAGAW=%u bits)\n", DMAR_LOG_PFX, fCap, fExtCap, uMaxGstAddrBits,
     1032            uSupGstAddrBits));
    10171033    return VINF_SUCCESS;
    10181034}
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