Changeset 63658 in vbox for trunk/src/VBox/Devices/Bus
- Timestamp:
- Aug 30, 2016 1:26:06 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r63562 r63658 112 112 /** The next MMIO address which the PCI BIOS will use. */ 113 113 uint32_t uPciBiosMmio; 114 /** The next 64-bit MMIO address which the PCI BIOS will use. */ 115 uint64_t uPciBiosMmio64; 114 116 /** Actual bus number. */ 115 117 uint8_t uBus; … … 1815 1817 if (cbRegSize64) 1816 1818 { 1817 /** @todo r=klaus make this code actually handle 64-bit BARs, especially MMIO which can't possibly fit into the memory hole. */ 1818 uint32_t cbRegSize32 = (uint32_t)cbRegSize64; 1819 /* Try 32-bit base first. */ 1819 1820 uint32_t* paddr = fIsPio ? &pGlobals->uPciBiosIo : &pGlobals->uPciBiosMmio; 1820 uint32_t uNew = *paddr; 1821 uNew = (uNew + cbRegSize32 - 1) & ~(cbRegSize32 - 1); 1821 uint64_t uNew = *paddr; 1822 /* Align starting address to region size. */ 1823 uNew = (uNew + cbRegSize64 - 1) & ~(cbRegSize64 - 1); 1822 1824 if (fIsPio) 1823 1825 uNew &= UINT32_C(0xffff); 1824 1826 /* Unconditionally exclude I/O-APIC/HPET/ROM. Pessimistic, but better than causing a mess. */ 1825 if (!uNew || (uNew <= UINT32_C(0xffffffff) && uNew + cbRegSize 32- 1 >= UINT32_C(0xfec00000)))1827 if (!uNew || (uNew <= UINT32_C(0xffffffff) && uNew + cbRegSize64 - 1 >= UINT32_C(0xfec00000))) 1826 1828 { 1827 LogRel(("PCI: no space left for BAR%u of device %u/%u/%u (vendor=%#06x device=%#06x)\n",1828 iRegion, uBus, uDevFn >> 3, uDevFn & 7, uVendor, uDevice)); /** @todo make this a VM start failure later. */1829 /* Undo the mapping mess caused by the size probing. */1830 ich9pciConfigWrite(pGlobals, uBus, uDevFn, u32Address, UINT32_C(0), 4);1831 1829 if (f64bit) 1832 ich9pciConfigWrite(pGlobals, uBus, uDevFn, u32Address+4, UINT32_C(0), 4); 1830 { 1831 /* Map a 64-bit region above 4GB. */ 1832 Assert(!fIsPio); 1833 uint64_t uNew = pGlobals->uPciBiosMmio64; 1834 /* Align starting address to region size. */ 1835 uNew = (uNew + cbRegSize64 - 1) & ~(cbRegSize64 - 1); 1836 LogFunc(("Start address of 64-bit MMIO region %u/%u is %#llx\n", iRegion, iRegion + 1, uNew)); 1837 ich9pciSetRegionAddress(pGlobals, uBus, uDevFn, iRegion, uNew); 1838 fActiveMemRegion = true; 1839 pGlobals->uPciBiosMmio64 = uNew + cbRegSize64; 1840 Log2Func(("New 64-bit address is %#llx\n", pGlobals->uPciBiosMmio64)); 1841 } 1842 else 1843 { 1844 LogRel(("PCI: no space left for BAR%u of device %u/%u/%u (vendor=%#06x device=%#06x)\n", 1845 iRegion, uBus, uDevFn >> 3, uDevFn & 7, uVendor, uDevice)); /** @todo make this a VM start failure later. */ 1846 /* Undo the mapping mess caused by the size probing. */ 1847 ich9pciConfigWrite(pGlobals, uBus, uDevFn, u32Address, UINT32_C(0), 4); 1848 } 1833 1849 } 1834 1850 else 1835 1851 { 1836 Log (("%s: Start address of %s region %u is %#x\n", __FUNCTION__, (fIsPio ? "I/O" : "MMIO"), iRegion, uNew));1852 LogFunc(("Start address of %s region %u is %#x\n", (fIsPio ? "I/O" : "MMIO"), iRegion, uNew)); 1837 1853 ich9pciSetRegionAddress(pGlobals, uBus, uDevFn, iRegion, uNew); 1838 1854 if (fIsPio) … … 1840 1856 else 1841 1857 fActiveMemRegion = true; 1842 *paddr = uNew + cbRegSize 32;1843 Log2 (("%s: New address is %#x\n", __FUNCTION__, *paddr));1858 *paddr = uNew + cbRegSize64; 1859 Log2Func(("New 32-bit address is %#x\n", *paddr)); 1844 1860 } 1845 1861 … … 1953 1969 pGlobals->uPciBiosIo = 0xd000; 1954 1970 pGlobals->uPciBiosMmio = UINT32_C(0xf0000000); 1971 pGlobals->uPciBiosMmio64 = 128 * 0x100000000; ///@todo: Make dynamic! 1955 1972 pGlobals->uBus = 0; 1956 1973
Note:
See TracChangeset
for help on using the changeset viewer.