freebsd-nq/sys
John Baldwin 83c41143ca Reimplement how PCI-PCI bridges manage their I/O windows. Previously the
driver would verify that requests for child devices were confined to any
existing I/O windows, but the driver relied on the firmware to initialize
the windows and would never grow the windows for new requests.  Now the
driver actively manages the I/O windows.

This is implemented by allocating a bus resource for each I/O window from
the parent PCI bus and suballocating that resource to child devices.  The
suballocations are managed by creating an rman for each I/O window.  The
suballocated resources are mapped by passing the bus_activate_resource()
call up to the parent PCI bus.  Windows are grown when needed by using
bus_adjust_resource() to adjust the resource allocated from the parent PCI
bus.  If the adjust request succeeds, the window is adjusted and the
suballocation request for the child device is retried.

When growing a window, the rman_first_free_region() and
rman_last_free_region() routines are used to determine if the front or
end of the existing I/O window is free.  From using that, the smallest
ranges that need to be added to either the front or back of the window
are computed.  The driver will first try to grow the window in whichever
direction requires the smallest growth first followed by the other
direction if that fails.

Subtractive bridges will first attempt to satisfy requests for child
resources from I/O windows (including attempts to grow the windows).  If
that fails, the request is passed up to the parent PCI bus directly
however.

The PCI-PCI bridge driver will try to use firmware-assigned ranges for
child BARs first and only allocate a "fresh" range if that specific range
cannot be accommodated in the I/O window.  This allows systems where the
firmware assigns resources during boot but later wipes the I/O windows
(some ACPI BIOSen are known to do this) to "rediscover" the original I/O
window ranges.

The ACPI Host-PCI bridge driver has been adjusted to correctly honor
hw.acpi.host_mem_start and the I/O port equivalent when a PCI-PCI bridge
makes a wildcard request for an I/O window range.

The new PCI-PCI bridge driver is only enabled if the NEW_PCIB kernel option
is enabled.  This is a transition aide to allow platforms that do not
yet support bus_activate_resource() and bus_adjust_resource() in their
Host-PCI bridge drivers (and possibly other drivers as needed) to use the
old driver for now.  Once all platforms support the new driver, the
kernel option and old driver will be removed.

PR:		kern/143874 kern/149306
Tested by:	mav
2011-05-03 17:37:24 +00:00
..
amd64 Reimplement how PCI-PCI bridges manage their I/O windows. Previously the 2011-05-03 17:37:24 +00:00
arm Change rman_manage_region() to actually honor the rm_start and rm_end 2011-04-29 18:41:21 +00:00
boot Fix corner case where the size is a power of two. 2011-05-03 01:43:04 +00:00
bsm Add ECAPMODE, "Not permitted in capability mode", a new kernel errno 2011-03-01 13:14:28 +00:00
cam Do not report legacy unit numbers (do not create legacy aliases) for disks 2011-05-03 13:16:02 +00:00
cddl Fix deduplicated zfs receive 2011-04-30 14:52:49 +00:00
compat Regen. 2011-04-18 16:32:47 +00:00
conf Reimplement how PCI-PCI bridges manage their I/O windows. Previously the 2011-05-03 17:37:24 +00:00
contrib Make pf compile without INET support by adding #ifdef INETs and 2011-04-27 19:34:01 +00:00
crypto Fix a bug in the result of manual assembly. 2011-03-02 14:56:58 +00:00
ddb Trim some additional unnecessary <linker_set.h> includes. 2011-04-28 17:59:33 +00:00
dev Reimplement how PCI-PCI bridges manage their I/O windows. Previously the 2011-05-03 17:37:24 +00:00
fs Add the kernel support needed to zero out the nfsstats 2011-05-01 22:19:52 +00:00
gdb Modify kdb_trap() so that it re-calls the dbbe_trap function as long as 2011-02-18 22:25:11 +00:00
geom Implement relaxed comparision for hardcoded provider names to make it 2011-04-27 00:10:26 +00:00
gnu Fix typos - remove duplicate "the". 2011-02-21 09:01:34 +00:00
i386 Reimplement how PCI-PCI bridges manage their I/O windows. Previously the 2011-05-03 17:37:24 +00:00
ia64 Don't use the whole region 5 for KVA, because the CPU may not implement all 2011-05-02 17:49:05 +00:00
isa - Enable an extra debugging bootverbose printf when probing ISA PNP cards 2011-03-29 12:38:13 +00:00
kern Change the way rctl interfaces with jails by introducing prison_racct 2011-05-03 07:32:58 +00:00
kgssapi
libkern Fix typos - remove duplicate "is". 2011-02-23 09:22:33 +00:00
mips Add in the work-around for the AR8316 gige switch PHY. 2011-05-02 10:42:19 +00:00
modules Update carp, gre and pf module builds to be depenent on INET and/or 2011-04-30 17:59:54 +00:00
net LACP frames must not be send VLAN-tagged, check for that before processing. 2011-04-30 20:34:52 +00:00
net80211 We need in.h for both INET and INET6, as according to RFC 3493 it 2011-04-25 16:37:47 +00:00
netatalk
netgraph LibAliasInit() should allocate memory with M_WAITOK flag. Modify it 2011-04-18 20:07:08 +00:00
netinet Handle a rare edge case with nearly full TCP receive buffers. If a TCP 2011-05-02 21:05:52 +00:00
netinet6 Improve compilation of SCTP code without INET support. 2011-04-30 11:18:16 +00:00
netipsec Make IPsec compile without INET adding appropriate #ifdef checks. 2011-04-27 19:28:42 +00:00
netipx
netnatm
netncp
netsmb
nfs Add the kernel support needed to zero out the nfsstats 2011-05-01 22:19:52 +00:00
nfsclient Fix module names and dependencies so the NFS clients will 2011-04-27 20:42:30 +00:00
nfsserver Add some FEATURE macros for various features (AUDIT/CAM/IPC/KTR/MAC/NFS/NTP/ 2011-02-25 10:11:01 +00:00
nlm
ofed - Catch up to falloc() changes. 2011-04-26 07:30:52 +00:00
opencrypto After the r219999 is merged to stable/8, rename fallocf(9) to falloc(9) 2011-04-01 13:28:34 +00:00
pc98 This patch changes head so that the default NFS client is now the new 2011-04-27 17:51:51 +00:00
pci Do a sweep of the tree replacing calls to pci_find_extcap() with calls to 2011-03-23 13:10:15 +00:00
powerpc Add the watchdogs patting during the (shutdown time) disk syncing and 2011-04-28 16:02:05 +00:00
rpc This patch is believed to fix a problem in the kernel rpc for 2011-04-27 18:19:26 +00:00
security - Add a FEATURE for capsicum (security_capabilities). 2011-03-04 09:03:54 +00:00
sparc64 Reimplement how PCI-PCI bridges manage their I/O windows. Previously the 2011-05-03 17:37:24 +00:00
sun4v This patch changes head so that the default NFS client is now the new 2011-04-27 17:51:51 +00:00
sys Change the way rctl interfaces with jails by introducing prison_racct 2011-05-03 07:32:58 +00:00
teken
tools GNU awk does not output escaped newlines in multi-line printc statements. This 2011-03-31 21:33:33 +00:00
ufs Fix typos. 2011-04-30 22:46:02 +00:00
vm Reap old SPL comments. 2011-04-26 22:18:53 +00:00
x86 Reimplement how PCI-PCI bridges manage their I/O windows. Previously the 2011-05-03 17:37:24 +00:00
xdr
xen
Makefile