VirtualBox

Changeset 63773 in vbox


Ignore:
Timestamp:
Sep 9, 2016 9:20:28 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
110589
Message:

DevPciIch9: fix in ich9pciSetRegionAddress() to only consider PCI_ADDRESS_SPACE_MEM regions as eligible for a 64-bit region; when mapping a device in ich9pciBiosInitDevice() we have to explicitly allow to relocate 64-bit regions; also disable an assertion which doesn't make sense for 64-bit regions; fix ich9pciBusInfo() for 64-bit regions; use f64Bit consistently

File:
1 edited

Legend:

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

    r63702 r63773  
    16281628    /* Read memory type first. */
    16291629    uint8_t uResourceType = ich9pciConfigRead(pGlobals, uBus, uDevFn, uReg, 1);
    1630 
    1631     Log(("Set region address: %02x:%02x.%d region %d address=%lld\n",
    1632          uBus, uDevFn >> 3, uDevFn & 7, iRegion, addr));
    1633 
    1634     bool f64Bit = (uResourceType & PCI_ADDRESS_SPACE_BAR64) != 0;
     1630    bool    f64Bit = (uResourceType & ((uint8_t)(PCI_ADDRESS_SPACE_BAR64 | PCI_ADDRESS_SPACE_IO)))
     1631                     == PCI_ADDRESS_SPACE_BAR64;
     1632
     1633    Log(("Set region address: %02x:%02x.%d region %d address=%RX64%s\n",
     1634         uBus, uDevFn >> 3, uDevFn & 7, iRegion, addr, f64Bit ? " (64-bit)" : ""));
    16351635
    16361636    /* Write address of the device. */
     
    17701770                uint8_t u8ResourceType = ich9pciConfigRead(pGlobals, uBus, uDevFn, u32Address, 1);
    17711771
    1772                 bool f64bit = (u8ResourceType & PCI_ADDRESS_SPACE_BAR64) != 0;
     1772                bool f64Bit = (u8ResourceType & PCI_ADDRESS_SPACE_BAR64) != 0;
    17731773                bool fIsPio = ((u8ResourceType & PCI_COMMAND_IOACCESS) == PCI_COMMAND_IOACCESS);
    17741774                uint64_t cbRegSize64 = 0;
    17751775
    1776                 if (f64bit)
     1776                if (f64Bit)
    17771777                {
    17781778                    ich9pciConfigWrite(pGlobals, uBus, uDevFn, u32Address,   UINT32_C(0xffffffff), 4);
     
    18111811                    cbRegSize64 = cbRegSize32;
    18121812                }
     1813#if 0 /* bogus for 64-bit regions */
    18131814#ifndef DEBUG_bird /* EFI triggers this for DevAHCI. */
    18141815                Assert(cbRegSize64 == (uint32_t)cbRegSize64);
     1816#endif
    18151817#endif
    18161818                Log2(("%s: Size of region %u for device %d on bus %d is %lld\n", __FUNCTION__, iRegion, uDevFn, uBus, cbRegSize64));
     
    18261828                        uNew &= UINT32_C(0xffff);
    18271829                    /* Unconditionally exclude I/O-APIC/HPET/ROM. Pessimistic, but better than causing a mess. */
    1828                     if (!uNew || (uNew <= UINT32_C(0xffffffff) && uNew + cbRegSize64 - 1 >= UINT32_C(0xfec00000)))
     1830                    if (   f64Bit
     1831                        || !uNew
     1832                        || (uNew <= UINT32_C(0xffffffff) && uNew + cbRegSize64 - 1 >= UINT32_C(0xfec00000)))
    18291833                    {
    1830                         if (f64bit)
     1834                        if (f64Bit)
    18311835                        {
    18321836                            /* Map a 64-bit region above 4GB. */
     
    18611865                    }
    18621866
    1863                     if (f64bit)
     1867                    if (f64Bit)
    18641868                        iRegion++; /* skip next region */
    18651869                }
     
    24732477
    24742478                    printIndent(pHlp, iIndent + 2);
    2475                     pHlp->pfnPrintf(pHlp, "%s region #%d: %x..%x\n",
    2476                                     pszDesc, iRegion, u32Addr, u32Addr+iRegionSize);
     2479                    pHlp->pfnPrintf(pHlp, "%s region #%d: ",pszDesc, iRegion);
    24772480                    if (f64Bit)
     2481                    {
     2482                        uint32_t u32High = ich9pciGetDWord(pPciDev, ich9pciGetRegionReg(iRegion+1));
     2483                        uint64_t u64Addr = RT_MAKE_U64(u32Addr, u32High);
     2484                        pHlp->pfnPrintf(pHlp, "%RX64..%RX64\n", u64Addr, u64Addr+iRegionSize);
    24782485                        iRegion++;
     2486                    }
     2487                    else
     2488                        pHlp->pfnPrintf(pHlp, "%x..%x\n", u32Addr, u32Addr+iRegionSize);
    24792489                }
    24802490            }
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