Date: Sat, 9 Jul 2011 20:04:07 -0400 From: John Baldwin <jhb@FreeBSD.org> To: current@FreeBSD.org Subject: [PATCH] Make x86 Host-PCI bridge drivers honor decoded ranges Message-ID: <4CE54A1B-B0EF-4907-88BE-124FC4FF236D@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
This patch adds a new API (pcib_host_res_*) that Host-PCI bridge drivers = can=20 use to restrict allocations for child devices to a known subset of = address=20 ranges that the bridge decodes. Originally I tried to allocate the full=20= ranges and use rmans just as we now do for PCI-PCI bridge windows. = However,=20 this broke due to the fact that all of our ACPI LPC/ISA devices attach = at the=20 "wrong" place in the tree (they aren't behind the host-PCI bridges) and = a=20 typical ACPI BIOS will allocate the full I/O port range to the host-PCI=20= bridge. We could perhaps fix this later if we relocate all the ACPI = devices=20 that are actually ISA devices down onto an ACPI-aware ISA bus (i.e. an = ISA bus=20 that uses ACPI to enumerate devices). Anyway, I punted on that for now. = =20 Instead, the current API works by using a resource_list to keep track of = all=20 the valid address ranges. When an allocation request is made, it simply = tries=20 all the address ranges in turn. I still made it honor = hw.pci.host_mem_start=20 since the ACPI BIOSes I have seen will optionally include option ROM = space=20 below 1MB if any ROMs are active, but we don't want to allocate that = space for=20 a wildcard BAR operation. I've changed the ACPI and MPTable Host-PCI bridge drivers to use this = helper=20 API. For ACPI we claim that bridges decode any "producer" address = ranges in=20 the bridges _CRS. For the MPTable I had to add logic to walk the = extended=20 MPTable entries and use those extended entries to find the list of = decoded=20 ranges. I'd like to get this into 9.0 and would appreciate folks = testing it out. http://www.FreeBSD.org/~jhb/patches/pci_host_res.patch --=20 John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CE54A1B-B0EF-4907-88BE-124FC4FF236D>