]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoHide some debug messages under debug macro.
ae [Wed, 1 Jun 2011 12:33:05 +0000 (12:33 +0000)]
Hide some debug messages under debug macro.

MFC after: 1 week

13 years agoHide useless warning under debug macro.
ae [Wed, 1 Jun 2011 12:05:35 +0000 (12:05 +0000)]
Hide useless warning under debug macro.

PR: kern/69963
MFC after: 1 week

13 years agoAdd .interp back into INITIAL_READONLY_SECTIONS in MIPS n64 ABI.
jchandra [Wed, 1 Jun 2011 10:23:03 +0000 (10:23 +0000)]
Add .interp back into INITIAL_READONLY_SECTIONS in MIPS n64 ABI.

The binutils update in r218822 caused the MIPS n64 dynamic binaries to
fail because the ".interp" section is not in the initial sections.
This happens because elf64bmip-defs.sh overrides INITIAL_READONLY_SECTIONS
to add ".MIPS.options" sections instead of the ".reginfo" section used
by n32.
This used to work fine, but after r218822, INITIAL_READONLY_SECTIONS also
contains the .interp section, so the override has to be done differently.

Reported by : aduane at juniper

Obtained from: gonzo (Initial version)

13 years agoProvide hit-count with rest of the information about a filter.
np [Wed, 1 Jun 2011 01:32:58 +0000 (01:32 +0000)]
Provide hit-count with rest of the information about a filter.

MFC after: 1 week

13 years agoFirmware device log.
np [Tue, 31 May 2011 23:49:13 +0000 (23:49 +0000)]
Firmware device log.

# sysctl dev.t4nex.0.devlog

MFC after: mdf's sysctl+sbuf changes are MFC'd

13 years agoFix a bug introduced in revision 222537.
ken [Tue, 31 May 2011 22:39:32 +0000 (22:39 +0000)]
Fix a bug introduced in revision 222537.

In msgbuf_reinit() and msgbuf_init(), we weren't initializing the mutex.
Depending on the contents of memory, the LO_INITIALIZED flag might be
set on the mutex (either due to a warm reboot, and the message buffer
remaining in place, or due to garbage in memory) and in that case, with
INVARIANTS turned on, we would trigger an assertion that the mutex had
already been initialized.

Fix this by bzeroing the message buffer mutex for the _init() and _reinit()
paths.

Reported by: mdf

13 years agoMerge ACPICA 20110527.
jkim [Tue, 31 May 2011 19:45:58 +0000 (19:45 +0000)]
Merge ACPICA 20110527.

13 years agoAdd module version to iwi/ipw/wpi and iwn.
bschmidt [Tue, 31 May 2011 19:08:25 +0000 (19:08 +0000)]
Add module version to iwi/ipw/wpi and iwn.

The version is used to check if a module is already preset, not setting
it results in:

can't re-use a leaf (ipw)!
module_register: module pci/ipw already exists!
Module pci/ipw failed to register: 17

while trying to load the module due to an entry in loader.conf. With this
commit we get the expected:

module ipw already present!

Reported by: Dru Lavigne, bz
Tested by: bz
MFC after: 1 week

13 years agoIf driver is not running, disable interrupts and do not try to
yongari [Tue, 31 May 2011 18:45:15 +0000 (18:45 +0000)]
If driver is not running, disable interrupts and do not try to
process received frames.  Previously it was possible to handle RX
interrupts even if controller is not fully initialized. This
resulted in non-working driver after system is up and running.

Reported by: hselasky
Tested by: hselasky

13 years agoAdd a sentence to the umount.8 man page to clarify the behaviour
rmacklem [Tue, 31 May 2011 18:27:18 +0000 (18:27 +0000)]
Add a sentence to the umount.8 man page to clarify the behaviour
for forced dismount when used on an NFS mount point. Requested by
Jeremy Chadwick.
This is a content change.

MFC after: 2 weeks

13 years agoFix the new NFS client so that it doesn't do an NFSv3
rmacklem [Tue, 31 May 2011 17:43:25 +0000 (17:43 +0000)]
Fix the new NFS client so that it doesn't do an NFSv3
Pathconf RPC for cases where the reply doesn't include
the answer. This fixes a problem reported by avg@ where
the NFSv3 Pathconf RPC would fail when "ls -l" did an
lpathconf(2) for _PC_ACL_NFS4.

Tested by: avg
MFC after: 2 weeks

13 years agoFix apparent garbage in the message buffer.
ken [Tue, 31 May 2011 17:29:58 +0000 (17:29 +0000)]
Fix apparent garbage in the message buffer.

While we have had a fix in place (options PRINTF_BUFR_SIZE=128) to fix
scrambled console output, the message buffer and syslog were still getting
log messages one character at a time.  While all of the characters still
made it into the log (courtesy of atomic operations), they were often
interleaved when there were multiple threads writing to the buffer at the
same time.

This fixes message buffer accesses to use buffering logic as well, so that
strings that are less than PRINTF_BUFR_SIZE will be put into the message
buffer atomically.  So now dmesg output should look the same as console
output.

subr_msgbuf.c: Convert most message buffer calls to use a new spin
lock instead of atomic variables in some places.

Add a new routine, msgbuf_addstr(), that adds a
NUL-terminated string to a message buffer.  This
takes a priority argument, which allows us to
eliminate some races (at least in the the string
at a time case) that are present in the
implementation of msglogchar().  (dangling and
lastpri are static variables, and are subject to
races when multiple callers are present.)

msgbuf_addstr() also allows the caller to request
that carriage returns be stripped out of the
string.  This matches the behavior of msglogchar(),
but in testing so far it doesn't appear that any
newlines are being stripped out.  So the carriage
return removal functionality may be a candidate
for removal later on if further analysis shows
that it isn't necessary.

subr_prf.c: Add a new msglogstr() routine that calls
msgbuf_logstr().

Rename putcons() to putbuf().  This now handles
buffered output to the message log as well as
the console.  Also, remove the logic in putcons()
(now putbuf()) that added a carriage return before
a newline.  The console path was the only path that
needed it, and cnputc() (called by cnputs())
already adds a carriage return.  So this
duplication resulted in kernel-generated console
output lines ending in '\r''\r''\n'.

Refactor putchar() to handle the new buffering
scheme.

Add buffering to log().

Change log_console() to use msglogstr() instead of
msglogchar().  Don't add extra newlines by default
in log_console().  Hide that behavior behind a
tunable/sysctl (kern.log_console_add_linefeed) for
those who would like the old behavior.  The old
behavior led to the insertion of extra newlines
for log output for programs that print out a
string, and then a trailing newline on a separate
write.  (This is visible with dmesg -a.)

msgbuf.h: Add a prototype for msgbuf_addstr().

Add three new fields to struct msgbuf, msg_needsnl,
msg_lastpri and msg_lock.  The first two are needed
for log message functionality previously handled
by msglogchar().  (Which is still active if
buffering isn't enabled.)

Include sys/lock.h and sys/mutex.h for the new
mutex.

Reviewed by: gibbs

13 years agoDon't need (and can't use) -L to copy links here.
imp [Tue, 31 May 2011 17:14:06 +0000 (17:14 +0000)]
Don't need (and can't use) -L to copy links here.

13 years agoFix a couple of spelling errors.
imp [Tue, 31 May 2011 16:59:14 +0000 (16:59 +0000)]
Fix a couple of spelling errors.

Submitted by: bcr@

13 years ago- Document the -H option and 'H' key alongside other options and keys
jhb [Tue, 31 May 2011 15:41:10 +0000 (15:41 +0000)]
- Document the -H option and 'H' key alongside other options and keys
  rather than at the bottom of the manpage.
- Remove an obsolete comment about SWAIT being a stale state.  It was
  resurrected for a different purpose in FreeBSD 5 to mark idle ithreads.
- Add a comment documenting that the SLEEP and LOCK states typically
  display the name of the event being waited on with lock names being
  prefixed with an asterisk and sleep event names not having a prefix.

MFC after: 1 week

13 years agoOn multi-core, multi-threaded PPC systems, it is important that the threads
nwhitehorn [Tue, 31 May 2011 15:11:43 +0000 (15:11 +0000)]
On multi-core, multi-threaded PPC systems, it is important that the threads
be brought up in the order they are enumerated in the device tree (in
particular, that thread 0 on each core be brought up first). The SLIST
through which we loop to start the CPUs has all of its entries added with
SLIST_INSERT_HEAD(), which means it is in reverse order of enumeration
and so AP startup would always fail in such situations (causing a machine
check or RTAS failure). Fix this by changing the SLIST into an STAILQ,
and inserting new CPUs at the end.

Reviewed by: jhb

13 years agoAdd a new option to toggle the display of the system idle process (per-CPU
jhb [Tue, 31 May 2011 15:11:23 +0000 (15:11 +0000)]
Add a new option to toggle the display of the system idle process (per-CPU
idle threads).  The process is displayed by default (subject to whether or
not system processes are displayed) to preserve existing behavior.  The
system idle process can be hidden via the '-z' command line argument or the
'z' key while top is running.  When it is hidden, top more closely matches
the behavior of FreeBSD <= 4.x where idle time was not accounted to any
process.

MFC after: 2 weeks

13 years agoRemove some further INET related symbols from pf to allow the module
bz [Tue, 31 May 2011 15:05:29 +0000 (15:05 +0000)]
Remove some further INET related symbols from pf to allow the module
to not only compile bu load as well for testing with IPv6-only kernels.
For the moment we ignore the csum change in pf_ioctl.c given the
pending update to pf45.

Reported by: dru
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 20 days

13 years agoStart teaching pc-sysinstall about IPv6.
bz [Tue, 31 May 2011 15:02:30 +0000 (15:02 +0000)]
Start teaching pc-sysinstall about IPv6.

Add some additional empty string checks for IPv4 and try to configure
a netmask along with the address rather than doing things twice.

Contrary to AUTO-DHCP, IPv6-SLAAC will accept static configuration
as well, which we will use at least for resolv.conf currently and
if we were given a static address configure that as an alias as well.

The pc-sysinstaller changes going along were committed to PC-BSD as r10773.

Reviewed by: kmoore
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 20 days

13 years agoConditionally compile in the af_inet and af_inet6, af_nd6 modules.
bz [Tue, 31 May 2011 14:40:21 +0000 (14:40 +0000)]
Conditionally compile in the af_inet and af_inet6, af_nd6 modules.
If compiled in for dual-stack use, test with feature_present(3)
to see if we should register the IPv4/IPv6 address family related
options.

In case there is no "inet" support we would love to go with the
usage() and make the address family mandatory (as it is for anything
but inet in theory).  Unfortunately people are used to
  ifconfig IF up/down
etc. as well, so use a fallback of "link".  Adjust the man page
to reflect these minor details.

Improve error handling printing a warning in addition to the usage
telling that we do not know the given address family in two places.

Reviewed by: hrs, rwatson
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 2 weeks

13 years agoIt is generally considered useful for release media to have kernels on them.
nwhitehorn [Tue, 31 May 2011 12:59:15 +0000 (12:59 +0000)]
It is generally considered useful for release media to have kernels on them.

Submitted by: joel

13 years agoAdd quirks to hint 4K physical sector (Advanced Format) for ATA disks not
mav [Tue, 31 May 2011 09:22:52 +0000 (09:22 +0000)]
Add quirks to hint 4K physical sector (Advanced Format) for ATA disks not
reporting it properly (none? of known disks now).

Hitachi and WDC AF disks seem could be identified more or less formally.
For Seagate and Samsung enumerate some found models/series.
For other disks it can be forced with kern.cam.ada.X.quirks=1 tunable.

13 years agoMinor wording adjustments to usbdump(8).
bcr [Tue, 31 May 2011 07:13:07 +0000 (07:13 +0000)]
Minor wording adjustments to usbdump(8).

PR: docs/157317
Submitted by: Warren Block (wblock at wonkity dot com)
Reviewed by: hps@
MFC after: 5 days

13 years agoImagine situation where a security problem is found in setuid binary.
pjd [Tue, 31 May 2011 07:02:49 +0000 (07:02 +0000)]
Imagine situation where a security problem is found in setuid binary.
User upgrades his system to fix the problem, but if he has any ZFS snapshots
for the file system which contains problematic binary, any user can mount the
snapshot and execute vulnerable binary.

Prevent this from happening by always mounting snapshots with setuid turned off.

MFC after: 2 weeks

13 years agoCorrectly check MAC running status before disabling TX/RX MACs.
yongari [Tue, 31 May 2011 01:30:58 +0000 (01:30 +0000)]
Correctly check MAC running status before disabling TX/RX MACs.

13 years agoNo logner set an IPv4 loopback address by default in defaults/rc.conf.
bz [Tue, 31 May 2011 00:25:52 +0000 (00:25 +0000)]
No logner set an IPv4 loopback address by default in defaults/rc.conf.
If not specified, network.subr will add it automatically if we have
INET support (1).

In network.subr only call the address family up/down functions
if the respective AF is available.

Switch to new kern.features variables for inet and inet6 as the
inet sysctl tree is also available for IPv6-only kernels leading
to unexpected results.

Suggested by: hrs (1)
Reviewed by: hrs
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 20 days

13 years agoUpdate to firmware interface 1.3.10
np [Mon, 30 May 2011 21:56:37 +0000 (21:56 +0000)]
Update to firmware interface 1.3.10

MFC after: 1 week

13 years agosh: Add tests for some somewhat obscure aspects of function definitions.
jilles [Mon, 30 May 2011 21:49:59 +0000 (21:49 +0000)]
sh: Add tests for some somewhat obscure aspects of function definitions.

13 years agoposix_spawn(): Do not fail when trying to close an fd that is not open.
jilles [Mon, 30 May 2011 21:41:06 +0000 (21:41 +0000)]
posix_spawn(): Do not fail when trying to close an fd that is not open.

As noted in Austin Group issue #370 (an interpretation has been issued),
failing posix_spawn() because an fd specified with
posix_spawn_file_actions_addclose() is not open is unnecessarily harsh, and
there are existing implementations that do not fail posix_spawn() for this
reason.

Reviewed by: ed
MFC after: 10 days

13 years ago- Specialized ingress queues that take interrupts for other ingress
np [Mon, 30 May 2011 21:34:44 +0000 (21:34 +0000)]
- Specialized ingress queues that take interrupts for other ingress
  queues.  Try to have a set of these per port when possible, fall back
  to sharing a common pool between all ports otherwise.

- One control queue per port (used to be one per hardware channel).

- t4_eth_rx now handles Ethernet rx only.

- sysctls to display pidx/cidx for some queues.

MFC after: 1 week

13 years agoL2 table code. This is enough to get the T4's switch + L2 rewrite
np [Mon, 30 May 2011 21:07:26 +0000 (21:07 +0000)]
L2 table code.  This is enough to get the T4's switch + L2 rewrite
filters working.  (All other filters - switch without L2 info rewrite,
steer, and drop - were already fully-functional).

Some contrived examples of "switch" filters with L2 rewriting:

# cxgbetool t4nex0  iport 0  dport 80  action switch  vlan +9  eport 3
Intercept all packets received on physical port 0 with TCP port 80 as
destination, insert a vlan tag with VID 9, and send them out of port 3.

# cxgbetool t4nex0  sip 192.168.1.1/32  ivlan 5  action switch \
vlan =9  smac aa:bb:cc:dd:ee:ff  eport 0
Intercept all packets (received on any port) with source IP address
192.168.1.1 and VLAN id 5, rewrite the VLAN id to 9, rewrite source mac
to aa:bb:cc:dd:ee:ff, and send it out of port 0.

MFC after: 1 week

13 years agoClean up the unneeded cpp macro INLINE_REM_PIO2L.
kargl [Mon, 30 May 2011 19:41:28 +0000 (19:41 +0000)]
Clean up the unneeded cpp macro INLINE_REM_PIO2L.

Reviewed by: das
Approved by: das (mentor)

13 years agoUnbreak NOINET kernels after r222488.
bz [Mon, 30 May 2011 18:07:35 +0000 (18:07 +0000)]
Unbreak NOINET kernels after r222488.

Reviewed by: rwatson
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems!
Pointy hat: to myself for missing this during review?

13 years agoContrary to the rc.conf framework, when manualy enabling IPv6 we have
bz [Mon, 30 May 2011 17:27:48 +0000 (17:27 +0000)]
Contrary to the rc.conf framework, when manualy enabling IPv6 we have
to -ifdiabled ourselves.

Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems

13 years agoEnable setting the short-GI bit when TX'ing HT rates but only if the
adrian [Mon, 30 May 2011 15:06:57 +0000 (15:06 +0000)]
Enable setting the short-GI bit when TX'ing HT rates but only if the
hardware supports it.

Since ni->ni_htcap in hostap mode is what the remote end has advertised,
not what has been negotiated/decided, we need to check ourselves what
the current channel width is and what the hardware supports before
enabling short-GI.

It's important that short-GI isn't enabled when it isn't negotiated
and when the hardware doesn't support it (ie, short-gi for 20mhz channels
on any chip < AR9287.)

I've quickly verified this on the AR9285 in 11n mode.

13 years agoSet default A-MPDU density/size.
adrian [Mon, 30 May 2011 14:57:00 +0000 (14:57 +0000)]
Set default A-MPDU density/size.

13 years agoDocument kern.geom.part.check_integrity sysctl variable.
ae [Mon, 30 May 2011 11:17:42 +0000 (11:17 +0000)]
Document kern.geom.part.check_integrity sysctl variable.

13 years agoBump document date.
bcr [Mon, 30 May 2011 10:28:55 +0000 (10:28 +0000)]
Bump document date.
I accidently committed the actual change (typo fix) in r222492, which
is a completely unrelated change.

13 years agoAdd a short description about NO_CHECKSUM.
bcr [Mon, 30 May 2011 10:23:59 +0000 (10:23 +0000)]
Add a short description about NO_CHECKSUM.

PR: docs/155980
Submitted by KOIE Hidetaka (koie at suri co jp)
MFC after: 7 days

13 years agoMention in ath(4) that ath_pci is required now.
adrian [Mon, 30 May 2011 10:12:17 +0000 (10:12 +0000)]
Mention in ath(4) that ath_pci is required now.

13 years agoAdd ath_ahb and ath_pci module manpages.
adrian [Mon, 30 May 2011 10:07:46 +0000 (10:07 +0000)]
Add ath_ahb and ath_pci module manpages.

13 years agoUpdate chipset support list for ath_hal.
adrian [Mon, 30 May 2011 10:02:51 +0000 (10:02 +0000)]
Update chipset support list for ath_hal.

13 years agoDecompose the current single inpcbinfo lock into two locks:
rwatson [Mon, 30 May 2011 09:43:55 +0000 (09:43 +0000)]
Decompose the current single inpcbinfo lock into two locks:

- The existing ipi_lock continues to protect the global inpcb list and
  inpcb counter.  This lock is now relegated to a small number of
  allocation and free operations, and occasional operations that walk
  all connections (including, awkwardly, certain UDP multicast receive
  operations -- something to revisit).

- A new ipi_hash_lock protects the two inpcbinfo hash tables for
  looking up connections and bound sockets, manipulated using new
  INP_HASH_*() macros.  This lock, combined with inpcb locks, protects
  the 4-tuple address space.

Unlike the current ipi_lock, ipi_hash_lock follows the individual inpcb
connection locks, so may be acquired while manipulating a connection on
which a lock is already held, avoiding the need to acquire the inpcbinfo
lock preemptively when a binding change might later be required.  As a
result, however, lookup operations necessarily go through a reference
acquire while holding the lookup lock, later acquiring an inpcb lock --
if required.

A new function in_pcblookup() looks up connections, and accepts flags
indicating how to return the inpcb.  Due to lock order changes, callers
no longer need acquire locks before performing a lookup: the lookup
routine will acquire the ipi_hash_lock as needed.  In the future, it will
also be able to use alternative lookup and locking strategies
transparently to callers, such as pcbgroup lookup.  New lookup flags are,
supplementing the existing INPLOOKUP_WILDCARD flag:

  INPLOOKUP_RLOCKPCB - Acquire a read lock on the returned inpcb
  INPLOOKUP_WLOCKPCB - Acquire a write lock on the returned inpcb

Callers must pass exactly one of these flags (for the time being).

Some notes:

- All protocols are updated to work within the new regime; especially,
  TCP, UDPv4, and UDPv6.  pcbinfo ipi_lock acquisitions are largely
  eliminated, and global hash lock hold times are dramatically reduced
  compared to previous locking.
- The TCP syncache still relies on the pcbinfo lock, something that we
  may want to revisit.
- Support for reverting to the FreeBSD 7.x locking strategy in TCP input
  is no longer available -- hash lookup locks are now held only very
  briefly during inpcb lookup, rather than for potentially extended
  periods.  However, the pcbinfo ipi_lock will still be acquired if a
  connection state might change such that a connection is added or
  removed.
- Raw IP sockets continue to use the pcbinfo ipi_lock for protection,
  due to maintaining their own hash tables.
- The interface in6_pcblookup_hash_locked() is maintained, which allows
  callers to acquire hash locks and perform one or more lookups atomically
  with 4-tuple allocation: this is required only for TCPv6, as there is no
  in6_pcbconnect_setup(), which there should be.
- UDPv6 locking remains significantly more conservative than UDPv4
  locking, which relates to source address selection.  This needs
  attention, as it likely significantly reduces parallelism in this code
  for multithreaded socket use (such as in BIND).
- In the UDPv4 and UDPv6 multicast cases, we need to revisit locking
  somewhat, as they relied on ipi_lock to stablise 4-tuple matches, which
  is no longer sufficient.  A second check once the inpcb lock is held
  should do the trick, keeping the general case from requiring the inpcb
  lock for every inpcb visited.
- This work reminds us that we need to revisit locking of the v4/v6 flags,
  which may be accessed lock-free both before and after this change.
- Right now, a single lock name is used for the pcbhash lock -- this is
  undesirable, and probably another argument is required to take care of
  this (or a char array name field in the pcbinfo?).

This is not an MFC candidate for 8.x due to its impact on lookup and
locking semantics.  It's possible some of these issues could be worked
around with compatibility wrappers, if necessary.

Reviewed by:    bz
Sponsored by:   Juniper Networks, Inc.

13 years agoUpgrade jail(2) to latest jail(2) API to make the regression test work
bz [Mon, 30 May 2011 09:41:38 +0000 (09:41 +0000)]
Upgrade jail(2) to latest jail(2) API to make the regression test work
again.  Eventually should switch to jail_set(2).

Reported by: rwatson
MFC after: 10 days

13 years agoRework TIMEWAIT regression test so that kernel-allocated port numbers are
rwatson [Mon, 30 May 2011 09:34:15 +0000 (09:34 +0000)]
Rework TIMEWAIT regression test so that kernel-allocated port numbers are
used rather than a fixed userspace one, avoiding conflicts between the two
test runs.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.

13 years agoAdd missing include of stdio.h.
rwatson [Mon, 30 May 2011 09:06:24 +0000 (09:06 +0000)]
Add missing include of stdio.h.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.

13 years agoIn the tcpdrop regression test, allow the kernel to allocate us a port
rwatson [Mon, 30 May 2011 09:04:35 +0000 (09:04 +0000)]
In the tcpdrop regression test, allow the kernel to allocate us a port
rather than using a fixed port number.  This means that the regression test
can be run many times in a row without waiting on TIMEWAIT to release a
hard-coded port number.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.

13 years agoAdd missing #include of err.h.
rwatson [Mon, 30 May 2011 08:54:32 +0000 (08:54 +0000)]
Add missing #include of err.h.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.

13 years agoWhile doing it right for current configuration, fix the entry for rc.conf
bz [Mon, 30 May 2011 08:40:59 +0000 (08:40 +0000)]
While doing it right for current configuration, fix the entry for rc.conf
adding the missing mandatory "inet6" keyword.

Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems

13 years agoFix read_ivar implementation for MMC and SD.
jchandra [Mon, 30 May 2011 06:23:51 +0000 (06:23 +0000)]
Fix read_ivar implementation for MMC and SD.

1. Both mmc_read_ivar() and sdhci_read_ivar() use the expression
'*(int *)result = val' to assign to result which is uintptr_t *.
This does not work on big-endian 64 bit systems.

2. The media_size ivar is declared as 'off_t' which does not fit
into uintptr_t in 32bit systems, change this to long.

Submitted by: kanthms at netlogicmicro com (initial version)

13 years agoWrap long line.
ae [Mon, 30 May 2011 05:53:00 +0000 (05:53 +0000)]
Wrap long line.

MFC after: 2 weeks

13 years agoAdd tablearg support for ipfw setfib.
ae [Mon, 30 May 2011 05:37:26 +0000 (05:37 +0000)]
Add tablearg support for ipfw setfib.

PR: kern/156410
MFC after: 2 weeks

13 years agoInclude forgotten framework changes to get some of the new menu files installed corre...
julian [Mon, 30 May 2011 04:23:33 +0000 (04:23 +0000)]
Include forgotten framework changes to get some of the new menu files installed correctly  on non x86/amd systems.
pointy-hut to  devin

13 years agoUse kproc_exit() instead of returning from the management function on
nwhitehorn [Sun, 29 May 2011 22:37:23 +0000 (22:37 +0000)]
Use kproc_exit() instead of returning from the management function on
systems with no manageable thermal control devices.

13 years agoSplit netconfig into three parts:
bz [Sun, 29 May 2011 21:24:20 +0000 (21:24 +0000)]
Split netconfig into three parts:
- netconfig - what auto will call which in turn will check for
  IPv4 and IPv6 to be available and ask the user to configure it
  by calling
- netconfig_ipv4 doing DHCP and static IPv4 addresses, and
- netconfig_ipv6 doing rtsol and static IPv6 addresses,
and then checking, querying and updating resolv.conf upon return.
Both DHCP and rtsol (in the future) might update resolv.conf already so
we seed ourselves from that file if available.

Reviewed by: nwhitehorn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems

13 years agoIf READ from the local node failed we send the request to the remote
trociny [Sun, 29 May 2011 21:20:47 +0000 (21:20 +0000)]
If READ from the local node failed we send the request to the remote
node. There is no use in doing this for synchronization requests.

Approved by: pjd (mentor)
MFC after: 1 week

13 years agoModify the umount(8) command so that it doesn't do
rmacklem [Sun, 29 May 2011 21:13:53 +0000 (21:13 +0000)]
Modify the umount(8) command so that it doesn't do
a sync(2) syscall before unmount(2) for the "-f" case.
This avoids a forced dismount from getting stuck for
an NFS mountpoint in sync() when the server is not
responsive. With this commit, forced dismounts should
normally work for the NFS clients, but can take up to
about 1minute to complete.

PR: kern/157365
Reviewed by: kib
MFC after: 2 weeks

13 years agoCheck for IPv4 or IPv6 to be available by the kernel to not
bz [Sun, 29 May 2011 21:03:40 +0000 (21:03 +0000)]
Check for IPv4 or IPv6 to be available by the kernel to not
provoke errors trying to query options not available.
Make it possible to compile out INET or INET6 only parts.

Reviewed by: jamie
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 10 days

13 years agoAdd a check for MNTK_UNMOUNTF at the beginning of nfs_sync()
rmacklem [Sun, 29 May 2011 20:55:23 +0000 (20:55 +0000)]
Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync()
in the old NFS client so that a forced dismount doesn't
get stuck in the VFS_SYNC() call that happens before
VFS_UNMOUNT() in dounmount(). Analagous to r222329 for the new NFS client.
An additional change is needed before forced dismounts will work.

PR: kern/157365
MFC after: 2 weeks

13 years agoAdd some error handling here: if a sensor returns an error code (a negative
nwhitehorn [Sun, 29 May 2011 20:46:53 +0000 (20:46 +0000)]
Add some error handling here: if a sensor returns an error code (a negative
Kelvin temperature, which is impossible except for some contrived magnetic
spin systems), use the previous measurement from that sensor instead of
corrupting everything and randomly changing the fans or shutting off the
machine.

13 years agoAdd the next digit of precision to temperatures, which I missed when
nwhitehorn [Sun, 29 May 2011 20:04:02 +0000 (20:04 +0000)]
Add the next digit of precision to temperatures, which I missed when
converting the reporting format from degrees C to 0.1 degree K.

13 years agoMove the celsius-to-kelvin conversion to a place that powermac_thermal can
nwhitehorn [Sun, 29 May 2011 19:53:46 +0000 (19:53 +0000)]
Move the celsius-to-kelvin conversion to a place that powermac_thermal can
see it as well.

13 years agoDon't put negative values into the averages.
nwhitehorn [Sun, 29 May 2011 19:53:11 +0000 (19:53 +0000)]
Don't put negative values into the averages.

13 years agoGet rid of unused functions.
tuexen [Sun, 29 May 2011 18:41:06 +0000 (18:41 +0000)]
Get rid of unused functions.

MFC after: 1 week.

13 years agoUpdate the I2C-based temperature/fan drivers to connect to the Powermac
nwhitehorn [Sun, 29 May 2011 18:35:57 +0000 (18:35 +0000)]
Update the I2C-based temperature/fan drivers to connect to the Powermac
thermal control module. This provides automatic fan management on all G5
PowerMacs and Xserves.

13 years agoIn soreceive_generic(), if MSG_WAITALL is set but the request is
trociny [Sun, 29 May 2011 18:00:50 +0000 (18:00 +0000)]
In soreceive_generic(), if MSG_WAITALL is set but the request is
larger than the receive buffer, we have to receive in sections.
When notifying the protocol that some data has been drained the
lock is released for a moment. Returning we block waiting for the
rest of data. There is a race, when data could arrive while the
lock was released and then the connection stalls in sbwait.

Fix this by checking for data before blocking and skip blocking
if there are some.

PR: kern/154504
Reported by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
Tested by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
Reviewed by: rwatson
Approved by: kib (co-mentor)
MFC after: 2 weeks

13 years agosh: Add test for 'set +o'.
jilles [Sun, 29 May 2011 15:02:10 +0000 (15:02 +0000)]
sh: Add test for 'set +o'.

13 years agoAdd some missing files. Without we hang in the OF prompt asking for screen.4th.
andreast [Sun, 29 May 2011 14:27:11 +0000 (14:27 +0000)]
Add some missing files. Without we hang in the OF prompt asking for screen.4th.

Approved by: nwhitehorn (mentor)

13 years agoAdd a new driver, the ad7417, to read temperatures and voltages on some
andreast [Sun, 29 May 2011 14:25:42 +0000 (14:25 +0000)]
Add a new driver, the ad7417, to read temperatures and voltages on some
PowerMac's.

Approved by: nwhitehorn (mentor)

13 years agoMention that jumbo frame support is disabled on PCIe VT6130/VT6132
bcr [Sun, 29 May 2011 11:10:56 +0000 (11:10 +0000)]
Mention that jumbo frame support is disabled on PCIe VT6130/VT6132
controllers because of TX MAC hangs when trying to send a frame
that is larger than 4K (see r200759).

PR: docs/156742
Submitted by: Michael Moll (kvedulv at kvedulv dot de)
Reviewed by: yongari@
MFC after: 6 days

13 years agoThe argument to setsockopt for IP_MULTICAST_LOOP depends on operating
bz [Sun, 29 May 2011 07:40:48 +0000 (07:40 +0000)]
The argument to setsockopt for IP_MULTICAST_LOOP depends on operating
system and is decided upon by configure and could be an u_int or a
u_char.  For FreeBSD it is a u_char.

For IPv6 however RFC 3493, 5.2 defines the argument to
IPV6_MULTICAST_LOOP to be an unsigned integer so make sure we always
use that using a second variable for the IPV6 case.
This is to get rid of these error messages every 5 minutes on some
systems:
ntpd[1530]: setsockopt IPV6_MULTICAST_LOOP failure: Invalid argument
  on socket 22, addr fe80::... for multicast address ff02::101

While here also fix the copy&paste error in the log message for
IPV6_MULTICAST_LOOP.

Reviewed by: roberto
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 10 days
Filed as: Bug 1936 on ntp.org

13 years agoSupply the LLE_STATIC flag bit to in_ifscurb() when scrubbing interface
qingli [Sun, 29 May 2011 02:21:35 +0000 (02:21 +0000)]
Supply the LLE_STATIC flag bit to in_ifscurb() when scrubbing interface
address so that proper clean up will take place in the routing code.
This patch fixes the bootp panic on startup problem. Also, added more
error handling and logging code in function in_scrubprefix().

MFC after: 5 days

13 years agoThe P4080 has 8 cores. Bump MAXCPU to 8 to match.
marcel [Sun, 29 May 2011 00:40:59 +0000 (00:40 +0000)]
The P4080 has 8 cores. Bump MAXCPU to 8 to match.

13 years agoo Add system versions for the P4040(E) and P4080(E).
marcel [Sun, 29 May 2011 00:27:42 +0000 (00:27 +0000)]
o   Add system versions for the P4040(E) and P4080(E).
o   In bare_probe(), change the logic that determines the maximum
    number of processors/cores into a switch statement and take
    advantage of the fact that bit 3 of the SVR value indicates
    whether we're running on a security enabled version. Since we
    don't care about that here, mask the bit. All -E versions
    are taken care of automatically.

13 years agoTeach if_ath about devices which have short-GI in 20MHz channel modes.
adrian [Sun, 29 May 2011 00:17:13 +0000 (00:17 +0000)]
Teach if_ath about devices which have short-GI in 20MHz channel modes.

This has been disabled until now because there hasn't been any supported
device which has this feature. Since the AR9287 is the first device to
support it, and since now the HAL has functional AR9287+11n support,
flip this on.

13 years agoAdapt smusat(4) to use powermac_thermal. This provides automatic fan
nwhitehorn [Sat, 28 May 2011 22:11:22 +0000 (22:11 +0000)]
Adapt smusat(4) to use powermac_thermal. This provides automatic fan
management on dual- and quad-core Powermac G5s, and the last G5 iMacs.

13 years agoRequire an error instead of a timeout to decide the new-style fan
nwhitehorn [Sat, 28 May 2011 21:54:18 +0000 (21:54 +0000)]
Require an error instead of a timeout to decide the new-style fan
commands won't work. This prevents a busy system from making smu(4)
suddenly decide its fans use the old-style command set.

MFC after: 3 days

13 years agoFactor out the SMU fan management code into a new module (powermac_thermal)
nwhitehorn [Sat, 28 May 2011 21:13:22 +0000 (21:13 +0000)]
Factor out the SMU fan management code into a new module (powermac_thermal)
that will connect all of the various sensors and fan control modules on
Apple hardware with software-controlled fans (e.g. all G5 systems).

MFC after: 1 month

13 years agoo Determine the number of LAWs in a way the is future proof. Only the
marcel [Sat, 28 May 2011 19:14:16 +0000 (19:14 +0000)]
o   Determine the number of LAWs in a way the is future proof. Only the
    MPC8555(E) has 8 LAWs, so don't make that the default case. Current
    processors have 12 LAWs so use that as the default instead.
o   Determine the target ID of the PCI/PCI-X and PCI-E controllers in
    a way that's more future proof. There's almost a perfect mapping
    from HC register offset to target ID, so use that as the default.
    Handle the MPC8548(E) specially, since it has a non-standard target
    ID for the PCI-E controller. Don't worry about whether the processor
    implements the target ID here, because we should not get called for
    PCI/PCI-X or PCI-E host controllers that don't exist.

13 years agoRemove unused defines. They're distracting...
marcel [Sat, 28 May 2011 16:30:24 +0000 (16:30 +0000)]
Remove unused defines. They're distracting...

13 years agoFix shell-based partitioning.
nwhitehorn [Sat, 28 May 2011 16:15:46 +0000 (16:15 +0000)]
Fix shell-based partitioning.

13 years agoFix AR9287 operation when >1 TX chain is enabled.
adrian [Sat, 28 May 2011 15:43:56 +0000 (15:43 +0000)]
Fix AR9287 operation when >1 TX chain is enabled.

I didn't pick this up with the initial commit because I was only testing
with 11bg.

13 years agoUpdate the manual page to reflect the new 32K/4K defaults.
mckusick [Sat, 28 May 2011 15:14:50 +0000 (15:14 +0000)]
Update the manual page to reflect the new 32K/4K defaults.

Reminded by: Ivan Voras

13 years agoDue to a lag in updating the fs_pendinginodes count, we cannot depend
mckusick [Sat, 28 May 2011 15:07:29 +0000 (15:07 +0000)]
Due to a lag in updating the fs_pendinginodes count, we cannot depend
on it to decide whether we should try to reclaim inodes when we run
short.

Discovered by: Peter Holm

13 years agoprintf(1): Document that %c and precision for %b/%s use bytes, not chars.
jilles [Sat, 28 May 2011 14:32:47 +0000 (14:32 +0000)]
printf(1): Document that %c and precision for %b/%s use bytes, not chars.

This means these features do not work as expected with multibyte characters.

This perhaps less than ideal behaviour matches printf(3) and is specified by
POSIX.

13 years agoprintf: Allow multibyte characters for '<char> form, avoid negative codes.
jilles [Sat, 28 May 2011 11:37:47 +0000 (11:37 +0000)]
printf: Allow multibyte characters for '<char> form, avoid negative codes.

Examples:
  LC_ALL=en_US.UTF-8 printf '%d\n' $(printf \'\\303\\244)
  LC_ALL=en_US.ISO8859-1 printf '%d\n' $(printf \'\\344)
Both of these should print 228.

Like some other shells, incomplete or invalid multibyte characters yield the
value of the first byte without a warning.

Note that there is no general way to go back from the character code to the
character.

13 years agoNew boot loader menus from Devin Teske.
julian [Sat, 28 May 2011 08:50:38 +0000 (08:50 +0000)]
New boot loader menus from Devin Teske.
Discussed on hackers and recommended for inclusion into 9.0 at the devsummit.
All support email to devin   dteske at vicor dot ignoreme dot com .

Submitted by: dteske at vicor dot ignoreme dot com
Reviewed by: me and many others

13 years agoBetter support different kernel hand-offs. When loaded directly
marcel [Sat, 28 May 2011 04:10:44 +0000 (04:10 +0000)]
Better support different kernel hand-offs. When loaded directly
from U-Boot, the kernel is passed a standard argc/argv pair.
The Juniper loader passes the metadata pointer as the second
argument and passes 0 in the first. The FreeBSD loader passes
the metadata pointer in the first argument.

As such, have locore preserve the first 2 arguments in registers
r30 & r31. Change e500_init() to accept these arguments. Don't
pass global offsets (i.e. kernel_text and _end) as arguments to
e500_init(). We can reference those directly.

Rename e500_init() to booke_init() now that we're changing the
prototype.

In booke_init(), "decode" arg1 and arg2 to obtain the metadata
pointer correctly. For the U-Boot case, clear SBSS and BSS and
bank on having a static FDT for now. This allows loading the
ELF kernel and jumping to the entry point without trampoline.

13 years agoUpgrade to 9.6-ESV-R4-P1, which address the following issues:
dougb [Sat, 28 May 2011 00:21:28 +0000 (00:21 +0000)]
Upgrade to 9.6-ESV-R4-P1, which address the following issues:

1. Very large RRSIG RRsets included in a negative cache can trigger
an assertion failure that will crash named (BIND 9 DNS) due to an
off-by-one error in a buffer size check.

This bug affects all resolving name servers, whether DNSSEC validation
is enabled or not, on all BIND versions prior to today. There is a
possibility of malicious exploitation of this bug by remote users.

2. Named could fail to validate zones listed in a DLV that validated
insecure without using DLV and had DS records in the parent zone.

Add a patch provided by ru@ and confirmed by ISC to fix a crash at
shutdown time when a SIG(0) key is being used.

13 years agoo The P1020(E) & P2020(E) also have two cores. This conditional has
marcel [Fri, 27 May 2011 23:18:41 +0000 (23:18 +0000)]
o   The P1020(E) & P2020(E) also have two cores. This conditional has
    a tendency to grow unwieldy so we may want to revisit this in due
    time.
o   Simplify the CPU reset function by writing to the reset control
    register irrespective of whether the CPU has one and automatically
    falling back to the debug control register if we didn't reset the
    CPU. The side-effect is that we now properly reset future processors
    without first having to add the system version to the list.

13 years agoWire the kernel using TLB1 entry 0 rather than entry 1. A more recent
marcel [Fri, 27 May 2011 23:09:12 +0000 (23:09 +0000)]
Wire the kernel using TLB1 entry 0 rather than entry 1. A more recent
U-Boot as found on the P1020RDB doesn't like it when we use entry 1
(for some reason) whereas an older U-Boot doesn't mind if we use entry
0. If anything else, this simplifies the code a bit.

13 years agofind: If a part of an expression is unknown, do not call it an option.
jilles [Fri, 27 May 2011 22:14:49 +0000 (22:14 +0000)]
find: If a part of an expression is unknown, do not call it an option.

Although most of the primaries and operators start with "-", they are not
options.

Examples:
  find . -xyz
  find . -name xyz -or bad

MFC after: 1 week

13 years agoFix the new NFS client so that it handles NFSv4 state
rmacklem [Fri, 27 May 2011 22:05:10 +0000 (22:05 +0000)]
Fix the new NFS client so that it handles NFSv4 state
correctly during a forced dismount. This required that
the exclusive and shared (refcnt) sleep lock functions check
for MNTK_UMOUNTF before sleeping, so that they won't block
while nfscl_umount() is getting rid of the state. As
such, a "struct mount *" argument was added to the locking
functions. I believe the only remaining case where a forced
dismount can get hung in the kernel is when a thread is
already attempting to do a TCP connect to a dead server
when the krpc client structure called nr_client is NULL.
This will only happen just after a "mount -u" with options
that force a new TCP connection is done, so it shouldn't
be a problem in practice.

MFC after: 2 weeks

13 years agosh: Remove the "exp" builtin.
jilles [Fri, 27 May 2011 20:53:07 +0000 (20:53 +0000)]
sh: Remove the "exp" builtin.

The "exp" builtin is undocumented, non-standard and not very useful.

If exp's return value is not used, something like
VAR=$(exp EXPRESSION)
is equivalent to
VAR=$((EXPRESSION))
except that errors in the expression are fatal and quoting special
characters is not needed in the latter case.

If exp's return value is used, something like
if exp EXPRESSION >/dev/null
can be replaced by
if [ $((EXPRESSION)) -ne 0 ]
with similar differences.

The exp-run showed that "let" is close enough to bash's and ksh's builtin
that removing it would break a few ports. Therefore, "let" remains in 9.x.

PR: bin/104432
Exp-run done by: pav (with some other sh(1) changes)

13 years agosh: Correct criterion for using CDPATH in cd.
jilles [Fri, 27 May 2011 20:01:46 +0000 (20:01 +0000)]
sh: Correct criterion for using CDPATH in cd.

CDPATH should be ignored not only for pathnames starting with '/' but also
for pathnames whose first component is '.' or '..'.

The man page already describes this behaviour.

13 years agoRemove definitions for RACCT_FSIZE and RACCT_SBSIZE - these two are rather
trasz [Fri, 27 May 2011 19:57:58 +0000 (19:57 +0000)]
Remove definitions for RACCT_FSIZE and RACCT_SBSIZE - these two are rather
performance-sensitive and not that useful, so I won't be merging them
before 9.0.

13 years agosh: Add simple CDPATH test.
jilles [Fri, 27 May 2011 19:36:07 +0000 (19:36 +0000)]
sh: Add simple CDPATH test.

13 years agoWhitespace fixes
kevlo [Fri, 27 May 2011 16:17:35 +0000 (16:17 +0000)]
Whitespace fixes

Reviewed by: jpaetzel

13 years agosh: Various updates to the TOUR document.
jilles [Fri, 27 May 2011 16:00:37 +0000 (16:00 +0000)]
sh: Various updates to the TOUR document.

13 years agosh: Fix unquoted $@/$* if IFS=''.
jilles [Fri, 27 May 2011 15:56:13 +0000 (15:56 +0000)]
sh: Fix unquoted $@/$* if IFS=''.

If IFS is null, unquoted $@/$* should still expand to separate words.
This differs from quoted $@ (which does not depend on IFS) in that pathname
generation is performed and empty words are removed.