FreeBSD src
Go to file
Thomas Moestl 928a49644f Lock down the IOMMU bus_dma implementation to make it safe to use
without Giant held.

A quick outline of the locking strategy:
Since all IOMMUs are synchronized, there is a single lock, iommu_mtx,
which protects the hardware registers (where needed) and the global and
per-IOMMU software states. As soon as the IOMMUs are divorced, each struct
iommu_state will have its own mutex (and the remaining global state
will be moved into the struct).
The dvma rman has its own internal mutex; the TSB slots may only be
accessed by the owner of the corresponding resource, so neither needs
extra protection.
Since there is a second access path to maps via LRU queues, the consumer-
provided locking is not sufficient; therefore, each map which is on a
queue is additionally protected by iommu_mtx (in part, there is one
member which only the map owner may access). Each map on a queue may
be accessed and removed from or repositioned in a queue in any context as
long as the lock is held; only the owner may insert a map.
To reduce lock contention, some bus_dma functions remove the map from
the queue temporarily (on behalf of the map owner) for some operations and
reinsert it when they are done. Shorter operations and operations which are
not done on behalf of the lock owner are completely covered by the lock.

To facilitate the locking, reorganize the streaming buffer handling;
while being there, fix an old oversight which would cause the streaming
buffer to always be flushed, regardless of whether streaming was enabled
in the TSB entry. The streaming buffer is still disabled for now, since
there are a number of drivers which lack critical bus_dmamp_sync() calls.

Additional testing by:	jake
2003-07-10 23:27:35 +00:00
bin -l prints all permissions, not just owner and group 2003-07-10 20:53:56 +00:00
contrib Add "blame" as an "annotate" alias for interoperability with subversion. 2003-07-07 19:15:36 +00:00
crypto This commit was generated by cvs2svn to compensate for changes in r116791, 2003-06-24 19:30:44 +00:00
etc Continue trying to build SENDMAIL_CF if the user uses SENDMAIL_CF 2003-07-10 04:53:32 +00:00
games Handle 12-hour clocks properly: when the time is 00:00-00:59, adjust the 2003-06-23 16:01:11 +00:00
gnu Only define a default editor if one isn't already defined. 2003-07-07 19:13:39 +00:00
include Don't be so chatty about osreldate.h creation steps when make(1) 2003-07-04 19:54:06 +00:00
kerberos5 Fixed "make checkdpadd". 2003-07-02 23:46:39 +00:00
lib Don't resume sigwait thread If signal is masked. 2003-07-09 22:30:55 +00:00
libexec Block SIGURG while reading from the control channel. 2003-07-09 13:54:33 +00:00
release Catch up with the English version: 2003-07-09 08:58:08 +00:00
rescue Remove mount_portalfs, it's just wrong in this context. 2003-06-30 21:13:56 +00:00
sbin Correct to match reality regarding interface names. 2003-07-08 13:24:42 +00:00
secure Fixed "make checkdpadd". 2003-07-02 23:38:42 +00:00
share Add support for a bunch of Microsoft networking products: 2003-07-10 18:43:17 +00:00
sys Lock down the IOMMU bus_dma implementation to make it safe to use 2003-07-10 23:27:35 +00:00
tools Fixed broken arithmetic expression parser. 2003-07-04 13:33:48 +00:00
usr.bin Add my birthday to the calendar. 2003-07-08 18:31:49 +00:00
usr.sbin "towards" -> "toward". According to dictionary.com, the use of "towards" 2003-07-08 01:39:02 +00:00
COPYRIGHT Update to add the July 22, 1999 addendum. 1999-09-05 21:33:47 +00:00
MAINTAINERS Remove MAINTAINER= lines from individual Makefiles in favor of the 2003-07-07 03:54:04 +00:00
Makefile Don't hardcore PATH into BINMAKE; the latter should only be 2003-07-04 17:35:26 +00:00
Makefile.inc1 Correct makefile syntax error in r1.375. 2003-07-10 05:29:56 +00:00
README KerberosIV de-orbit burn continues. Disconnect from "make world". 2003-03-08 10:01:26 +00:00
UPDATING Add a retrospective entry about how having installed a broken sed(1) 2003-06-13 20:05:46 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The
``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html