]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoConstify "address" argument of ng_address_path().
fjoe [Sun, 6 Nov 2011 05:20:27 +0000 (05:20 +0000)]
Constify "address" argument of ng_address_path().

12 years agoWake up the page daemon in vm_page_alloc_freelist() if it couldn't
alc [Sun, 6 Nov 2011 02:03:27 +0000 (02:03 +0000)]
Wake up the page daemon in vm_page_alloc_freelist() if it couldn't
allocate the requested page because too few pages are cached or free.

Document the VM_ALLOC_COUNT() option to vm_page_alloc() and
vm_page_alloc_freelist().

Make style changes to vm_page_alloc() and vm_page_alloc_freelist(),
such as using a variable name that more closely corresponds to the
comments.

12 years agoImplement the sysctl's for fibre channel that are listed in the man page.
mjacob [Sun, 6 Nov 2011 00:44:40 +0000 (00:44 +0000)]
Implement the sysctl's for fibre channel that are listed in the man page.

MFC after: 3 days

12 years agofifo_misc test: Fix swapped lseek arguments.
jilles [Sat, 5 Nov 2011 22:33:19 +0000 (22:33 +0000)]
fifo_misc test: Fix swapped lseek arguments.

It worked regardless because SEEK_CUR happens to be 1.

12 years agolint: Fix lseek() argument order.
jilles [Sat, 5 Nov 2011 22:25:15 +0000 (22:25 +0000)]
lint: Fix lseek() argument order.

Because SEEK_SET is 0, this seems to have no effect on the generated code.

PR: bin/160806
Submitted by: Henning Petersen <henning dot petersen at t-online dot de>
Obtained from: NetBSD

12 years agosh(1): Improve documentation of field splitting.
jilles [Sat, 5 Nov 2011 21:56:45 +0000 (21:56 +0000)]
sh(1): Improve documentation of field splitting.

12 years agomake(1): obj dirs are physical paths so write `pwd -P` rather than `pwd`.
jilles [Sat, 5 Nov 2011 21:32:17 +0000 (21:32 +0000)]
make(1): obj dirs are physical paths so write `pwd -P` rather than `pwd`.

Regular pwd may return a pathname containing symlinks, but make does not use
such pathnames.

12 years agoMake it possible to set CC and CXX (and optionally, AS and LD) in
dim [Sat, 5 Nov 2011 21:16:39 +0000 (21:16 +0000)]
Make it possible to set CC and CXX (and optionally, AS and LD) in
make.conf(5), while allowing the build32 stage on 64-bit architectures
to still override them, so that stage can successfully build 32-bit
compatibility libraries.

Explanation:
1) The build32 stage sets environment variables CC, CXX, AS and LD for
   its sub-make, to add 32-bit specific flags (-m32 and such).
2) The sub-make reads sys.mk, encounters CC?= and CXX?= assignments, so
   does not alter them.
3) After some other stuff, sys.mk reads /etc/make.conf.  When you have
   "CC=xxx" and "CXX=yyy" statements in there, they will *override* the
   build32-supplied CC/CXX values, nullifying the 32-bit specific flags.
4) Thus all objects get built as 64-bit anyway, and since LD is usually
   not set in make.conf, it still has the 32-bit flags!
5) Now, whenever something is linked, you will get a "ld: Relocatable
   linking with relocations from format elf64-x86-64-freebsd (foo.o) to
   format elf32-i386-freebsd (bar.o) is not supported" error.

Fix this by adding "-ECC -ECXX -EAS -ELD" to the build32 sub-make
invocation, which forces those environment variables to always override
any assignment in makefiles.  Thus making it possible to simply set:

CC=my-cc
CXX=my-c++

in your make.conf, or specify a path, even:

CC=/usr/local/bin/other-cc
CXX=/usr/local/bin/other-c++

Note this was never a problem on i386, since it has no build32 stage.

Silence from: current@
MFC after: 1 week

12 years agoRoll up several patches used by PC-BSD.
jpaetzel [Sat, 5 Nov 2011 19:25:21 +0000 (19:25 +0000)]
Roll up several patches used by PC-BSD.

- Fix an issue with gmirror.
- Allow IPv4 DHCP and IPv6 SLAAC concurrently.
- Fix zpool options using the wrong device name.

Approved by: kib (mentor)
Obtained from: kris@pcbsd.org
MFC after: 3 days

12 years agogroup functions together by function...
jmg [Sat, 5 Nov 2011 17:55:49 +0000 (17:55 +0000)]
group functions together by function...

document knlist_delete, and better document what knlist_clear does...  Note
that both of these functions may sleep, and also unlock/relock the list
lock...

document knlist_init_mtx (forgotten by kib)...

other minor improvements

Reviewed by: ru (previous rev)
MFC after: 1 week

12 years agoWhenever you boot with nfsv4_server_enable=NO (the default) in rc.conf,
dim [Sat, 5 Nov 2011 16:47:47 +0000 (16:47 +0000)]
Whenever you boot with nfsv4_server_enable=NO (the default) in rc.conf,
the /etc/rc.d/nfsd script sets vfs.nfsd.server_max_nfsvers to 3.

Then, when you set nfsv4_server_enable=YES in rc.conf, and restart nfsd
via the rc.d script, without rebooting, the sysctl does *not* get reset
to max version 4, so NFSv4 still doesn't work.

Fix this by explicitly setting vfs.nfsd.server_max_nfsvers to 4 when
NFSv4 is requested.

I also added resetting of the nfs_privport sysctls, since this has the
same issue: nfs_reserved_port_only=YES in rc.conf sets the nfs_privport
sysctl to 1, but in the other case, the sysctl doesn't get reset to 0.

Reviewed by: rmacklem
Silence from: rc@
MFC after: 3 days

12 years agoCorrect typo in comment.
pjd [Sat, 5 Nov 2011 16:44:25 +0000 (16:44 +0000)]
Correct typo in comment.

Reported by: Fabian Keil <fk@fabiankeil.de>
MFC after: 3 days

12 years agoIn zvol_open() if the spa_namespace_lock is already held, it means that
pjd [Sat, 5 Nov 2011 16:29:03 +0000 (16:29 +0000)]
In zvol_open() if the spa_namespace_lock is already held, it means that
ZFS is trying to open and taste ZVOL as its VDEV. This is not supported,
so return an error instead of panicing on spa_namespace_lock recursion.

Reported by: Robert Millan <rmh@debian.org>
PR: kern/162008
MFC after: 3 days

12 years agoImplement support for modem control lines.
hselasky [Sat, 5 Nov 2011 12:01:51 +0000 (12:01 +0000)]
Implement support for modem control lines.
Don't short terminate transmitted BULK data.
Assume that the chip reads one USB packet at a time.

PR: usb/162307
MFC after: 3 days

12 years agoRemove an unused variable from pam_unix.
ed [Sat, 5 Nov 2011 10:00:29 +0000 (10:00 +0000)]
Remove an unused variable from pam_unix.

This variable was added in r82352 back in 2001, but even then it didn't
have any use. Because it's not marked static, the C compiler won't
complain about it.

Discussed with: des

12 years agoFix typo.
kib [Sat, 5 Nov 2011 09:04:13 +0000 (09:04 +0000)]
Fix typo.

MFC after: 3 days

12 years agoRemove redundand definitions. The chunk was missed from r227102.
kib [Sat, 5 Nov 2011 09:03:18 +0000 (09:03 +0000)]
Remove redundand definitions. The chunk was missed from r227102.

MFC after: 2 weeks

12 years agoProvide typedefs for the type of bit mask for the page bits.
kib [Sat, 5 Nov 2011 08:20:32 +0000 (08:20 +0000)]
Provide typedefs for the type of bit mask for the page bits.
Use the defined types instead of int when manipulating masks.
Supposedly, it could fix support for 32KB page size in the
machine-independend VM layer.

Reviewed by: alc
MFC after: 2 weeks

12 years agoAdd static keywords to variables and functions where possible in games/.
ed [Sat, 5 Nov 2011 07:18:53 +0000 (07:18 +0000)]
Add static keywords to variables and functions where possible in games/.

This allows us to detect unused functions and variables and allows the
compiler to do a better job at optimisation.

12 years agoImplement altq(4) support.
yongari [Fri, 4 Nov 2011 23:34:54 +0000 (23:34 +0000)]
Implement altq(4) support.
While I'm here fix a logic error in r227098 where it didn't
re-enable interrupts when TX queue is empty.

12 years agoBecause ti(4) drops a driver lock in RX handler, check whether
yongari [Fri, 4 Nov 2011 23:09:57 +0000 (23:09 +0000)]
Because ti(4) drops a driver lock in RX handler, check whether
driver is still running before re-enabling interrupts.

12 years agoDon't abuse if_hwassist and make sure enabling corresponding TX/RX
yongari [Fri, 4 Nov 2011 22:53:52 +0000 (22:53 +0000)]
Don't abuse if_hwassist and make sure enabling corresponding TX/RX
checksum offloading and VLAN hardware tag insertion/stripping from
the currently enabled hardware offloading capabilities.
Previously if_hwassist, which was initialized to TX/RX checksum
offloading, was blindly used to enable both TX and RX checksum
offloading such that disabling either TX or RX checksum offloading
was not possible.

ti(4) controllers support TX/RX checksum offloading with VLAN
tagging so announce TX/RX checksum offloading capability over VLAN
to vlan(4).

Make VLAN hardware tag insertion/stripping honors currently enabled
interface capability instead of blindly enabling VLAN hardware
tagging. This change allows disabling hardware support of VLAN tag.

Because ti(4) supports VLAN oversized frames, make network stack
know the capability by setting if_hdrlen.

While I'm here, rewrite SIOCSIFCAP handler and make sure to
reinitialize controller whenever TX/RX checksum offloading and VLAN
hardware tagging option is changed.  The requirement of controller
reinitialization comes from the limitation of Tigon I/II firmware.
Tigon I/II firmware requires all related RCBs should be
reinitialized whenever any of its hardware offloading capabilities
change.

vlan(4) is also notified whenever the parent interface's capability
changes such that it can correctly handle TX/RX checksum offloading
based on parent interface's enabled offloading capabilities.

RX checksum offloading handler was changed to make upper stack use
controller computed partial checksum value.  Previously, ti(4) just
set the computed value for any frames(IPv4, IPv6) and the value was
not used in upper stack because driver didn't set CSUM_DATA_VALID
such that upper network stack had to recompute checksum of TCP/UDP
packets. I have no idea how this was not noticed for a long time.
With this change, upper network stack does not have to fully
recompute the checksum such that calculating pseudo checksum based
on partial checksum is sufficient to know whether received packet's
checksum is correct or not. However, I don't know why ti(4) does
not have controller compute pseudo checksum as controller has
ability to do it. I'm just guessing enabling that feature could
trigger a firmware bug or could be slower than computing it on host
side so just leave it as it was.

In order not to produce false positives, ti(4) now checks whether
controller actually computed IP or TCP/UDP checksum by checking
ti_flags field.

12 years agoDon't clear upper 4bits from VLAN tag information. It's
yongari [Fri, 4 Nov 2011 21:42:13 +0000 (21:42 +0000)]
Don't clear upper 4bits from VLAN tag information.  It's
responsibility of vlan(4) to extract VLAN id from the tag
information and vlan(4) correctly handles it.

12 years agoIntroduce ti_ifmedia_upd_locked() to use in driver initialization
yongari [Fri, 4 Nov 2011 21:30:46 +0000 (21:30 +0000)]
Introduce ti_ifmedia_upd_locked() to use in driver initialization
and add missing driver lock for both ti_ifmedia_upd() and
ti_ifmedia_sts().

12 years agoAnnounce IFCAP_LINKSTATE capability and let network stack know link
yongari [Fri, 4 Nov 2011 20:43:37 +0000 (20:43 +0000)]
Announce IFCAP_LINKSTATE capability and let network stack know link
state changes.  Hide superfluous link up/down message under
bootverbose since if_link_state_change(9) shows that information.
While I'm here, change baudrate with the resolved speed of the
established link instead of blindly setting it 1G. Unfortunately,
it seems there is no way to differentiate 10/100Mbps from
non-gigabit link so just assume we established a 100Mbps link if
current link is not a gigabit link.

12 years agoMake sure to unload loaded DMA area(descriptor, command, event ring).
yongari [Fri, 4 Nov 2011 20:25:30 +0000 (20:25 +0000)]
Make sure to unload loaded DMA area(descriptor, command, event ring).

12 years agoFix a warning emitted by Clang.
ed [Fri, 4 Nov 2011 19:56:34 +0000 (19:56 +0000)]
Fix a warning emitted by Clang.

The size passed to strlcat() must depend on the input length, not the
output length. Because the input and output buffers are equal in size,
the resulting binary does not change at all.

12 years agos/u_intXX_t/uintXX_t/g
yongari [Fri, 4 Nov 2011 19:12:07 +0000 (19:12 +0000)]
s/u_intXX_t/uintXX_t/g

12 years agoMake ti(4) build with 'options TI_PRIVATE_JUMBOS'.
yongari [Fri, 4 Nov 2011 18:39:39 +0000 (18:39 +0000)]
Make ti(4) build with 'options TI_PRIVATE_JUMBOS'.
This was broken in r175872.

We have a UMA backed jumbo allocator and that is much better
implementation than having a local jumbo buffer allocator in
driver. This local allocator would be removed in near future but
fixing build before removal wouldn't be a bad idea.

12 years agostyle.
yongari [Fri, 4 Nov 2011 18:28:10 +0000 (18:28 +0000)]
style.
No functional changes.

12 years agoUse ANSI function definations.
yongari [Fri, 4 Nov 2011 17:07:53 +0000 (17:07 +0000)]
Use ANSI function definations.

12 years agoAlways use the opt_*.h options for ipfw.ko, not just when
bz [Fri, 4 Nov 2011 16:24:19 +0000 (16:24 +0000)]
Always use the opt_*.h options for ipfw.ko, not just when
compiled into the kernel.
Do not try to build the module in case of no INET support but
keep #error calls for now in case we would compile it into the
kernel.

This should fix an issue where the module would fail to enable
IPv6 support from the rc framework, but also other INET and INET6
parts being silently compiled out without giving a warning in the
module case.

While here garbage collect unneeded opt_*.h includes.
opt_ipdn.h is not used anywhere but we need to leave the DUMMYNET
entry in options for conditional inclusion in kernel so keep the
file with the same name.

Reported by: pluknet
Reviewed by: plunket, jhb
MFC After: 3 days

12 years agoSilence an (otherwise harmless) very recurrent warning when building the
rmh [Fri, 4 Nov 2011 15:34:31 +0000 (15:34 +0000)]
Silence an (otherwise harmless) very recurrent warning when building the
kernel of FreeBSD with a non-FreeBSD compiler.

Approved by: kib (mentor)

12 years agoAdd missing static keywords for global variables to tools in sbin/.
ed [Fri, 4 Nov 2011 13:36:02 +0000 (13:36 +0000)]
Add missing static keywords for global variables to tools in sbin/.

These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.

12 years agoCall the correct chipset power routine when disabling the AR5416 and later NICs.
adrian [Fri, 4 Nov 2011 13:32:13 +0000 (13:32 +0000)]
Call the correct chipset power routine when disabling the AR5416 and later NICs.

12 years agoFix for panic at USB controller attach failure during cold boot.
hselasky [Fri, 4 Nov 2011 09:19:18 +0000 (09:19 +0000)]
Fix for panic at USB controller attach failure during cold boot.

Reported by: Jan Henrik Sylvester, Xin LI and more.
MFC after: 3 days

12 years agoSimplify the implementation of the failure case in kmem_alloc_attr().
alc [Fri, 4 Nov 2011 04:41:58 +0000 (04:41 +0000)]
Simplify the implementation of the failure case in kmem_alloc_attr().

12 years agoRegen.
jhb [Fri, 4 Nov 2011 04:06:31 +0000 (04:06 +0000)]
Regen.

12 years agoAdd the posix_fadvise(2) system call. It is somewhat similar to
jhb [Fri, 4 Nov 2011 04:02:50 +0000 (04:02 +0000)]
Add the posix_fadvise(2) system call.  It is somewhat similar to
madvise(2) except that it operates on a file descriptor instead of a
memory region.  It is currently only supported on regular files.

Just as with madvise(2), the advice given to posix_fadvise(2) can be
divided into two types.  The first type provide hints about data access
patterns and are used in the file read and write routines to modify the
I/O flags passed down to VOP_READ() and VOP_WRITE().  These modes are
thus filesystem independent.  Note that to ease implementation (and
since this API is only advisory anyway), only a single non-normal
range is allowed per file descriptor.

The second type of hints are used to hint to the OS that data will or
will not be used.  These hints are implemented via a new VOP_ADVISE().
A default implementation is provided which does nothing for the WILLNEED
request and attempts to move any clean pages to the cache page queue for
the DONTNEED request.  This latter case required two other changes.
First, a new V_CLEANONLY flag was added to vinvalbuf().  This requests
vinvalbuf() to only flush clean buffers for the vnode from the buffer
cache and to not remove any backing pages from the vnode.  This is
used to ensure clean pages are not wired into the buffer cache before
attempting to move them to the cache page queue.  The second change adds
a new vm_object_page_cache() method.  This method is somewhat similar to
vm_object_page_remove() except that instead of freeing each page in the
specified range, it attempts to move clean pages to the cache queue if
possible.

To preserve the ABI of struct file, the f_cdevpriv pointer is now reused
in a union to point to the currently active advice region if one is
present for regular files.

Reviewed by: jilles, kib, arch@
Approved by: re (kib)
MFC after: 1 month

12 years agoMove the cleanup of f_cdevpriv when the reference count of a devfs
jhb [Fri, 4 Nov 2011 03:39:31 +0000 (03:39 +0000)]
Move the cleanup of f_cdevpriv when the reference count of a devfs
file descriptor drops to zero out of _fdrop() and into devfs_close_f()
as it is only relevant for devfs file descriptors.

Reviewed by: kib
MFC after: 1 week

12 years agoAdd QLogic 10 Gigabit Ethernet & CNA Adapter Driver version 1.30
bz [Thu, 3 Nov 2011 21:20:22 +0000 (21:20 +0000)]
Add QLogic 10 Gigabit Ethernet & CNA Adapter Driver version 1.30
for 3200 and 8200 series cards.

Submitted by: David C Somayajulu (david.somayajulu@qlogic.com),
Qlogic Corporation
MFC After: 3 days

12 years agoFix kernel panic when d_fdopen csw method is called for NULL fp.
kib [Thu, 3 Nov 2011 18:55:18 +0000 (18:55 +0000)]
Fix kernel panic when d_fdopen csw method is called for NULL fp.
This may happen when kernel consumer calls VOP_OPEN().

Reported by: Tavis Ormandy <taviso  cmpxchg8b com> through delphij
MFC after: 3 days

12 years agoFix a use-after-free/redzone issue in the routing code.
mlaier [Thu, 3 Nov 2011 18:33:30 +0000 (18:33 +0000)]
Fix a use-after-free/redzone issue in the routing code.

Reported by (repeatedly): Mike Tancsa
Prodded by (repeatedly): bz
Forgotten by (repeatedly): mlaier
MFC after: 2 weeks

12 years agoBoth a crash reported on freebsd-current on Oct. 18 under the
rmacklem [Thu, 3 Nov 2011 14:38:03 +0000 (14:38 +0000)]
Both a crash reported on freebsd-current on Oct. 18 under the
subject heading "mtx_lock() of destroyed mutex on NFS" and
PR# 156168 appear to be caused by clnt_dg_destroy() closing
down the socket prematurely. When to close down the socket
is controlled by a reference count (cs_refs), but clnt_dg_create()
checks for sb_upcall being non-NULL to decide if a new socket
is needed. I believe the crashes were caused by the following race:
  clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket
  clnt_dg_destroy() then loses race with clnt_dg_create() for
    acquisition of the SOCKBUF_LOCK()
  clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1
  clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to
    NULL and destroys socket

This patch fixes the above race by changing clnt_dg_destroy() so
that it acquires SOCKBUF_LOCK() before testing cs_refs.

Tested by: bz
PR: 156168
Reviewed by: dfr
MFC after: 2 weeks

12 years agoDisable interrupt and preemption for smp_rendezvous() also in the
attilio [Thu, 3 Nov 2011 14:36:56 +0000 (14:36 +0000)]
Disable interrupt and preemption for smp_rendezvous() also in the
UP/!SMP case.
The callbacks may be relying on this feature and having 2 different
ways to deal with them is not correct.

Reported by: rstone
Reviewed by: jhb
MFC after: 2 weeks

12 years agoRemove the remnants of /stand/sysinstall.
pluknet [Thu, 3 Nov 2011 12:03:03 +0000 (12:03 +0000)]
Remove the remnants of /stand/sysinstall.

loader.8: Sync the default init_path list with kern/init_main.c.

NOTES: Replace with /rescue/init in the INIT_PATH kernel option.

12 years agoRemove a couple of write-only variables.
pluknet [Thu, 3 Nov 2011 09:09:05 +0000 (09:09 +0000)]
Remove a couple of write-only variables.

12 years agoNote that pam_unix(8) does not respect PAM_CHANGE_EXPIRED_AUTHTOK.
des [Wed, 2 Nov 2011 23:40:21 +0000 (23:40 +0000)]
Note that pam_unix(8) does not respect PAM_CHANGE_EXPIRED_AUTHTOK.

12 years agoSprinkle some const.
marius [Wed, 2 Nov 2011 23:23:19 +0000 (23:23 +0000)]
Sprinkle some const.

12 years agoRemove variable initialized but no longer actually used since r226995.
marius [Wed, 2 Nov 2011 23:22:50 +0000 (23:22 +0000)]
Remove variable initialized but no longer actually used since r226995.

Found with: Coverity Prevent(tm)
CID: 10044

12 years agoRestore sysctl names for tcp_sendspace/tcp_recvspace.
pluknet [Wed, 2 Nov 2011 20:58:47 +0000 (20:58 +0000)]
Restore sysctl names for tcp_sendspace/tcp_recvspace.

They seem to be changed unintentionally in r226437, and there were no
any mentions of renaming in commit log message.

Reported by: Anton Yuzhaninov <citrin citrin ru>

12 years agoDisable the TX ready interrupts once we received one, some UART won't clear
cognet [Wed, 2 Nov 2011 20:45:44 +0000 (20:45 +0000)]
Disable the TX ready interrupts once we received one, some UART won't clear
the IIR_TXRDY bit upon reading.

Reviewed by: marcel

12 years agoDespite official i386 ABI does not mandate any stack alignment besides
kib [Wed, 2 Nov 2011 18:08:30 +0000 (18:08 +0000)]
Despite official i386 ABI does not mandate any stack alignment besides
the word alignment, some versions of gcc do require 16-byte alignment.
Make sure the stack is 16-byte aligned before calling a subroutine.

Inspired by: PR amd64/162214
MFC after: 1 week

12 years agoMake sure that stack is 16-byte aligned before calling a function,
kib [Wed, 2 Nov 2011 18:06:22 +0000 (18:06 +0000)]
Make sure that stack is 16-byte aligned before calling a function,
as it is required by amd64 ABI. Add a comment for the places were
the stack is accidentally properly aligned already.

PR: amd64/162214
Submitted by: yamayan <yamayan kbh biglobe ne jp>
MFC after: 1 week

12 years agoOpenBSD 5.0 added.
maxim [Wed, 2 Nov 2011 14:28:36 +0000 (14:28 +0000)]
OpenBSD 5.0 added.

12 years agoAdd mutex and two flags to make orphan() call properly asynchronous:
mav [Wed, 2 Nov 2011 09:24:59 +0000 (09:24 +0000)]
Add mutex and two flags to make orphan() call properly asynchronous:
 - delay consumer closing and detaching on orphan() until all I/Os complete;
 - prevent new I/Os submission after orphan() called.
Previous implementation could destroy consumers still having active
requests and worked only because of global workaround made on GEOM level.

12 years ago1. Add a new option, --run-updates, to always or never run the newalises,
dougb [Wed, 2 Nov 2011 07:40:23 +0000 (07:40 +0000)]
1. Add a new option, --run-updates, to always or never run the newalises,
   pwd_mkdb, etc. updates at the end of the comparison.

2. Add an update to the end to handle /etc/localtime, if it exists.
   If /var/db/zoneinfo exists, automatically update /etc/localtime,
   which should (hopefully) be safe to do. If not, prompt the user
   to run tzsetup.

3. Update run_it_now(), the function that handles input for the updates,
   to make sure that we got a valid answer, and to handle the --run-updates
   option if supplied.

12 years agoAdd support for VM_ALLOC_WIRED and VM_ALLOC_ZERO to vm_page_alloc_freelist()
alc [Wed, 2 Nov 2011 05:42:51 +0000 (05:42 +0000)]
Add support for VM_ALLOC_WIRED and VM_ALLOC_ZERO to vm_page_alloc_freelist()
and use these new options in the mips pmap.

Wake up the page daemon in vm_page_alloc_freelist() if the number of free
and cached pages becomes too low.

Tidy up vm_page_alloc_init().  In particular, add a comment about an
important restriction on its use.

Tested by: jchandra@

12 years agoIf the user is moving from any other time zone to UTC we need
dougb [Wed, 2 Nov 2011 04:21:20 +0000 (04:21 +0000)]
If the user is moving from any other time zone to UTC we need
to delete any old /var/db/zoneinfo file that may exist so that
tzsetup -r does the right thing.

12 years agoMake orphan() method in geom_dev asynchronous using destroy_dev_sched_cb()
mav [Tue, 1 Nov 2011 23:12:22 +0000 (23:12 +0000)]
Make orphan() method in geom_dev asynchronous using destroy_dev_sched_cb()
instead of destroy_dev(). It moves device destruction waiting out of the
topology lock and so fixes dead lock between orphanization and closing.
Real provider and geom destruction called from swi context after device
destroyed as callback of the destroy_dev_sched_cb().

12 years agoAdd a PCI front-end to esp(4) allowing it to support AMD Am53C974 and
marius [Tue, 1 Nov 2011 21:26:57 +0000 (21:26 +0000)]
Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 and
replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel
configuration files. Besides duplicating functionality, amd(4), which
previously also supported the AMD Am53C974, unlike esp(4) is no longer
maintained and has accumulated enough bit rot over time to always cause
a panic during boot as long as at least one target is attached to it
(see PR 124667).

PR: 124667
Obtained from: NetBSD (based on)
MFC after: 3 days

12 years agoRefactor disk disconnection and geom destruction handling sequences.
mav [Tue, 1 Nov 2011 20:56:19 +0000 (20:56 +0000)]
Refactor disk disconnection and geom destruction handling sequences.
Do not close/destroy opened consumer directly in case of disconnect. Instead
keep it existing until it will be closed in regular way in response to
upstream provider destruction. Delay geom destruction in the same way.
Previous implementation could destroy consumers still having active
requests and worked only because of global workaround made on GEOM level.

12 years agoIncrease the IOC port initialization timeouts by ten times to what the
marius [Tue, 1 Nov 2011 18:28:33 +0000 (18:28 +0000)]
Increase the IOC port initialization timeouts by ten times to what the
corresponding Linux driver uses. This allows mpt(4) to still recognize
all good SATA devices in presence of a defective one, which takes about
45 seconds.
In the long term we probably should implement the logic used by mpt2sas(4)
allowing IOC port initialization to complete at a later time.

Submitted by: Andrew Boyer
MFC after: 3 days

12 years agoIn r225931 I've missed the only other driver using the pointer returned
marius [Tue, 1 Nov 2011 17:57:21 +0000 (17:57 +0000)]
In r225931 I've missed the only other driver using the pointer returned
by rman_get_virtual(9) to access device registers sparc64 currently cares
about.
Ideally ata(4) should just be converted to access these using bus_space(9)
read/write functions instead as there's really no reason to do it the
former way. However, this part of ata-siliconimage.c should go away in
favor of siis(4) sooner or later anyway and I don't have the hardware to
actually test the SX4 bits of ata-promise.c.
Also ideally the other architectures should also properly handle the
BUS_SPACE_MAP_LINEAR flag of bus_space_map(9) so this code wouldn't need
to be #ifdef'ed.

12 years agoRefactor disk disconnection and geom destruction handling sequences.
mav [Tue, 1 Nov 2011 17:04:42 +0000 (17:04 +0000)]
Refactor disk disconnection and geom destruction handling sequences.
Do not close/destroy opened consumer directly in case of disconnect. Instead
keep it existing until it will be closed in regular way in response to
upstream provider destruction. Delay geom destruction in the same way.
Previous implementation could destroy consumers still having active
requests and worked only because of global workaround made on GEOM level.

12 years ago- Import the common MII bitbang'ing code from NetBSD and convert drivers to
marius [Tue, 1 Nov 2011 16:13:59 +0000 (16:13 +0000)]
- Import the common MII bitbang'ing code from NetBSD and convert drivers to
  take advantage of it instead of duplicating it. This reduces the size of
  the i386 GENERIC kernel by about 4k. The only potential in-tree user left
  unconverted is xe(4), which generally should be changed to use miibus(4)
  instead of implementing PHY handling on its own, as otherwise it makes not
  much sense to add a dependency on miibus(4)/mii_bitbang(4) to xe(4) just
  for the MII bitbang'ing code. The common MII bitbang'ing code also is
  useful in the embedded space for using GPIO pins to implement MII access.
- Based on lessons learnt with dc(4) (see r185750), add bus barriers to the
  MII bitbang read and write functions of the other drivers converted in
  order to ensure the intended ordering. Given that register access via an
  index register as well as register bank/window switching is subject to the
  same problem, also add bus barriers to the respective functions of smc(4),
  tl(4) and xl(4).
- Sprinkle some const.

Thanks to the following testers:
Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4))
Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4).

Reviewed by: yongari (subset of drivers)
Obtained from: NetBSD (partially)

12 years agoAdded missing cache purge of from argument for rename().
pho [Tue, 1 Nov 2011 12:33:06 +0000 (12:33 +0000)]
Added missing cache purge of from argument for rename().

Reported by: Anton Yuzhaninov <citrin citrin ru>
In collaboration with: kib
MFC after: 1 week

12 years agoTwo bugs fixed:
fabient [Tue, 1 Nov 2011 09:28:47 +0000 (09:28 +0000)]
Two bugs fixed:
- Do not close stdout or stderr when redirecting to file.
- Correctly handle error code to detect when no buffer available.

MFC after: 1 month

12 years agoWorkaround the problem introduced by combination of r162200 and r215687.
mav [Tue, 1 Nov 2011 08:57:49 +0000 (08:57 +0000)]
Workaround the problem introduced by combination of r162200 and r215687.
r162200 delays provider orphanization until all running requests complete,
to workaround broken orphan() method implementation in some classes.
r215687 removes persistent periodic (10Hz) event thread wake ups.
Together these changes can indefinitely delay orphanization until some
other event wake up the event thread. One consequence of this is inability
of CAM to destroy device disconnected when busy and, as consequence, create
new one after reconnection.

While the best solution would be to revert r162200, it is not easy, as
some classes still look broken in that way. Instead conditionally wake up
event thread if there are some providers waiting for orphanization.

MFC after: 1 week

12 years agoMFV of r226974, tzdata2011n
edwin [Tue, 1 Nov 2011 02:01:55 +0000 (02:01 +0000)]
MFV of r226974, tzdata2011n

- Fiji will end DST on 22 January 2012.
- Moldova split into two timezones has been cancelled.
- Cuba will end DST on 13 November 2011

Obtained from: ftp://ftp.iana.org/tz/releases/

12 years agoFix the wrong commit log message for r226967: "Added missing cache purge
pho [Mon, 31 Oct 2011 20:24:33 +0000 (20:24 +0000)]
Fix the wrong commit log message for r226967: "Added missing cache purge
of from argument" and fix the comment.

12 years agoThe kern_renameat() looks up the fvp using the DELETE flag, which causes
pho [Mon, 31 Oct 2011 15:01:47 +0000 (15:01 +0000)]
The kern_renameat() looks up the fvp using the DELETE flag, which causes
the removal of the name cache entry for fvp.

Reported by: Anton Yuzhaninov <citrin citrin ru>
In collaboration with: kib
MFC after: 1 week

12 years agoAdd information about MD_READONLY and MD_COMPRESS flags to the
ae [Mon, 31 Oct 2011 10:53:27 +0000 (10:53 +0000)]
Add information about MD_READONLY and MD_COMPRESS flags to the
configuration dump.

MFC after: 1 week

12 years agoPut some static keywords in the source code.
ed [Mon, 31 Oct 2011 08:59:17 +0000 (08:59 +0000)]
Put some static keywords in the source code.

For these simple utilities, it doesn't harm to make all global variables
static. In fact, this allows the compiler to perform better forms of
optimisation and analysis.

12 years agoPull in r143305 and r143312 from upstream clang trunk, so using "clang
dim [Sun, 30 Oct 2011 22:20:17 +0000 (22:20 +0000)]
Pull in r143305 and r143312 from upstream clang trunk, so using "clang
-march=native" on AMD K10 family processors no longer errors out with
"unknown target CPU 'amdfam10'".  This also enables use of SSE4A.

Reported by: David Marec <david.marec@davenulle.org>
MFC after: 3 days

12 years agoAdd multiple inclusion protection.
marius [Sun, 30 Oct 2011 21:45:36 +0000 (21:45 +0000)]
Add multiple inclusion protection.

12 years agoActually, limit to 32-bit DMA for the transfer buffers as the address is
marius [Sun, 30 Oct 2011 21:42:35 +0000 (21:42 +0000)]
Actually, limit to 32-bit DMA for the transfer buffers as the address is
written into a 32-bit register.

12 years agoCorrect the DMA constraints, the LSI64854 isn't limited to 32-bit DMA.
marius [Sun, 30 Oct 2011 21:19:13 +0000 (21:19 +0000)]
Correct the DMA constraints, the LSI64854 isn't limited to 32-bit DMA.

12 years ago- Use device_t rather than the NetBSDish struct device.
marius [Sun, 30 Oct 2011 21:17:42 +0000 (21:17 +0000)]
- Use device_t rather than the NetBSDish struct device.
- Move esp_devclass to ncr53c9x.c in order to allow different bus front-ends
  to use it.
- Use KOBJMETHOD_END.
- Remove the gl_clear_latched_intr hook as it's not needed for any of the
  chips nor the front-ends supported in FreeBSD and likely never will be.
- Correct the DMA constraints used in the SBus front-end, the LSI64854 isn't
  limited to 32-bit DMA.
- The ESP200 also only supports up to 64k transfers.
- Don't let the DMA and SBus front-end supply a maximum transfer size larger
  than MAXPHYS as that's the maximum the upper layers use and we otherwise
  just waste resources unnecessarily.
- Initialize the ECB callout and don't zero the handle when returning ECBs
  to the free list so that ncr53c9x_callout() actually is called with the
  driver lock held.
- On detach the driver lock should be held across cam_sim_free() according
  to isp(4) and a panic received.
- Check the return value of NCRDMA_SETUP(), i.e. bus_dmamap_load(9), and try
  to handle failures gracefully.
- In ncr53c9x_action() replace N calls to xpt_done() in a switch with just
  one at the end.
- On XPT_PATH_INQ report "NCR" rather than "Sun" as the vendor as the former
  is somewhat more correct as well as the maximum supported transfer size via
  maxio in order to take advantage of controllers that that can handle more
  than DFLTPHYS.
- Print the number of MESSAGE (EXTENDED) rejected.
- Fix the path encoded in the multiple inclusion protection of ncr53c9xvar.h.
- Correct the DMA constraints used in the LSI64854 core to not exceed the
  maximum supported transfer size and include the boundary so we don't need
  to check on every setup of a DMA transfer.
- Let the bus DMA map callbacks do nothing in case of an error.
- Correctly handle > 64k transfers for FAS366 in the LSI64854. A new feature
  flag NCR_F_LARGEXFER was introduced so we just need to check for this one
  and not for individual controllers supporting large transfers in several
  places.
- Let the LSI64854 core load transfer buffers using BUS_DMA_NOWAIT as the
  NCR53C9x core can't handle EINPROGRESS. Due to lack of bounce buffers
  support, sparc64 doesn't actually use EINPROGRESS and likely never will,
  as an example for writing additional front-ends for the NCR53C9x core it
  makes sense to set BUS_DMA_NOWAIT anyway though.
- Some minor cleanup.

12 years agoFix typo from r226927
dougb [Sun, 30 Oct 2011 20:55:32 +0000 (20:55 +0000)]
Fix typo from r226927

Submitted by: scf

12 years agoFix a few gratuitous library dependencies. Some of the ZFS utilities
rmh [Sun, 30 Oct 2011 16:29:04 +0000 (16:29 +0000)]
Fix a few gratuitous library dependencies.  Some of the ZFS utilities
are linked with libraries they don't use:

 - zinject doesn't use libavl
 - ztest doesn't use libz
 - zdb uses neither libavl nor libz
 - zfs uses neither libbsdxml nor libm, nor libsbuf
 - zpool uses neither libbsdxml nor libm, nor libsbuf

In addition, libzfs needs libm because it uses pow(), however it isn't
linked with -lm.  This went unnoticed because all its users had -lm before.

Reviewed by: pjd, mm
Approved by: kib (mentor)
MFC after: 1 week

12 years agoFor processes with no controlling terminal, display "-" in the TTY column
trasz [Sun, 30 Oct 2011 15:21:27 +0000 (15:21 +0000)]
For processes with no controlling terminal, display "-" in the TTY column
instead of "?".

Submitted by: arundel

12 years agoAdd missing PF_UNLOCK in pf_test
kevlo [Sun, 30 Oct 2011 14:55:00 +0000 (14:55 +0000)]
Add missing PF_UNLOCK in pf_test

Reviewed by: bz

12 years agoFix a misplaced parenthesis.
brueffer [Sun, 30 Oct 2011 12:33:19 +0000 (12:33 +0000)]
Fix a misplaced parenthesis.

PR: 162164
Submitted by: Henning Petersen <henning.petersen@t-online.de>
MFC after: 1 week

12 years agoEliminate vm_phys_bootstrap_alloc(). It was a failed attempt at
alc [Sun, 30 Oct 2011 05:06:14 +0000 (05:06 +0000)]
Eliminate vm_phys_bootstrap_alloc().  It was a failed attempt at
eliminating duplicated code in the various pmap implementations.

Micro-optimize vm_phys_free_pages().

Introduce vm_phys_free_contig().  It is fast routine for freeing an
arbitrary number of physically contiguous pages.  In particular, it
doesn't require the number of pages to be a power of two.

Use "u_long" instead of "unsigned long".

Bruce Evans (bde@) has convinced me that the "boundary" parameters
to kmem_alloc_contig(), vm_phys_alloc_contig(), and
vm_reserv_reclaim_contig() should be of type "vm_paddr_t" and not
"u_long".  Make this change.

12 years agoAdd birth date for Ken Thompson
dougb [Sun, 30 Oct 2011 04:04:40 +0000 (04:04 +0000)]
Add birth date for Ken Thompson
Add birth and death dates for Steve Jobs
Update birth and add death date for Dennis Ritchie

PR: bin/162157
Submitted by: Niclas Zeising <niclas.zeising@gmail.com>

12 years agoRevert rev. 226893: subr_syscall.c is being included from C files and
marcel [Sun, 30 Oct 2011 02:19:39 +0000 (02:19 +0000)]
Revert rev. 226893: subr_syscall.c is being included from C files and
on amd64 with FREEBSD32 enabled, this means that systrace_probe_func
gets defined twice.

12 years agoAdd a reminder about quarterly status report due dates
dougb [Sat, 29 Oct 2011 18:16:29 +0000 (18:16 +0000)]
Add a reminder about quarterly status report due dates

Reviewed by: danger

12 years agoremove trailing whitespace...
jmg [Sat, 29 Oct 2011 17:30:57 +0000 (17:30 +0000)]
remove trailing whitespace...

MFC after: 1 week

12 years agoerror if /boot/mbr is empty... This can happen on a system like arm
jmg [Sat, 29 Oct 2011 17:28:59 +0000 (17:28 +0000)]
error if /boot/mbr is empty...  This can happen on a system like arm
that doesn't have a /boot/mbr, and you touch it to get past the previous
error message...

MFC after: 1 week

12 years agoImprove USB mass storage quirk auto detection.
hselasky [Sat, 29 Oct 2011 12:32:13 +0000 (12:32 +0000)]
Improve USB mass storage quirk auto detection.

MFC after: 3 days

12 years agoAdd some new ath(4) debugging bits, from my if_ath_tx 11n TX branch.
adrian [Sat, 29 Oct 2011 07:17:47 +0000 (07:17 +0000)]
Add some new ath(4) debugging bits, from my if_ath_tx 11n TX branch.

12 years agoFix the text and attribution of the poem "Youth" by Samuel Ullman.
dougb [Sat, 29 Oct 2011 06:33:12 +0000 (06:33 +0000)]
Fix the text and attribution of the poem "Youth" by Samuel Ullman.

Our copy was a bastardization of the "older" (probably original?) and
shorter version of the poem; and the "newer" version that is better
known, and arguably more popular. Standardize on the latter.

Cf. http://www.bartleby.com/73/2099.html

12 years agoFix an implicit dependency between the MFI driver and CAM that had grown due
scottl [Sat, 29 Oct 2011 06:26:49 +0000 (06:26 +0000)]
Fix an implicit dependency between the MFI driver and CAM that had grown due
to an API change in CAM.  It's once again possible to link a static kernel
with 'mfi' without requiring 'scbus' as well.  Ditto for KLD loading.

Submitted by: kib
Reviewed by: ken
MFC after: 3 days

12 years agoReword '}' description to sound more clear.
ache [Sat, 29 Oct 2011 06:13:47 +0000 (06:13 +0000)]
Reword '}' description to sound more clear.

Submitted by:   dougb
MFC after:      7 days

12 years agoDefine systrace_probe_func in subr_syscall.c where it's used, instead
marcel [Sat, 29 Oct 2011 01:26:36 +0000 (01:26 +0000)]
Define systrace_probe_func in subr_syscall.c where it's used, instead
of defining it in MD code. This eliminates porting to other architectures.

12 years agosh: Add test for exit status of for loop without items.
jilles [Fri, 28 Oct 2011 23:02:21 +0000 (23:02 +0000)]
sh: Add test for exit status of for loop without items.

POSIX says the exit status of a for loop without any items shall be 0. There
are no exceptions if the exit status of the previous command was not 0 or if
the item list contains a command substitution with non-zero exit status.

12 years agoUse "u_long" instead of "unsigned long".
alc [Fri, 28 Oct 2011 22:36:15 +0000 (22:36 +0000)]
Use "u_long" instead of "unsigned long".

12 years agoUpdate '}' description to reflect reality (and POSIX)
ache [Fri, 28 Oct 2011 20:28:13 +0000 (20:28 +0000)]
Update '}' description to reflect reality (and POSIX)

PR:             96236
Submitted by:   "Andreas Kohn" <andreas@syndrom23.de>
MFC after:      7 days

12 years agoAdd a few improvements to utf-8 -> cp436 console map
rmh [Fri, 28 Oct 2011 20:00:30 +0000 (20:00 +0000)]
Add a few improvements to utf-8 -> cp436 console map
(mostly with Catalan characters in mind, but it probably
benefits other languages).

The new mappings are as follows:

▮ -> █
ÀÈÍÏÓÒÚ -> AEIIOOU
ŀ / Ŀ -> l / L

Reviewed by: ed
Approved by: kib (mentor)