Jung-uk Kim [Mon, 27 Apr 2009 17:29:51 +0000 (17:29 +0000)]
- Always force AHCI mode on a ATI/AMD SB600/700/800 SATA controller. These
controllers may be configured as legacy IDE mode by modifying subclass and
progif without actually changing PCI device IDs. Instead of complicating
code, we always force AHCI mode while probing. Also we restore AHCI mode
while resuming per ATI/AMD register programming/requirement guides.
- Fix SB700/800 "combined" mode. Unlike SB600, this PATA controller can
combine two SATA ports and emulate one PATA channel as primary or secondary
depending on BIOS configuration. When the combined mode is disabled, this
channel disappears and it works just like SB600 PATA controller, however.
- Add more PCI device IDs for SB700/800 and adjust device descriptions.
SB800 shares the same PCI device IDs and added two more SATA IDs.
Rick Macklem [Mon, 27 Apr 2009 16:46:16 +0000 (16:46 +0000)]
Change the semantics of i_modrev/va_filerev to what is required for
the nfsv4 Change attribute. There are 2 changes:
1 - The value now changes on metadata changes as well as data
modifications (incremented for IN_CHANGE instead of IN_UPDATE).
2 - It is now saved in spare space in the on-disk i-node so that it
survives a crash.
Since va_filerev is not passed out into user space, the only current
use of va_filerev is in the nfs server, which uses it as the directory
cookie verifier. Since this verifier is only passed back to the server
by a client verbatim and then the server doesn't check it, changing the
semantics should not break anything currently in FreeBSD.
Start to convert this over to the new tty layer. These changes allow
this driver to compile and limp along with the new layer. These changes
do not deal with proper locking around access to the HW. This is only
a starting point. I have not tested modem control but tip seems to work
okay and I can send and receive characters which I needed for one of my
-current boxes. I have not tied this driver back up to the build since
I don't want people to think it is ready for prime time. If anyone
else has some cycles to work on this feel free to!
Also add support for a 16 port PCI interface I have at work.
Andrew Gallatin [Mon, 27 Apr 2009 15:45:54 +0000 (15:45 +0000)]
Updates to mxge for multiple tx/rx rings:
- Update mxge to use if_transmit(), and the new buf_ring
interfaces, so as to enable multiple transmit queues.
Use of if_transmit() is conditional on IFNET_BUF_RING,
and is enabled by default (as in if_em).
- Record a flow id on receive if receive hashing is active.
I currently only record the rx ring id (0..8) rather than
the 32-bit topelitz hash result, as doing the latter would
require shifting the driver to use a larger rx return ring.
Sam Leffler [Sun, 26 Apr 2009 23:11:22 +0000 (23:11 +0000)]
add IEEE80211_FEXT_4ADDR to indicate ieee80211_encap should do 4-address
encapsulation when relaying frames; this reduces the cost of the test and
enables use for situations other than "sta vap + dwds"
Sam Leffler [Sun, 26 Apr 2009 23:02:17 +0000 (23:02 +0000)]
hoist ampdu tx aggregation setup from ieee80211_encap to ieee80211_start
where it was meant all along (the code was in encap because ampdu was
implemented pre vaps)
Marko Zec [Sun, 26 Apr 2009 22:06:42 +0000 (22:06 +0000)]
In preparation for turning on options VIMAGE in next commits,
rearrange / replace / adjust several INIT_VNET_* initializer
macros, all of which currently resolve to whitespace.
Reviewed by: bz (an older version of the patch)
Approved by: julian (mentor)
Ed Schouten [Sun, 26 Apr 2009 21:03:27 +0000 (21:03 +0000)]
Make the SPX code use its own copies of insque()/remque().
Instead of using the antique insque()/remque() functions from
sys/queue.h, make this code use its own versions. Eventually the code
should just use the regular TAILQ/LIST macros.
Robert Watson [Sun, 26 Apr 2009 19:05:40 +0000 (19:05 +0000)]
Acquire IF_ADDR_LOCK() around most iterations over ifp->if_addrhead
(colloquially known as if_addrlist). Currently not acquired around
interface address loops that call out to the routing code due to
potential lock order issues.
Tim Kientzle [Sun, 26 Apr 2009 18:57:50 +0000 (18:57 +0000)]
Reading an mtree file is supposed to provide
access to the file data (if the file exists on
disk). This was broken for the first regular
file; fix it and add a test so it won't break again.
In particular, this fixes the following idiom for creating
a tar archive in which every file is owned by root:
tar cf - --format=mtree . \
| sed -e 's/uname=[a-z]*/uname=root/' -e 's/uid=[0-9]*/uid=0/' \
| tar cf - @-
Tim Kientzle [Sun, 26 Apr 2009 18:46:40 +0000 (18:46 +0000)]
Various improvements to the tar.5 manpage, including
descriptions of the GNU tar "posix-style" sparse format,
clarification of the Solaris tar ACL storage,
and a few comments about Mac OS X tar's resource storage.
Ed Schouten [Sun, 26 Apr 2009 09:36:55 +0000 (09:36 +0000)]
Remove even more empty directories.
I just used `hidesvn find . -type d -empty' to figure out which
directories are empty. This means I couldn't easily figure out which
directories only contained empty subdirectories.
Marko Zec [Sun, 26 Apr 2009 07:14:50 +0000 (07:14 +0000)]
In preparation to make options VIMAGE operational, where needed,
initialize / release netgraph related state in iattach() / idetach()
functions called via the vnet module registration / initialization
framework, instead of initialization / cleanups being done in
mod_event handlers.
While here, introduce a crude hack aimed at preventing ng_ether to
autoattach to ng_eiface ifnets, which are also netgraph nodes already.
Marko Zec [Sun, 26 Apr 2009 07:09:39 +0000 (07:09 +0000)]
Extend the vnet module registration / initialization framework
first introduced @ r190909 with a vnet module deregistration
service.
kldunloadable modules, which are currently using vnet_mod_register()
to attach their per-vnet initialization routines to the vnet
initialization framework, should call vnet_mod_deregister() before
acknowledging MOD_UNLOAD requests in their mod_event handlers. Such
changes to the existing code base will follow in subsequent commits.
vnet_mod_deregister() does not check whether departing vnet modules
are registered as prerequisites for another module(s), so it should
be used with care. Currently I'm only aware of vnet modules which
are leafs on module dependency graphs that are kldunloadable.
This change also introduces per-vnet module destructor handler, which
calls vnet's module cleanup function, which (if required) has to be
registered in vnet module's vnet_modinfo_t structure .vmi_idetach
field. Once options VIMAGE becomes operational, the framework will
take care that module's cleanup function become invoked for each
active vnet instance, and that the memory allocated for each instance
gets freed. Currently calls to destructor handlers must always
succeed.
Robert Watson [Sat, 25 Apr 2009 23:02:57 +0000 (23:02 +0000)]
Expand coverage of IF_ADDR_LOCK() in in_control() from point of initial
lookup of 'ia' from if_addrhead through most use. Note that we
currently have to drop it prematurely in some cases due to calls out to
the routing and interface code while using 'ia', but this closes many
races. Annotate several potential races that persist after this change.
Move to using M_NOWAIT for allocating new interface addresses due to
lock(s) being held.
Andrew Thompson [Sat, 25 Apr 2009 21:10:06 +0000 (21:10 +0000)]
Track the usb device state as its powered on, addressed and configured. This helps
to avoid touching the device when it is not going to respond and would otherwise
timeout.
Implement the suspend tracking as a udev state too.
Ed Schouten [Sat, 25 Apr 2009 10:05:55 +0000 (10:05 +0000)]
Turn MAXPTSDEVS into a sysctl tunable.
This allows users to increase the maximum amount of pseudo-terminals
without changing any source code. Users must increase UT_LINESIZE before
attempting to increase kern.pts_maxdev.
Alan Cox [Sat, 25 Apr 2009 02:59:06 +0000 (02:59 +0000)]
Eliminate unnecessary calls to pmap_clear_modify(). Specifically, calling
pmap_clear_modify() on a page is pointless if that page is not mapped or
it is only mapped for read access. Instead, assert that the page is not
mapped or not mapped for write access as appropriate.
Eliminate unnecessary clearing of a page's dirty mask. Instead, assert
that the page's dirty mask is clear.
Robert Watson [Fri, 24 Apr 2009 09:58:50 +0000 (09:58 +0000)]
Add UPDATING note about change to struct malloc_type -- following several
reports of panics, remind readers that rebuilding kernel modules between
kernel upgrades in HEAD is a good idea.
Robert Watson [Fri, 24 Apr 2009 09:54:46 +0000 (09:54 +0000)]
Relocate permissions checking code in in_control() to before the body
of the implementation of ioctls. This makes the mapping of ioctls to
specific privileges more explicit, and also simplifies the
implementation by reducing the use of FALLTHROUGH handling in switch.
While this is not intended to be a functional change, it does mean
that certain privilege checks are now performed earlier, so EPERM
might be returned in preference to EADDRNOTAVAIL for management
ioctls that could have failed for both reasons.
When memory is not zero'ed by firmware, uninitialized PCB can have bogus
contents, which appear as a saved onfault condition, Altivec context to
restore etc. and lead to corruption/crashes. This commit fixes such issues.
Submitted by: Michal Mazur arg ! semihalf dot com
Tested by: Andreas Tobler andreast-list ! fgznet dot ch
Add suppport for ISA and ISA interrupts to make the ATA
controller in the VIA southbridge functional in the CDS
(Configurable Development System) for MPC85XX.
The embedded USB controllers look operational but the
interrupt steering is still wrong.
Reimplement bs_be_rs_{1|2|4} and bs_le_rs_{1|2|4} by not
calling the inline functions in <machine/pio.h> and do
not add synchronization. Implement bs_gen_barrier() as
eieio and sync.
Robert Watson [Thu, 23 Apr 2009 21:41:37 +0000 (21:41 +0000)]
Reorganize in_control() so that invariants are more obvious, and so
that it is easier to lock:
- Handle the unsupported ioctl case at the beginning of in_control(),
handing off to ifp->if_ioctl, rather than looking up interfaces and
addresses unnecessarily in this case.
- Make it an invariant that ifp is always non-NULL when running
in_control()-implemented ioctls, simplifying the code structure.
Do not call vm_page_lookup() from the ddb routine, namely from "show
vmopag" implementation. The vm_page_lookup() code modifies splay tree
of the object pages, and asserts that object lock is taken. First issue
could cause kernel data corruption, and second one instantly panics the
INVARIANTS-enabled kernel.
Take the advantage of the fact that object->memq is ordered by page index,
and iterate over memq to calculate the runs.
While there, make the code slightly more style-compliant by moving
variables declarations to the right place.
John Baldwin [Thu, 23 Apr 2009 20:24:19 +0000 (20:24 +0000)]
Reduce the number of bounce zones (and thus the number of bounce pages
used in some cases):
- Ignore DMA tag boundaries when allocating bounce pages. The boundaries
don't determine whether or not parts of a DMA request bounce. Instead,
they are just used to carve up segments.
- Allow tags with sub-page alignment to share bounce pages since bounce
pages are always page aligned.
Robert Watson [Thu, 23 Apr 2009 13:08:47 +0000 (13:08 +0000)]
Add ifunit_ref(), a version of ifunit(), that returns not just an
interface pointer, but also a reference to it.
Modify ifioctl() to use ifunit_ref(), holding the reference until
all ioctls, etc, have completed.
This closes a class of reader-writer races in which interfaces
could be removed during long-running ioctls, leading to crashes.
Many other consumers of ifunit() should now use ifunit_ref() to
avoid similar races.
Robert Watson [Thu, 23 Apr 2009 11:51:53 +0000 (11:51 +0000)]
During if_detach(), invoke if_dead() to set the ifnet's function
pointers to "dead" implementations that no-op rather than invoking
the device driver. This would generally be unexpected and
possibly quite badly handled by most device drivers after
if_detach() has completed.
Robert Watson [Thu, 23 Apr 2009 10:59:40 +0000 (10:59 +0000)]
Move portions of data structure initialization from if_attach() to
if_alloc(), and portions of data structure destruction from if_detach()
to if_free(). These changes leave more of the struct ifnet in a
safe-to-access condition between alloc and attach, and between detach
and free, and focus on attach/detach as stack usage events rather than
data structure initialization.
Affected fields include the linkstate task queue, if_afdata lock,
address lists, kqueue state, and MAC labels. ifq_attach() ifq_detach()
are not moved as ifq_attach() may use a queue length set by the device
driver between if_alloc() and if_attach().
Robert Watson [Thu, 23 Apr 2009 09:32:30 +0000 (09:32 +0000)]
Add a new interface flag, IFF_DYING, which is set when a device driver
calls if_free(), and remains set if the refcount is elevated. IF_DYING
skips the bit in the if_flags bitmask previously used by IFF_NEEDSGIANT,
so that an MFC can be done without changing which bit is used, as
IFF_NEEDSGIANT is still present in 7.x.
ifnet_byindex_ref() checks for IFF_DYING and returns NULL if it is set,
preventing new references from by acquired by index, preventing
monitoring sysctls from seeing it. Other lookup mechanisms currently
do not check IFF_DYING, but may need to in the future.
Ed Schouten [Thu, 23 Apr 2009 09:11:37 +0000 (09:11 +0000)]
Let pflogd's Makefile just use WARNS instead of changing CFLAGS.
This change allows me to disable -Werror by using NO_WERROR. Right now
I can't build pflogd using Clang, because Clang generates more warnings
when passing -Wall.
Stanislav Sedov [Wed, 22 Apr 2009 23:54:41 +0000 (23:54 +0000)]
- Add the driver for AT91RM9200 CompactFlash controller. The driver
operates in the common memory mode and use polling mode to control
the status of operations as I don't have any board with interrupt
line routed yet. I'll add the GPIO interrupt driven mode as soon
as I get one.
John Baldwin [Wed, 22 Apr 2009 21:40:37 +0000 (21:40 +0000)]
Adjust the way we number CPUs on x86 so that we attempt to "group" all
logical CPUs in a package. We do this by numbering the non-boot CPUs
by starting with the first CPU whose APIC ID is after the boot CPU and
wrapping back around to APIC ID 0 if needed rather than always starting
at APIC ID 0. While here, adjust the cpu_mp_announce() routine to list
CPUs based on the mapping established by assign_cpu_ids() rather than
making assumptions about the algorithm assign_cpu_ids() uses.