VirtualBox

Changeset 65557 in vbox


Ignore:
Timestamp:
Jan 31, 2017 5:52:26 PM (8 years ago)
Author:
vboxsync
Message:

DevPciIch9.cpp: treat the low 4 bits of all base and limit registers for a bridge as readonly and handle their value in the config space write callback

File:
1 edited

Legend:

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

    r65540 r65557  
    15941594        /* Need again alignment to a 4KB boundary. */
    15951595        pPciRoot->uPciBiosIo = RT_ALIGN_32(pPciRoot->uPciBiosIo, 4*1024);
    1596         ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_IO_LIMIT, ((pPciRoot->uPciBiosIo >> 8) & 0xf0) - 1, 1);
     1596        ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_IO_LIMIT, ((pPciRoot->uPciBiosIo - 1) >> 8) & 0xf0, 1);
    15971597    }
    15981598    else
     
    16061606    {
    16071607        pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, 1024*1024);
    1608         ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_MEMORY_LIMIT, ((pPciRoot->uPciBiosMmio >> 16) & UINT32_C(0xfff0)) - 1, 2);
     1608        ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_MEMORY_LIMIT, ((pPciRoot->uPciBiosMmio - 1) >> 16) & UINT32_C(0xfff0), 2);
    16091609    }
    16101610    else
     
    19191919        uLimit = RT_ALIGN_32(pPciRoot->uPciBiosMmio, 1024*1024) - 1;
    19201920    }
    1921     /*
    1922      * The bottom 4 bits of both the Prefetchable Memory Base and Prefetchable
    1923      * Memory Limit are read-only, contain the same value, and encode whether
    1924      * or not the bridge supports 64-bit addresses. If these four bits have
    1925      * the value 0h, then the bridge supports only 32-bit addresses. If these
    1926      * four bits have the value 01h, then the bridge supports 64-bit addresses
    1927      * and the Prefetchable Base Upper 32 Bits and Prfetchable Limit Upper 32
    1928      * Bits registers hold the rest of the 64-bit prefetchable base and limit
    1929      * respectively.
    1930      */
    1931     uint32_t uSupports64Bit = fUse64Bit ? 0x1 : 0x0;
    19321921    ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_PREF_BASE_UPPER32, uBase >> 32, 4);
    1933     ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_PREF_MEMORY_BASE, ((uint32_t)(uBase >> 16) & UINT32_C(0xfff0)) | uSupports64Bit, 2);
     1922    ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_PREF_MEMORY_BASE, (uint32_t)(uBase >> 16) & UINT32_C(0xfff0), 2);
    19341923    ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_PREF_LIMIT_UPPER32, uLimit >> 32, 4);
    1935     ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_PREF_MEMORY_LIMIT, ((uint32_t)(uLimit >> 16) & UINT32_C(0xfff0)) | uSupports64Bit, 2);
     1924    ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_PREF_MEMORY_LIMIT, (uint32_t)(uLimit >> 16) & UINT32_C(0xfff0), 2);
    19361925
    19371926    return false;
     
    26712660                            break;
    26722661                        }
     2662                        else if (   uAddress == VBOX_PCI_IO_BASE
     2663                                 || uAddress == VBOX_PCI_IO_LIMIT
     2664                                 || uAddress == VBOX_PCI_MEMORY_BASE
     2665                                 || uAddress == VBOX_PCI_MEMORY_LIMIT
     2666                                 || uAddress == VBOX_PCI_PREF_MEMORY_BASE
     2667                                 || uAddress == VBOX_PCI_PREF_MEMORY_LIMIT)
     2668                        {
     2669                            /* All bridge address decoders have the low 4 bits
     2670                             * as readonly, and all but the prefetchable ones
     2671                             * have the low 4 bits as 0 (the prefetchable have
     2672                             * it as 1 to show the 64-bit decoder support. */
     2673                            bVal &= 0xf0;
     2674                            if (   uAddress == VBOX_PCI_PREF_MEMORY_BASE
     2675                                || uAddress == VBOX_PCI_PREF_MEMORY_LIMIT)
     2676                                bVal |= 0x01;
     2677                        }
    26732678                        /* fall thru (bridge config space which isn't a BAR) */
    26742679                    default:
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