21 hours agoFix the igb(4) redirection table to correctly populate. master github/master
adrian [Wed, 23 Jul 2014 05:40:28 +0000 (05:40 +0000)]
Fix the igb(4) redirection table to correctly populate.

This is similar to the ixgbe(4) fix.


* Intel I350 gigabit adapter

22 hours agoEmulate instructions emitted by OpenBSD/i386 version 5.5:
neel [Wed, 23 Jul 2014 04:28:51 +0000 (04:28 +0000)]
Emulate instructions emitted by OpenBSD/i386 version 5.5:
- CMP REG, r/m
- MOV AX/EAX/RAX, moffset
- MOV moffset, AX/EAX/RAX
- PUSH r/m

27 hours agoAvoid possible cast degradation.
pfg [Tue, 22 Jul 2014 23:29:54 +0000 (23:29 +0000)]
Avoid possible cast degradation.

For consistency with r268985 for fputs.c, assign iov_len
first, avoiding the cast to uio_resid (int in stdio)
from degrading the value.

We currently don't support lengths higher than INT_MAX so
this change is little more than cosmetic.

MFC after: 3 days

27 hours agoAdd example script `', demonstrating how to install
dteske [Tue, 22 Jul 2014 23:10:12 +0000 (23:10 +0000)]
Add example script `', demonstrating how to install
a list of packages using the bsdconfig(8) API, providing dialog(8) based
user experience (versus plain console output were you to use pkg(8)
directly to install the same list of packages).

Remove example script `', made obsolete because
the digests.txz and packagesite.txz databases for pkg(8) are not
available via FTP (HTTP only to SRV hosts).

Update example script `', made to work with new
pkg(8) demonstrating how to generate a local package repository.

Fix a bug in `bsdconfig packages' where packages were listed twice. This
fix requires pkg(8) version 1.2.7_4 or higher.

NB: It is the introduction of pkg(8) 1.2.7_4 wherein I am also able to
drastically reduce the generation time of package dependencies prior to
the dialog display (by utilizing the new `-I' flag to pkg-rquery(8)).

While here, fix a positional argument nit for f_index_initialize() of
`packages/index.subr' include (the one and only argument is positional
argument 1 to state the by-ref handle, indicating the variable to set
in the caller's namespace; the nit I'm fixing here is that we were
querying positional argument 2 for this information incorrectly; caused
by a missing hunk back around SVN r257795).

Fix a bug in sysrc(8) described by PR bin/187458 "sysrc(8) silently and
unexpectedly bootstraps pkg". This was caused by an explicit entry in
`/usr/share/bsdconfig/common.subr' (used by sysrc(8)) that called pkg(8)
to populate the $PKG_ABI global (called in a way that allows implicit
bootstrap of pkg(8)). The solution to which was to find every place in
bsdconfig(8) that requires the $PKG_ABI global and add a layer of
protection by way of introducing the new API call f_musthavepkg_init()
(provided by new include, `/usr/share/bsdconfig/packages/musthavepkg.subr'
intented to mirror `/usr/share/bsdconfig/mustberoot.subr'). When the
$PKG_ABI global is required, you can use `f_musthavepkg_init' to cause
graceful premature termination in the event that pkg(8) has not yet been
bootstrapped, and thus cannot be used to populate $PKG_ABI.

NB: If running interactively ($nonInteractive is NULL or unset), the
f_musthavepkg_init() API call will attempt to bootstrap pkg(8), but only
if the user chooses "Yes" to a Yes/No dialog confirming it is ok to

While here, simplify an if-conditional in `media/http.subr' include to
use sh(1) inline assignment-with-break.

Also, fix a bug in `media/http.subr' and `media/httpproxy.subr' wherein
the error messages for various HTTP failures were not finding their way
to the console (needed to pass stdout to pass-thru descriptor).

While here, remove the executable bit from `packages/categories.subr',
`packages/index.subr', and `packages/packages.subr' includes.

Fix issues where pkg(8) complains about PACKAGESITE being defined.
Previously, we would set $PACKAGESITE and export it. Now we only set
$PACKAGESITE for invocations of "pkg update" -- getting rid of all the
spurious warnings about PACKAGESITE being deprecated (it's still used
in the case of "pkg update" for simplicity versus having to configure
a config-file).

Remove the leading argument from invocations of f_index_initialize() in
`packages/packages.subr' include. The leading argument no longer means
what it used to, pre SVN r257995).

PR: bin/187458
Reviewed by: nwhitehorn
MFC after: 1 week
X-MFC-to: stable/10, stable/9

27 hours ago/usr/bin/sendbug and the sendbug(1) man page were part of send-pr and
gavin [Tue, 22 Jul 2014 22:57:26 +0000 (22:57 +0000)]
/usr/bin/sendbug and the sendbug(1) man page were part of send-pr and
are no longer installed since r267486.  Add them to ObsoleteFiles.inc1,
which should have been done in r267486.

PR: 192010
Submitted by: Vick Khera
Pointyhat to: gavin
MFC after: 3 days

27 hours agoFor "a"-mode files and rewind/fseek + fwrite combination return meaningful
ache [Tue, 22 Jul 2014 22:49:37 +0000 (22:49 +0000)]
For "a"-mode files and rewind/fseek + fwrite combination return meaningful
value now, like Apple does, but avoid their __sflush physical write
performance degradation as much as possible.

28 hours agoRe-sort synopsis, add includes.
pluknet [Tue, 22 Jul 2014 22:39:59 +0000 (22:39 +0000)]
Re-sort synopsis, add includes.

28 hours agos/PCBGROUPS/PCBGROUP/ manpage to match "options PCBGROUP".
pluknet [Tue, 22 Jul 2014 22:16:23 +0000 (22:16 +0000)]
s/PCBGROUPS/PCBGROUP/ manpage to match "options PCBGROUP".

29 hours agoAdd FreeBSD to the list of environments that needs to handle R_ARM_TARGET2
ian [Tue, 22 Jul 2014 20:49:58 +0000 (20:49 +0000)]
Add FreeBSD to the list of environments that needs to handle R_ARM_TARGET2
relocations in unwind data as pc-relative indirect references.

MFC after: 1 week

30 hours agoFix EABI unwind function declarations to match the function definitions.
ian [Tue, 22 Jul 2014 20:32:24 +0000 (20:32 +0000)]
Fix EABI unwind function declarations to match the function definitions.
The mismatch was noticed by clang, when using it to compile the in-tree
gcc and libstdc++.

30 hours agoBack the whole change out until I figure out how to obtain O_APPEND,
ache [Tue, 22 Jul 2014 20:13:46 +0000 (20:13 +0000)]
Back the whole change out until I figure out how to obtain O_APPEND,
it can't be used in this field at all.

30 hours agoChecking for __SAPP alone is not enough because it is emulated O_APPEND
ache [Tue, 22 Jul 2014 19:55:25 +0000 (19:55 +0000)]
Checking for __SAPP alone is not enough because it is emulated O_APPEND
only, so works for only special fdopen() case. Add real O_APPEND too.

30 hours agoCleanup the definition of two structures which are
tuexen [Tue, 22 Jul 2014 19:54:22 +0000 (19:54 +0000)]
Cleanup the definition of two structures which are
exposed to userland. Therefore no MFC.

30 hours agoAdd missing newline to an error message.
np [Tue, 22 Jul 2014 19:48:21 +0000 (19:48 +0000)]
Add missing newline to an error message.

MFC after: 3 days

31 hours agoGrammar and spelling fixes.
pluknet [Tue, 22 Jul 2014 19:37:38 +0000 (19:37 +0000)]
Grammar and spelling fixes.

32 hours agoRevert r268984:
pfg [Tue, 22 Jul 2014 18:37:59 +0000 (18:37 +0000)]
Revert r268984:
Check for __SAPP flag before calling sflush.   This avoids
performance degradation compared to the previous approach.

Submitted by: ache
MFC after: 2 weeks

33 hours agoIn r264504, we prevented doing I/O for more than MAXPHYS by making
marcel [Tue, 22 Jul 2014 17:30:05 +0000 (17:30 +0000)]
In r264504, we prevented doing I/O for more than MAXPHYS by making
the assumption that consumers would respect bio_completed and/or
bio_resid to detect short reads. This assumption proved false and
file corruption was the result.
Create as many bios as we need to satisfy the original request.
Check the cached chunk every time we need to do I/O to increase the
hit rate.

Obtained from: junipre Networks, Inc.
MFC after: 1 week

34 hours agoMostly cosmetic cleanups.
pfg [Tue, 22 Jul 2014 16:39:11 +0000 (16:39 +0000)]
Mostly cosmetic cleanups.

In fputs() avoid implcit casting on iov.iov_len.

MFC after: 3 days

34 hours agoftello: return 1 when seeking offset on an append stream.
pfg [Tue, 22 Jul 2014 16:19:01 +0000 (16:19 +0000)]
ftello: return 1 when seeking offset on an append stream.

Obtained from: Apple Inc. (Libc 997.90.3)
Phabric: D442
MFC after: 2 weeks

34 hours agorewind: always clear error indicator.
pfg [Tue, 22 Jul 2014 16:10:56 +0000 (16:10 +0000)]
rewind: always clear error indicator.

Required by POSIX:

Obtained from: Apple Inc. (Libc 997.90.3)
MFC after: 1 week

36 hours agoDon't pass null kmdp to preload_search_info
emaste [Tue, 22 Jul 2014 13:58:33 +0000 (13:58 +0000)]
Don't pass null kmdp to preload_search_info

On Xen PVH guests kmdp == NULL.

Submitted by: royger
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

41 hours agoRemove #ifdef-s to reduce difference to upstream.
ray [Tue, 22 Jul 2014 08:52:49 +0000 (08:52 +0000)]
Remove #ifdef-s to reduce difference to upstream.

Pointed by: kib

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

42 hours agoCorrect typo introduced with r268855.
delphij [Tue, 22 Jul 2014 08:37:01 +0000 (08:37 +0000)]
Correct typo introduced with r268855.

MFC after: 10 days
X-MFC with: r268855

44 hours agoDon't save entropy inside jails.
delphij [Tue, 22 Jul 2014 06:40:27 +0000 (06:40 +0000)]
Don't save entropy inside jails.

As of r126744, we no longer feed the entropy device in jails upon
start, and collecting them is no longer useful.

PR: conf/126744
Submitted by: Eugene Grosbein <eugen grosbein net> (with minor changes)
MFC after: 1 week
Approved by: so (des)

45 hours agocopyin/copyout should return 0 if they are truly emulating copyin/copyout behavior.
sbruno [Tue, 22 Jul 2014 04:47:19 +0000 (04:47 +0000)]
copyin/copyout should return 0 if they are truly emulating copyin/copyout behavior.

remove stray %s in printf

rewrite printf to display 64bit type without warning.

46 hours agoEnable Freescale i.MX I2C driver for i.MX6.
br [Tue, 22 Jul 2014 04:39:32 +0000 (04:39 +0000)]
Enable Freescale i.MX I2C driver for i.MX6.

46 hours agoRemove boot1.efi during clean target.
sbruno [Tue, 22 Jul 2014 04:38:28 +0000 (04:38 +0000)]
Remove boot1.efi during clean target.

46 hours agoSupress clang warning for FreeBSD printf %b and %D formats
sbruno [Tue, 22 Jul 2014 04:37:47 +0000 (04:37 +0000)]
Supress clang warning for FreeBSD printf %b and %D formats

MFC after: 2 weeks

46 hours agoRename i.MX I2C driver file.
br [Tue, 22 Jul 2014 03:59:14 +0000 (03:59 +0000)]
Rename i.MX I2C driver file.

2 days agoSimplify r267600, there's no need to distinguish between allocated and
np [Tue, 22 Jul 2014 02:02:39 +0000 (02:02 +0000)]
Simplify r267600, there's no need to distinguish between allocated and
inlined mbufs.

MFC after: 1 week

2 days does not add OBJS etc to CLEANFILES so does not automatically
sjg [Tue, 22 Jul 2014 00:42:55 +0000 (00:42 +0000)] does not add OBJS etc to CLEANFILES so does not automatically
get them flagged as .NOPATH.  This hurts people who don't use obj dirs.
Since its clean target seprate rm's for things, use NOPATH_FILES as list
to collect things that need .NOPATH. will add CLEANFILES to NOPATH_FILES and do the deed if needed.

Reviewed by: sbruno

2 days agoMerge serf-1.3.6
peter [Mon, 21 Jul 2014 22:10:29 +0000 (22:10 +0000)]
Merge serf-1.3.6
+  Revert r2319 from serf 1.3.5: this change was making serf call handle_response
+    multiple times in case of an error response, leading to unexpected behavior.

2 days agoRun mtree for BSD.tests.dist during make xdev-install, if the tests are
dim [Mon, 21 Jul 2014 21:26:10 +0000 (21:26 +0000)]
Run mtree for BSD.tests.dist during make xdev-install, if the tests are
enabled (which they are in the default configuration).  Otherwise, it
will fail because ${XDDESTDIR}/usr/include/atf-c does not exist.

MFC after: 3 days

2 days agoMerge change from upstream linux kernel submitted by OpenBSD:
sbruno [Mon, 21 Jul 2014 19:33:08 +0000 (19:33 +0000)]
Merge change from upstream linux kernel submitted by OpenBSD:

drm/radeon: fix-up some float to fixed conversion thinkos

Spotted by Brad Smith when porting to OpenBSD.
Noticed-by: Brad Smith <>
Signed-off-by: Alex Deucher <>

Remove #ifdef DUMBBELL_WIP in favor of upstream fix.

Reviewed by: dumbbell, jkim
MFC after: 2 weeks

2 days agoRemove redundant return statement after errx
emaste [Mon, 21 Jul 2014 17:43:37 +0000 (17:43 +0000)]
Remove redundant return statement after errx

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 days agoUse the standard way of printing the usage string
emaste [Mon, 21 Jul 2014 17:18:00 +0000 (17:18 +0000)]
Use the standard way of printing the usage string

Sponsored by: The FreeBSD Foundation

2 days agoHide syscons-specific workaround under DEV_SC
emaste [Mon, 21 Jul 2014 16:38:05 +0000 (16:38 +0000)]
Hide syscons-specific workaround under DEV_SC

This change is a bit ugly, but so is the coupling between the i915
driver and syscons.  It isn't worth developing a more elegant solution
only to support the legacy syscons console.

2 days agoFix hdestroy() compliance issue.
pfg [Mon, 21 Jul 2014 15:44:59 +0000 (15:44 +0000)]
Fix hdestroy() compliance issue.

The hcreate(3) implementation and related functions we inherited
from NetBSD used to free() the key value, something that is not
supported by the standard implementation.

This would cause a segmentation fault when attempting to run
the examples from the opengroup and linux manpages.  NetBSD
has added non-standard calls to provide the previous
behaviour but hdestroy is not very commonly used so at this
time it seems excessive to bring those to FreeBSD.

Bump the __FreeBSD_version as this is an ABI change.


MFC after: 2 weeks

2 days agoUpdate license.
pfg [Mon, 21 Jul 2014 15:26:52 +0000 (15:26 +0000)]
Update license.

NetBSD has removed the advertisement clause from this file.

Obtained from: NetBSD (CVS rev. 1,8)

2 days agoAdd re-entrant versions of the hash functions based on the GNU api.
pfg [Mon, 21 Jul 2014 15:22:48 +0000 (15:22 +0000)]
Add re-entrant versions of the hash functions based on the GNU api.

While testing this I found a conformance issue in hdestroy()
that will be fixed in a subsequent commit.

Obtained from: NetBSD (hcreate.c, CVS Rev. 1.7)

2 days agoFixed fallout from previous change.
pluknet [Mon, 21 Jul 2014 08:47:54 +0000 (08:47 +0000)]
Fixed fallout from previous change.

2 days ago[mdoc] cleanup
pluknet [Mon, 21 Jul 2014 08:42:35 +0000 (08:42 +0000)]
[mdoc] cleanup

2 days agoAdd the PCBGROUPS manpage.
adrian [Mon, 21 Jul 2014 04:48:02 +0000 (04:48 +0000)]
Add the PCBGROUPS manpage.

Thanks to wblock for helping me with this manpage.

3 days agoCorrect spelling errors in ctld.8. While here, correct similar errors
wblock [Sun, 20 Jul 2014 22:13:51 +0000 (22:13 +0000)]
Correct spelling errors in ctld.8.  While here, correct similar errors
in ctl.conf.5 and fix a couple of contractions.

PR: 191984
Submitted by: olgeni
MFC after: 1 week

3 days agoAdjust errno on failed prepwrite.
pfg [Sun, 20 Jul 2014 21:24:29 +0000 (21:24 +0000)]
Adjust errno on failed prepwrite.

Obtained from: Apple Inc. (Libc 997.90.3)
Phabric: D442
MFC after: 1 week

3 days agoAdd new device ID.
hselasky [Sun, 20 Jul 2014 21:02:35 +0000 (21:02 +0000)]
Add new device ID.

MFC after: 1 week
PR: 191959

3 days agoConst-ify a character string.
pfg [Sun, 20 Jul 2014 20:29:28 +0000 (20:29 +0000)]
Const-ify a character string.

Obtained from: Apple Inc. (Libc 997.90.3)
MFC after: 3 days

3 days agosh: Allow arbitrarily large numbers in break and continue.
jilles [Sun, 20 Jul 2014 20:29:09 +0000 (20:29 +0000)]
sh: Allow arbitrarily large numbers in break and continue.

The argument is capped to loopnest, so strtol()'s [ERANGE] can be ignored.

3 days agoUse a correct errno in freopen.
pfg [Sun, 20 Jul 2014 20:14:15 +0000 (20:14 +0000)]
Use a correct errno in freopen.

Use EBADF instead of EINVAL when working around incorrect O_ACCMODE.

Phabric: D442
Obtained from: Apple Inc. (Libc 997.90.3)
Reviewed by: jilles
MFC after: 1 week

3 days agoIn "procstat -v" (VM), spell out 'FL' to 'FLAG' since there are two extra
rwatson [Sun, 20 Jul 2014 20:11:34 +0000 (20:11 +0000)]
In "procstat -v" (VM), spell out 'FL' to 'FLAG' since there are two extra
columns available anyway.  Also left align as we tend to do for flags
fields, although you can't see that currently as the string fully fills
that available columns.

MFC after: 3 days
Sponsored by: DARPA, AFRL

3 days agoUpdate fflush(3) to return success on a read-only stream.
pfg [Sun, 20 Jul 2014 20:05:39 +0000 (20:05 +0000)]
Update fflush(3) to return success on a read-only stream.

This has small changes to what Apple uses for compliance
with SUSv3. The changes cause no secondary effects in the
gnulib tests (we pass them).

Obtained from: Apple Inc. (Libc 997.90.3 with changes)
Reviewed by: bde
Phabric: D440

3 days agoFix the build when DTrace isn't enabled.
markj [Sun, 20 Jul 2014 18:44:56 +0000 (18:44 +0000)]
Fix the build when DTrace isn't enabled.

Reported by: stefanf
X-MFC-With: r268600

3 days agoFix build without INVARIANTS defined by getting rid of unused variable 'exc'.
neel [Sun, 20 Jul 2014 16:34:35 +0000 (16:34 +0000)]
Fix build without INVARIANTS defined by getting rid of unused variable 'exc'.

Reported by: adrian, stefanf

3 days agoOlder versions of flex (like the one used in FreeBSD <= 9) expect the
des [Sun, 20 Jul 2014 14:49:24 +0000 (14:49 +0000)]
Older versions of flex (like the one used in FreeBSD <= 9) expect the
output file name to follow the -o flag immediately, with no intervening

Reported by: ian@
MFC after: 1 week

3 days agosh: Remove prefix() function. Use strncmp() instead.
jilles [Sun, 20 Jul 2014 12:06:52 +0000 (12:06 +0000)]
sh: Remove prefix() function. Use strncmp() instead.

3 days agoAdd the UDP hash -> RSS mbuf hash type for the ixgbe(4) driver.
adrian [Sun, 20 Jul 2014 08:43:53 +0000 (08:43 +0000)]
Add the UDP hash -> RSS mbuf hash type for the ixgbe(4) driver.

3 days agoTeach ixgbe(4) about rss_gethashconfig().
adrian [Sun, 20 Jul 2014 07:45:48 +0000 (07:45 +0000)]
Teach ixgbe(4) about rss_gethashconfig().

If RSS is enabled, ixgbe(4) will query the RSS API for the types of hashes
which should be used.  It'll then only enable hashes that are exposed via
the RSS layer.

This way it won't try to do things like enable UDP hashing if RSS explicitly
states that it isn't supported in lookups.


* 82599EB ixgbe(4) NIC

3 days agoDisable the ixgbe(4) UDP 4-tuple hashing for the time being.
adrian [Sun, 20 Jul 2014 07:43:41 +0000 (07:43 +0000)]
Disable the ixgbe(4) UDP 4-tuple hashing for the time being.

A mix of fragmented and non-fragmented UDP in a single stream will end up
being hashed differently, resulting in out-of-order behaviour in the receive

This was done in the linux e1000 driver in 2011.

Discussed with: jfv

3 days agoWhen it's time to do 4-tuple UDP IPv6 hashing, make sure this is a known
adrian [Sun, 20 Jul 2014 07:39:54 +0000 (07:39 +0000)]
When it's time to do 4-tuple UDP IPv6 hashing, make sure this is a known

3 days agoMake the PCBGROUPS code aware of IPv4 UDP 4-tuple.
adrian [Sun, 20 Jul 2014 07:38:38 +0000 (07:38 +0000)]
Make the PCBGROUPS code aware of IPv4 UDP 4-tuple.

3 days agoAdd hash awareness of the IPv4 and IPv6 UDP 4-tuple.
adrian [Sun, 20 Jul 2014 07:37:47 +0000 (07:37 +0000)]
Add hash awareness of the IPv4 and IPv6 UDP 4-tuple.

Note: it would be nice if the supported hash check would be used here!

3 days agoImplement rss_gethashconfig() - return the currently supported hash methods
adrian [Sun, 20 Jul 2014 07:36:59 +0000 (07:36 +0000)]
Implement rss_gethashconfig() - return the currently supported hash methods
by the stack.

Right now the stack isn't really setup for RSS with 4-tuple UDP hashing
for either IPv4 and IPv6.

The specifics:

* The UDP init path udp_init() and udplite_init() specify the hash as
  2-tuple, so the PCBGROUPS code only tries a 2-tuple check;
* The PCBGROUPS and RSS code doesn't know about the UDP hash types
  just yet, so they're never treated as valid hashes.
* For correctness, 4-tuple can't be enabled in the general case because
  UDP datagrams can be more fragmented than IP datagrams may be.

Strictly speaking, TCP datagrams may also be fragmented and this could
cause issues with PCBGROUPS/RSS until the IP defragment path grows some
code to re-calculate the RSS hash.

I'll follow this commit up with awareness of the UDP 4-tuple for those
who wish to configure it, but for now it'll stay disabled.

No drivers (yet) know to use this function when RSS is enabled.

3 days agoUpdate the comment to be more concise.
adrian [Sun, 20 Jul 2014 07:31:55 +0000 (07:31 +0000)]
Update the comment to be more concise.

3 days agoCorrectly program the RSS redirection table entries.
adrian [Sun, 20 Jul 2014 04:11:18 +0000 (04:11 +0000)]
Correctly program the RSS redirection table entries.

Without this, the RSS bucket assignments aren't correct - they're
DCBA instead of ABCD in each DWORD.

Tested: 82599EB ixgbe(4), TCP and UDP RSS

4 days agoFix allocation of 128MB extended memory region, broken since some careless
nwhitehorn [Sun, 20 Jul 2014 00:08:50 +0000 (00:08 +0000)]
Fix allocation of 128MB extended memory region, broken since some careless
modifications in December.

MFC after: 3 days

4 days agoEnable X11 via xf86-video-scfb on the Playstation 3. This commit made from
nwhitehorn [Sat, 19 Jul 2014 23:39:17 +0000 (23:39 +0000)]
Enable X11 via xf86-video-scfb on the Playstation 3. This commit made from
an xterm running for the first time on said Playstation.

4 days agoAdd dl_unwind_find_exidx() for ARM EABI, required for C++ exception
ian [Sat, 19 Jul 2014 22:13:27 +0000 (22:13 +0000)]
Add dl_unwind_find_exidx() for ARM EABI, required for C++ exception
handling.  For statically linked apps this uses the __exidx_start/end
symbols set up by the linker.  For dynamically linked apps it finds the
shared object that contains the given address and returns the location and
size of the exidx section in that shared object.

The dl_unwind_find_exidx() name is used by other BSD projects and Android,
and is mentioned in clang 3.5 comments as "the BSD interface" for finding
exidx data.  GCC (in libgcc_s) expects the exact same API and functionality
to be provided by a function named __gnu_Unwind_Find_exidx(), so we provide
that with an alias ("strong reference").

Reviewed by: kib@
MFC after: 1 week

4 days agoAdd support for the "account" facility.
des [Sat, 19 Jul 2014 21:04:21 +0000 (21:04 +0000)]
Add support for the "account" facility.

PR: 115164
MFC after: 1 week

4 days agoHandle nested exceptions in bhyve.
neel [Sat, 19 Jul 2014 20:59:08 +0000 (20:59 +0000)]
Handle nested exceptions in bhyve.

A nested exception condition arises when a second exception is triggered while
delivering the first exception. Most nested exceptions can be handled serially
but some are converted into a double fault. If an exception is generated during
delivery of a double fault then the virtual machine shuts down as a result of
a triple fault.

vm_exit_intinfo() is used to record that a VM-exit happened while an event was
being delivered through the IDT. If an exception is triggered while handling
the VM-exit it will be treated like a nested exception.

vm_entry_intinfo() is used by processor-specific code to get the event to be
injected into the guest on the next VM-entry. This function is responsible for
deciding the disposition of nested exceptions.

4 days agoCheck if the specified group is the user's primary group before
des [Sat, 19 Jul 2014 20:55:13 +0000 (20:55 +0000)]
Check if the specified group is the user's primary group before
iterating over the (possibly empty) list of members.  Otherwise, we
get a false negative when the target group has no members listed in
/etc/group.  This went mostly unnoticed because root is explicitly
listed as a member of wheel, so the bug is never triggered in the most
common use case, which is su(8).

PR: 109416
MFC after: 1 week

4 days agoClean up the libunbound build to avoid accidentally regenerating the
des [Sat, 19 Jul 2014 18:38:48 +0000 (18:38 +0000)]
Clean up the libunbound build to avoid accidentally regenerating the
configuration lexer and parser during buildworld.  Instead of being
included in the source as it is in the upstream distribution, the code is
now always generated (in ${.OBJDIR}) at build time.

PR: 190739
MFC after: 1 week

4 days agoAllow mappings of memory not previously direct-mapped by the kernel when
nwhitehorn [Sat, 19 Jul 2014 15:11:58 +0000 (15:11 +0000)]
Allow mappings of memory not previously direct-mapped by the kernel when
calling mmap on /dev/mem and add a handler for the possible userland
machine checks that may result. Remove some pointless and wrong copy/paste
that has been in here for a decade as well.

This results in a /dev/mem with identical semantics to the x86 version.

MFC after: 1 week

4 days agoBetter align headers and data for 'procstat -f' with and without '-C'.
rwatson [Sat, 19 Jul 2014 15:09:53 +0000 (15:09 +0000)]
Better align headers and data for 'procstat -f' with and without '-C'.

MFC after: 3 days
Sponsored by: DARPA, AFRL

4 days agoClean r268867.
pfg [Sat, 19 Jul 2014 14:34:06 +0000 (14:34 +0000)]
Clean r268867.

Proposed by: bde

4 days agoUse -o (output to file) instead of -t (print to stdout) and a redirect.
des [Sat, 19 Jul 2014 14:26:04 +0000 (14:26 +0000)]
Use -o (output to file) instead of -t (print to stdout) and a redirect.

MFC after: 1 week

4 days agoMerge libucl 20140718 (fixes a bug in the parser)
bapt [Sat, 19 Jul 2014 14:10:31 +0000 (14:10 +0000)]
Merge libucl 20140718 (fixes a bug in the parser)

4 days agoImport libucl 20140718 (fixes a bug in the parser)
bapt [Sat, 19 Jul 2014 14:07:49 +0000 (14:07 +0000)]
Import libucl 20140718 (fixes a bug in the parser)

4 days agosh: Deduplicate some code in ulimit builtin.
jilles [Sat, 19 Jul 2014 14:06:23 +0000 (14:06 +0000)]
sh: Deduplicate some code in ulimit builtin.

5 days agoUse a C wrapper for trap() instead of checking and calling the DTrace trap
markj [Sat, 19 Jul 2014 02:27:31 +0000 (02:27 +0000)]
Use a C wrapper for trap() instead of checking and calling the DTrace trap
hook in assembly.

Suggested by: kib
Reviewed by: kib (original version)
X-MFC-With: r268600

5 days agoUse unsigned optlen in getsourcefilter()
pfg [Sat, 19 Jul 2014 01:53:52 +0000 (01:53 +0000)]
Use unsigned optlen in getsourcefilter()

Sizes can not be negative and the functions that use it
expect an unsigned value anyways.

Obtained from: Apple (Libc-997.90.3)
MFC after: 1 week

5 days agor243637 changed the default number of nfsd threads created,
rmacklem [Sat, 19 Jul 2014 01:15:01 +0000 (01:15 +0000)]
r243637 changed the default number of nfsd threads created,
but the man page did not reflect this.
This is a content change.

Reported by: bde
MFC after: 2 weeks

5 days agoReduce lock contention on the z_teardown_lock under heavily cached
delphij [Sat, 19 Jul 2014 00:26:03 +0000 (00:26 +0000)]
Reduce lock contention on the z_teardown_lock under heavily cached
read workload by splitting the single teardown rrw lock into
RRM_NUM_LOCKS (17) of them.

Read acquisitions are randomly distributed among these locks based
on curthread pointer.  Write acquisitions are going to all the
locks, which for the usage of this type of lock should be rare.

Illumos issue:
    5008 lock contention (rrw_exit) while running a read only load

MFC after: 2 weeks

5 days agoDocument the need to regenerate the local_unbound configuration.
des [Sat, 19 Jul 2014 00:11:51 +0000 (00:11 +0000)]
Document the need to regenerate the local_unbound configuration.

5 days agoOops, forgot to bump manual date/copyright in r268860.
dteske [Fri, 18 Jul 2014 23:23:52 +0000 (23:23 +0000)]
Oops, forgot to bump manual date/copyright in r268860.

MFC after: 3 days
X-MFC-to: stable/10, stable/9, ports
X-MFC-with: r268860

5 days agoAdd to obsolete libraries since it has been bumped to .so.7
bapt [Fri, 18 Jul 2014 23:04:27 +0000 (23:04 +0000)]
Add to obsolete libraries since it has been bumped to .so.7

5 days agoImprove timeout(1) man page
bapt [Fri, 18 Jul 2014 22:56:59 +0000 (22:56 +0000)]
Improve timeout(1) man page

Document the exit values and the duration format
Improve wording
Pet mandoc -Tlint

Reviewed by: wblock

5 days agoMinor enhancements, bug fixes, and man-page adjustments.
dteske [Fri, 18 Jul 2014 22:44:15 +0000 (22:44 +0000)]
Minor enhancements, bug fixes, and man-page adjustments.

+ Make `sysrc -x foo' produce error status if foo is unset.
NB: Reported by lme (everything else ``while I'm at it'')
+ Remove mention of SYSRC_VERBOSE from `sysrc --help' output.
NB: False documentation leftover from an ancient precursor.
+ Make `sysrc -qc foo' work the same as `sysrc -ic foo' when foo is unset
NB: For syntax convenience (my fingers know `-q' more than `-i').
+ Update description of `-c' flag in help message/manual.
+ Update description of `-q' flag in help message/manual.
+ Make `sysrc -vc foo' work as documented in the manual
NB: Show message stating whether foo is currently set.
+ Make `sysrc -vc foo=1' work as documented in the manual
NB: Show message stating how value of foo would be changed (if at all).
+ Remove odd usage of parentheses in `-R dir' section of manual.
+ Clarify syntax section of manual w/respect to sysctl(8) similarities.
+ Add new/missing people to the `THANKS TO' section of the manual.

Reported by: lme
MFC after: 3 days
X-MFC-to: stable/10, stable/9, ports

5 days agoMFV r268851:
delphij [Fri, 18 Jul 2014 22:34:01 +0000 (22:34 +0000)]
MFV r268851:

When a sync task is waiting for a txg to complete, we should hurry it along
by increasing the number of outstanding async writes (i.e. make
vdev_queue_max_async_writes() return a larger number).

Illumos issue:
    4753 increase number of outstanding async writes when sync task is waiting

MFC after: 2 weeks

5 days agoMFV r268850:
delphij [Fri, 18 Jul 2014 22:04:21 +0000 (22:04 +0000)]
MFV r268850:

Change the interaction between the DMU and ARC so that when the DMU is
shutting down an objset, we do not evict the data from the ARC.  Instead
we simply coordinate the destruction of the DMU's data with the ARC.

The only case where we actually need to explicitly evict from the ARC is
when dbuf_rele_and_unlock() determines that the administrator has requested
that it not be kept in memory, via the primarycache/secondarycache properties.
In this case, we evict the data from the ARC by its blkptr_t, the same way
as when a block is freed we explicitly evict it from the ARC.

Illumos issue:
    4631 zvol_get_stats triggering too many reads

MFC after: 2 weeks

5 days agottyname(3): Fix EBADF/ENOTTY error descriptions.
jilles [Fri, 18 Jul 2014 21:29:59 +0000 (21:29 +0000)]
ttyname(3): Fix EBADF/ENOTTY error descriptions.

Also, make sure to document the return values and errors for all three
functions in the man page.

PR: 191931
MFC after: 1 week

5 days agoFix build by using the driver API (driver converted in r266979 which should
delphij [Fri, 18 Jul 2014 21:28:59 +0000 (21:28 +0000)]
Fix build by using the driver API (driver converted in r266979 which should
be upstreamed).

X-MFC with: r268854
MFC after: 5 days

5 days agoMFV r268848:
delphij [Fri, 18 Jul 2014 20:41:40 +0000 (20:41 +0000)]
MFV r268848:

Instead of asserting all zio's be properly aligned, only assert
on the logical ones.

Cap uberblocks at 8k, otherwise with ashift=17, there would be
only one uberblock.

This fixes a problem that zdb would trip assert on pools with
ashift >= 0xe (8k).

While there, also change the code so it only attempt to condense
space map unless the uncondensed size consumes greater than
zfs_metaslab_condense_block_threshold blocks.

Illumos issue:
  4958 zdb trips assert on pools with ashift >= 0xe

MFC after: 2 weeks

5 days agoInitiate error recovery stats fail to update after 3 retries.
davidcs [Fri, 18 Jul 2014 20:04:11 +0000 (20:04 +0000)]
Initiate error recovery stats fail to update after 3 retries.
Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to
panic only if ECORE_STOP_ON_ERROR is defined.

MFC after:5 days

5 days agoThe description is a bit misleading. Trying to make it more obvious.
hiren [Fri, 18 Jul 2014 16:25:35 +0000 (16:25 +0000)]
The description is a bit misleading. Trying to make it more obvious.

Reviewed by: gnn

5 days agoRevert r268826:
pfg [Fri, 18 Jul 2014 16:21:15 +0000 (16:21 +0000)]
Revert r268826:
The current ordering of this header is a feature as it
is more consistent with POSIX.
Also adding gratuitous newlines is not elegant.

Pointed out by: bde

5 days agoRemove obsolete man pages. The corresponding code was removed in r255608.
alc [Fri, 18 Jul 2014 15:39:07 +0000 (15:39 +0000)]
Remove obsolete man pages.  The corresponding code was removed in r255608.

5 days agoUse assignment instead of bcopy.
glebius [Fri, 18 Jul 2014 14:59:35 +0000 (14:59 +0000)]
Use assignment instead of bcopy.

Submitted by: jmg

5 days agoExtend kqueue's EVFILT_TIMER by adding precision unit flags support
bapt [Fri, 18 Jul 2014 14:27:04 +0000 (14:27 +0000)]
Extend kqueue's EVFILT_TIMER by adding precision unit flags support

Define the precision macros as bits sets to conform with XNU equivalent.
Test fflags passed for EVFILT_TIMER and return EINVAL in case an invalid flag
is passed.

Reviewed by: kib

5 days agoFix two typos in iscsictl.8
gavin [Fri, 18 Jul 2014 12:51:35 +0000 (12:51 +0000)]
Fix two typos in iscsictl.8

PR: 191581
Submitted by: Jimmy Olgeni
MFC after: 3 days

5 days agoUse a combination of unblock-lan-zones (r268839) and domain-insecure
des [Fri, 18 Jul 2014 12:33:22 +0000 (12:33 +0000)]
Use a combination of unblock-lan-zones (r268839) and domain-insecure
to fix reverse lookups on networks using private addresses.