]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoRemove the distinction between strings and numbers from ctld(8) yacc parser.
trasz [Tue, 28 Oct 2014 10:25:59 +0000 (10:25 +0000)]
Remove the distinction between strings and numbers from ctld(8) yacc parser.
This fixes problems with passing strings that look like numbers to clauses
that expect strings; previously it caused syntax errors and had to be worked
by user, using quotes.  The workaround introduced in r267833 is no longer
neccessary.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoReported by: Coverity
araujo [Tue, 28 Oct 2014 07:19:02 +0000 (07:19 +0000)]
Reported by: Coverity
CID: 1249760
Reviewed by: neel
Approved by: neel
Sponsored by: QNAP Systems Inc.

9 years agoSimplify sys_getloginclass.
mjg [Tue, 28 Oct 2014 04:59:33 +0000 (04:59 +0000)]
Simplify sys_getloginclass.

Just use current thread credentials as they have the same accuracy as the
ones obtained from proc..

9 years agoChange loginclass mutex to an rwlock.
mjg [Tue, 28 Oct 2014 04:33:57 +0000 (04:33 +0000)]
Change loginclass mutex to an rwlock.

While here reduce nesting in loginclass_free.

Submitted by: Tiwei Bie <btw mail.ustc.edu.cn>
X-Additional: JuniorJobs project
MFC after: 2 weeks

9 years agoAllow loading of dtraceall without nfscl if what you really wnat is nfsclient
julian [Tue, 28 Oct 2014 04:18:09 +0000 (04:18 +0000)]
Allow loading of dtraceall without nfscl if what you really wnat is nfsclient

Obtained from: Panzura tree
MFC after: 1 week

9 years agoDrop __DECONST as well as few fixes of style(9).
araujo [Tue, 28 Oct 2014 03:42:09 +0000 (03:42 +0000)]
Drop __DECONST as well as few fixes of style(9).

Phabric: D1012
Suggested by: mjg, jhb
Reviewed by: mjg, jhb
Sponsored by: QNAP Systems Inc.

9 years agoFix prototypes.
kevlo [Tue, 28 Oct 2014 02:05:57 +0000 (02:05 +0000)]
Fix prototypes.

9 years agoAdd CAPABILITIES and CAPABILITY_MODE to powerpc GENERIC64, missed with the addition to
jhibbits [Tue, 28 Oct 2014 01:34:01 +0000 (01:34 +0000)]
Add CAPABILITIES and CAPABILITY_MODE to powerpc GENERIC64, missed with the addition to
GENERIC

MFC after: 3 weeks

9 years agoonly install .pc files when we are not installing 32bit compat libs...
jmg [Mon, 27 Oct 2014 23:43:25 +0000 (23:43 +0000)]
only install .pc files when we are not installing 32bit compat libs...

This fixes the problem of installing the .pc files multiple times...

9 years agoRename XFLAGS to XCFLAGS and XXFLAGS to XCXXFLAGS
bapt [Mon, 27 Oct 2014 23:31:07 +0000 (23:31 +0000)]
Rename XFLAGS to XCFLAGS and XXFLAGS to XCXXFLAGS

This is less confusing names and actually more reflexting what they are intended
to.

Discussed with: brooks

9 years agoUse pkg-1.4-style platform identifiers based on MACHINE_ARCH (e.g.
nwhitehorn [Mon, 27 Oct 2014 23:19:51 +0000 (23:19 +0000)]
Use pkg-1.4-style platform identifiers based on MACHINE_ARCH (e.g.
FreeBSD:11:amd64 instead of freebsd:11:x86:64) when bootstrapping pkg.
Thanks to portmgr for providing symlinks so both styles work.

Reviewed by: bapt
MFC after: 3 weeks

9 years agoiwcm_event status needs to be populated for close_complete_upcall
np [Mon, 27 Oct 2014 23:11:48 +0000 (23:11 +0000)]
iwcm_event status needs to be populated for close_complete_upcall

Submitted by: Hariprasad at Chelsio dot com
Sponsored by: Chelsio Communications

9 years agofix typo, properly install a link to nv for nvlist_freev...
jmg [Mon, 27 Oct 2014 23:03:17 +0000 (23:03 +0000)]
fix typo, properly install a link to nv for nvlist_freev...

9 years agokrping: In verbose mode print only first 128 bytes of krping data.
np [Mon, 27 Oct 2014 22:41:55 +0000 (22:41 +0000)]
krping: In verbose mode print only first 128 bytes of krping data.

Submitted by: Hariprasad at Chelsio dot com.
Sponsored by: Chelsio Communications

9 years agoSome cxgbe/iw_cxgbe fixes:
np [Mon, 27 Oct 2014 22:22:46 +0000 (22:22 +0000)]
Some cxgbe/iw_cxgbe fixes:
- Free rt in c4iw_connect only if it is allocated.
- Call soclose instead of so_shutdown if there is an abort from the peer.
- Close socket and return failure if TOE is not enabled.

Submitted by: Hariprasad at Chelsio dot com
Sponsored by: Chelsio Communications

9 years agoRemove bhyve SVM feature printf's now that they are available in the
grehan [Mon, 27 Oct 2014 22:20:51 +0000 (22:20 +0000)]
Remove bhyve SVM feature printf's now that they are available in the
general CPU feature detection code.

Reviewed by: neel

9 years agoOutput a summary of optional SVM features in dmesg similar to CPU features.
grehan [Mon, 27 Oct 2014 22:02:35 +0000 (22:02 +0000)]
Output a summary of optional SVM features in dmesg similar to CPU features.
If bootverbose is enabled, a detailed list is provided; otherwise, a
single-line summary is displayed.

Differential Revision: https://reviews.freebsd.org/D1008
Reviewed by: jhb, neel
MFC after: 1 week

9 years agoRemove an extra copy of hv_kvp_daemon(8) [1].
delphij [Mon, 27 Oct 2014 21:29:42 +0000 (21:29 +0000)]
Remove an extra copy of hv_kvp_daemon(8) [1].

While I'm there also correct typos in OptionalObsoleteFiles and add
information of the command line options for hv_kvp_daemon(8).

Reported by: jmg [1]
Reviewed by: jmg
MFC after: 2 weeks

9 years agoTidy up functions related to uidinfo management.
mjg [Mon, 27 Oct 2014 20:20:05 +0000 (20:20 +0000)]
Tidy up functions related to uidinfo management.

- reference found uidinfo in uilookup
- reduce nesting by handling shorter cases first

9 years agoDe-k&r-ify function definitions in kern/kern_resource.c
mjg [Mon, 27 Oct 2014 20:18:30 +0000 (20:18 +0000)]
De-k&r-ify function definitions in kern/kern_resource.c

No functional changes.

9 years agoAdd foo_genassym.c files to DPSRCS so dependencies for them are generated.
jhb [Mon, 27 Oct 2014 18:37:11 +0000 (18:37 +0000)]
Add foo_genassym.c files to DPSRCS so dependencies for them are generated.
This ensures these objects are rebuilt to generate an updated header of
assembly constants if needed.

9 years agobin/dd: revert 273734, as it fails on 32bit platforms
pi [Mon, 27 Oct 2014 17:39:37 +0000 (17:39 +0000)]
bin/dd: revert 273734, as it fails on 32bit platforms

Revert: insufficient testing on 32bit platforms

PR: 191263

9 years agoDo not automatically install routes to link-local and interface-local multicast
ae [Mon, 27 Oct 2014 16:15:15 +0000 (16:15 +0000)]
Do not automatically install routes to link-local and interface-local multicast
addresses.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

9 years agoTiny comment fixup.
glebius [Mon, 27 Oct 2014 16:13:51 +0000 (16:13 +0000)]
Tiny comment fixup.

9 years agoPreserve limitation of "TCP_CA_NAME_MAX" when matching the algorithm
hselasky [Mon, 27 Oct 2014 16:08:41 +0000 (16:08 +0000)]
Preserve limitation of "TCP_CA_NAME_MAX" when matching the algorithm
name.

MFC after: 3 days
Suggested by: gnn @

9 years agoFix rendering
bapt [Mon, 27 Oct 2014 15:50:47 +0000 (15:50 +0000)]
Fix rendering

Submitted by: brueffer

9 years agoCorrect a typo: this is the manpage for pthread_cleanup_pop, not push.
jhb [Mon, 27 Oct 2014 15:45:37 +0000 (15:45 +0000)]
Correct a typo: this is the manpage for pthread_cleanup_pop, not push.

Submitted by: ian

9 years agoClarify the documentation of pmcstat:
bapt [Mon, 27 Oct 2014 15:33:44 +0000 (15:33 +0000)]
Clarify the documentation of pmcstat:
the -d argument should be passed before -p, -s, -P or -S to be taken in account

Differential Revision: https://reviews.freebsd.org/D1011
Reviewed by: adrian, gnn
MFC after: 1 week

9 years agobin/dd: Fix incorrect casting of arguments
pi [Mon, 27 Oct 2014 11:38:17 +0000 (11:38 +0000)]
bin/dd: Fix incorrect casting of arguments

dd(1) casts many of its numeric arguments from uintmax_t to intmax_t
and back again to detect whether or not the original arguments were
negative. This caused wrong behaviour in some boundary cases:

$ dd if=/dev/zero of=/dev/null count=18446744073709551615
dd: count cannot be negative

After the fix:

$ dd if=/dev/zero of=/dev/null count=18446744073709551615
dd: count: Result too large

PR: 191263
Submitted by: will@worrbase.com
Approved by: cognet@

9 years agoMake assignments to "net.inet.tcp.cc.algorithm" work by fixing a bad
hselasky [Mon, 27 Oct 2014 11:21:47 +0000 (11:21 +0000)]
Make assignments to "net.inet.tcp.cc.algorithm" work by fixing a bad
string comparison.

MFC after: 3 days
Reported by: Jukka Ukkonen <jau789@gmail.com>
Sponsored by: Mellanox Technologies

9 years agoRemove unused function.
ae [Mon, 27 Oct 2014 10:34:09 +0000 (10:34 +0000)]
Remove unused function.

Sponsored by: Yandex LLC

9 years agoRemove comment obsoleted by r273730.
mav [Mon, 27 Oct 2014 09:30:57 +0000 (09:30 +0000)]
Remove comment obsoleted by r273730.

MFC after: 1 week

9 years agoReduce code duplication around Write Exclusive persistent reservation.
mav [Mon, 27 Oct 2014 09:26:24 +0000 (09:26 +0000)]
Reduce code duplication around Write Exclusive persistent reservation.

While there, allow some more commands to pass persistent reservation.

MFC after: 1 week

9 years agoAdd a method to iicbus to request IIC_M_NOSTOP behaviour for multibyte
kib [Mon, 27 Oct 2014 07:51:26 +0000 (07:51 +0000)]
Add a method to iicbus to request IIC_M_NOSTOP behaviour for multibyte
transfers to be default.  It simplifies porting code which assumes
such settings.

Discussed with: avg, llos, nwhitehorn
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoAllow the vfs.nfsd knobs to be set from loader.conf (or using
kib [Mon, 27 Oct 2014 07:47:13 +0000 (07:47 +0000)]
Allow the vfs.nfsd knobs to be set from loader.conf (or using
kenv(8)).  This is useful when nfsd is loaded as module.

Reviewed by: rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoMerge of 273518, tzdata2014i
edwin [Mon, 27 Oct 2014 05:50:02 +0000 (05:50 +0000)]
Merge of 273518, tzdata2014i

Upgrade to 2014i

Lots of historical data

Pacific/Fiji will go into DST from 2014-11-02 to 2015-01-18
Pacific/Bougainville will go from UTC+10 to UTC+11.
Europe/Minsk will go from FET to MSK.

9 years agogetgrouplist(3) was reimplemented in terms of getgrent_r(3) in r174547, so
markj [Mon, 27 Oct 2014 04:09:23 +0000 (04:09 +0000)]
getgrouplist(3) was reimplemented in terms of getgrent_r(3) in r174547, so
this bug is no longer valid.

MFC after: 3 days

9 years agoSimplify memrw().
alc [Mon, 27 Oct 2014 01:10:40 +0000 (01:10 +0000)]
Simplify memrw().

MFC after: 10 days

9 years agoAllocate buffer for READ BUFFER/WRITE BUFFER commands on demand.
mav [Sun, 26 Oct 2014 23:25:42 +0000 (23:25 +0000)]
Allocate buffer for READ BUFFER/WRITE BUFFER commands on demand.

These commands are rare, but consume additional 256KB RAM per LUN.

MFC after: 1 week

9 years agoAdd a comment explaining the intent behind the I/O reservation [0x72-0x77].
neel [Sun, 26 Oct 2014 21:17:44 +0000 (21:17 +0000)]
Add a comment explaining the intent behind the I/O reservation [0x72-0x77].

9 years agoReplace update from -r271410 accidentally lost in -r273575.
mckusick [Sun, 26 Oct 2014 20:48:26 +0000 (20:48 +0000)]
Replace update from -r271410 accidentally lost in -r273575.

9 years agoFix support for LUN flat space addressing.
mav [Sun, 26 Oct 2014 20:13:46 +0000 (20:13 +0000)]
Fix support for LUN flat space addressing.

MFC after: 1 week

9 years agoAvoid dynamic syscall overhead for statically compiled modules.
mjg [Sun, 26 Oct 2014 19:42:44 +0000 (19:42 +0000)]
Avoid dynamic syscall overhead for statically compiled modules.

The kernel tracks syscall users so that modules can safely unregister them.

But if the module is not unloadable or was compiled into the kernel, there is
no need to do this.

Achieve this by adding SY_THR_STATIC_KLD macro which expands to SY_THR_STATIC
during kernel build and 0 otherwise.

Reviewed by: kib (previous version)
MFC after: 2 weeks

9 years agoChange the type of the first argument to the I/O emulation handlers to
neel [Sun, 26 Oct 2014 19:03:06 +0000 (19:03 +0000)]
Change the type of the first argument to the I/O emulation handlers to
'struct vm *'. Previously it used to be a 'void *' but there is no reason
to hide the actual type from the handler.

Discussed with: tychon
MFC after: 1 week

9 years agoFix CF ERASE breakage caused by 268205.
smh [Sun, 26 Oct 2014 18:41:01 +0000 (18:41 +0000)]
Fix CF ERASE breakage caused by 268205.

This prevents BIO_DELETE requests getting stuck in the TRIM queue which
results in a panic on shutdown due to outstanding requests.

PR: 194606
Reported by: Guido Falsi
Reviewed by: mav
MFC after: 3 days
Sponsored by: Multiplay

9 years agoRemove the ARM_DEVICE_MULTIPASS option and make its effect be the default.
ian [Sun, 26 Oct 2014 18:30:35 +0000 (18:30 +0000)]
Remove the ARM_DEVICE_MULTIPASS option and make its effect be the default.

Multipass device attachment was tested on many arm platforms by users and
only success was reported on the arm@ mailing list.  This is just the
long-delayed followup of making it the default.

Multipass attachment is necessary when using vendor-supplied FDT data,
because our devices may need to be attached in a different order than they
are described in the FDT data.

9 years agoRemove incorrect semicolon.
stefanf [Sun, 26 Oct 2014 17:56:58 +0000 (17:56 +0000)]
Remove incorrect semicolon.

9 years agoBy the time that pmap_init() runs, vm_phys_segs[] has been initialized. Obtaining
alc [Sun, 26 Oct 2014 17:56:47 +0000 (17:56 +0000)]
By the time that pmap_init() runs, vm_phys_segs[] has been initialized.  Obtaining
the end of memory address from vm_phys_segs[] is a little easier than obtaining it
from phys_avail[].

Discussed with: Svatopluk Kraus

9 years agosh: Make getopts memory-safe if with changing arguments.
jilles [Sun, 26 Oct 2014 17:50:33 +0000 (17:50 +0000)]
sh: Make getopts memory-safe if with changing arguments.

POSIX does not permit to continuing a getopts loop with different
arguments. For parsing the positional parameters, we handle this case by
resetting the getopts state when the positional parameters are changed in
any way (and the getopts state is local to a function). However, in the
syntax getopts <optstring> <var> <arg...>, changes could lead to invalid
memory access.

In the syntax getopts <optstring> <var> <arg...>, store a copy of the
arguments and continue to use them until getopts is reset.

9 years agoFix printing non-terminated strings in devlist XML.
mav [Sun, 26 Oct 2014 15:28:07 +0000 (15:28 +0000)]
Fix printing non-terminated strings in devlist XML.

MFC after: 1 week

9 years agoFix up an assertion in kern_setgroups, it should compare with ngroups_max + 1
mjg [Sun, 26 Oct 2014 14:25:42 +0000 (14:25 +0000)]
Fix up an assertion in kern_setgroups, it should compare with ngroups_max + 1

Bug introdued in r273685.

Noted by: Tiwei Bie <btw mail.ustc.edu.cn>

9 years agoMention VAAI and ODX in ctl(4).
trasz [Sun, 26 Oct 2014 13:30:53 +0000 (13:30 +0000)]
Mention VAAI and ODX in ctl(4).

Reviewed by: mav@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoMFV r273688:
delphij [Sun, 26 Oct 2014 09:29:12 +0000 (09:29 +0000)]
MFV r273688:

Update filesystems magic.  This fixes a regression introduced by
libmagic 5.19 which prevents file(1) to show more verbose information
about a MBR.

Submitted by: madpilot
MFC after: 2 weeks

9 years agoAdd "rpm" and "formfactor" LUN options to match istgt functionality.
mav [Sun, 26 Oct 2014 07:40:37 +0000 (07:40 +0000)]
Add "rpm" and "formfactor" LUN options to match istgt functionality.

MFC after: 1 week

9 years agoTidy up sys_setgroups and kern_setgroups.
mjg [Sun, 26 Oct 2014 06:04:09 +0000 (06:04 +0000)]
Tidy up sys_setgroups and kern_setgroups.

- 'groups' initialization to NULL is always ovewrwriten before use, so plug it
- get rid of 'goto out'
- kern_setgroups's callers already validate ngrp, so only assert the condition
- ngrp  is an u_int, so 'ngrp < 1' is more readable as 'ngrp == 0'

No functional changes.

9 years agoUse a temporary buffer in sys_setgroups for requests with <= XU_NGROUPS groups.
mjg [Sun, 26 Oct 2014 05:39:42 +0000 (05:39 +0000)]
Use a temporary buffer in sys_setgroups for requests with <= XU_NGROUPS groups.

Submitted by: Tiwei Bie <btw mail.ustc.edu.cn>
X-Additional: JuniorJobs project
MFC after: 2 weeks

9 years agoMove the ACPI PM timer emulation into vmm.ko.
neel [Sun, 26 Oct 2014 04:44:28 +0000 (04:44 +0000)]
Move the ACPI PM timer emulation into vmm.ko.

This reduces variability during timer calibration by keeping the emulation
"close" to the guest. Additionally having all timer emulations in the kernel
will ease the transition to a per-VM clock source (as opposed to using the
host's uptime keep track of time).

Discussed with: grehan

9 years agoDon't pass the 'error' return from an I/O port handler directly to vm_run().
neel [Sun, 26 Oct 2014 03:03:41 +0000 (03:03 +0000)]
Don't pass the 'error' return from an I/O port handler directly to vm_run().

Most I/O port handlers return -1 to signal an error. If this value is returned
without modification to vm_run() then it leads to incorrect behavior because
'-1' is interpreted as ERESTART at the system call level.

Fix this by always returning EIO to signal an error from an I/O port handler.

MFC after: 1 week

9 years agoNow that sysctl_root is only called with sysctl lock in shared mode, update
mjg [Sun, 26 Oct 2014 01:47:55 +0000 (01:47 +0000)]
Now that sysctl_root is only called with sysctl lock in shared mode, update
its assertion to require that.

Update comment missed in r273400: sysctl_xlock/unlock -> sysctl_xlock/xunlock

Noted by: jhb

9 years agoFix a few issues with creating VOLUME_LABEL for the
gjb [Sun, 26 Oct 2014 01:41:54 +0000 (01:41 +0000)]
Fix a few issues with creating VOLUME_LABEL for the
installation ISOs:

 - TYPE, BRANCH, and REVISION are only defined if
   OSRELEASE is not defined, so in situations where
   one might set OSRELEASE for an in-house ISO build,
   VOLUME_LABEL would be empty.

 - makefs(8) limits the volume label to 32 characters,
   which for the powerpc64 case, OSRELEASE expands to
   FreeBSD-11.0-CURRENT-powerpc-powerpc64.  Even with
   removing the prefixing 'FreeBSD-', the string is 30
   characters long, leaving zero room for suffixing the
   type of ISO media (BO for bootonly, CD for cdrom, and
   DVD for dvdrom).

Resolve these by defining VOLUME_LABEL when defining
OSRELEASE if unset.  If OSRELEASE is defined by the
builder, use the OSRELEASE from that definition as the
VOLUME_LABEL.

In addition, for cases where both TARGET and TARGET_ARCH
are used for the VOLUME_LABEL, use TARGET_ARCH if it
differs from TARGET.

There are probably a few sharp edges here yet, but these
problems are going to affect the powerpc/powerpc64 builds
for 10.1-RELEASE, so the immediate concern is fixing the
underlying problem at hand quickly, and less so about the
elegance of the fix.

MFC after: 3 days
X-MFC-10.1: yes, asap
Sponsored by: The FreeBSD Foundation

9 years agoSet the caching mode for the usermode mapping of the HPET registers
kib [Sat, 25 Oct 2014 21:01:50 +0000 (21:01 +0000)]
Set the caching mode for the usermode mapping of the HPET registers
page to uncached.

Reviewed by: rpaulo
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoUse correct type in __DEVOLATILE().
jhb [Sat, 25 Oct 2014 20:42:47 +0000 (20:42 +0000)]
Use correct type in __DEVOLATILE().

9 years agoClarify that pthread_cleanup_push()/pop() are implemented as macros that
jhb [Sat, 25 Oct 2014 19:31:34 +0000 (19:31 +0000)]
Clarify that pthread_cleanup_push()/pop() are implemented as macros that
create a new code block and thus must be balanced at the same lexical
scope.  (This is also a requirement in POSIX.)

PR: 194280
Submitted by: dr2867.business@pacbell.net
MFC after: 1 week

9 years agoThis change addresses 4 bugs in ZFS exposed by Richard Kojedzinszky's
jpaetzel [Sat, 25 Oct 2014 17:42:44 +0000 (17:42 +0000)]
This change addresses 4 bugs in ZFS exposed by Richard Kojedzinszky's
crash.sh script attached to FreeNAS bug 4109:
https://bugs.freenas.org/issues/4109

Three are in the snapshot layer:
a) AVG explains in his notes: https://wiki.freebsd.org/AvgVfsSolarisVsFreeBSD

"VOP_INACTIVE must not do any destructive actions to a vnode
and its filesystem node, nor invalidate them in any way."
gfs_vop_inactive and zfsctl_snapshot_inactive did just that. In
OpenSolaris VOP_INACTIVE is much closer to FreeBSD's VOP_RECLAIM.
Rename & move them to gfs_vop_reclaim and zfsctl_snapshot_reclaim
and merge in the requisite vnode_destroy from zfsctl_common_reclaim.

b) gfs_lookup_dot and various zfsctl functions do not honor the
FreeBSD VFS convention of only locking from the root downward. When
looking up ".." the convention is to drop the current leaf vnode lock before
acquiring the directory vnode and then subsequently re-acquiring the lock on the
leaf vnode. This fixes that in all the places that our exercised by crash.sh.

c) The snapshot may already be unmounted when the directory vnode is reclaimed.
Check for this case and return.

One in the common layer:
d) Callers of traverse expect the reference to the vnode passed in to be
maintained. Don't release it.

This last one may be an unclear contract. There may in fact be some callers that
do expect the reference to be dropped on success in addition to callers that
expect it to be released. In this case a further audit of the callers is needed
and a consensus on the correct behavior.

PR: 184677
Submitted by: kmacy
Reviewed by: delphij, will, avg
MFC after: 2 weeks
Sponsored by: iXsystems

9 years agoAdd support for 12/16-byte EUI and 16-byte NAA IDs.
mav [Sat, 25 Oct 2014 17:07:35 +0000 (17:07 +0000)]
Add support for 12/16-byte EUI and 16-byte NAA IDs.

MFC after: 1 week

9 years agoRevert somewhat hackish geom_disk optimization, committed as part of r256880,
mav [Sat, 25 Oct 2014 15:16:19 +0000 (15:16 +0000)]
Revert somewhat hackish geom_disk optimization, committed as part of r256880,
and the following r273143 commit, supposed to workaround introduced issue by
quite innocent-looking change.

While there is no clear understanding why, but r273143 is accused in data
corruption in some environments with high I/O load.  I personally don't see
any problem in that commit, and possibly it is just a trigger to some other
bug somewhere, but better safe then sorry for now.

Requested by: scottl@
MFC after: 3 days

9 years agoAdd basic iSNS client to the iSCSI target.
mav [Sat, 25 Oct 2014 12:50:26 +0000 (12:50 +0000)]
Add basic iSNS client to the iSCSI target.

This makes ctld(8) register its iSCSI targets and portals on configured
iSNS servers to allow initiators find them without active discovery.

Fetching of allowed initiators from iSNS is not implemented now, so target
ACLs still should be configured manually.

Reviewed by: trasz@
MFC after: 1 month
Sponsored by: iXsystems, Inc.

9 years agoFix a use of an uninitialized variable by makeing sure
tuexen [Sat, 25 Oct 2014 09:25:29 +0000 (09:25 +0000)]
Fix a use of an uninitialized variable by makeing sure
that sctp_med_chunk_output() always initialized the reason_code
instead of relying on the caller.
The variable is only used for debugging purpose.
This issue was reported by Peter Bostroem from Google.

MFC after: 3 days

9 years agoBail out of the script on FreeBSD due to deterministic panic issue
ngie [Sat, 25 Oct 2014 07:20:46 +0000 (07:20 +0000)]
Bail out of the script on FreeBSD due to deterministic panic issue

PR: 194589
Sponsored by: EMC / Isilon Storage Division

9 years agoBail out of the script on FreeBSD due to deterministic panic issue
ngie [Sat, 25 Oct 2014 06:33:00 +0000 (06:33 +0000)]
Bail out of the script on FreeBSD due to deterministic panic issue

PR: 194587
Sponsored by: EMC / Isilon Storage Division

9 years agoBail out of the script on FreeBSD due to deterministic panic issue
ngie [Sat, 25 Oct 2014 06:28:48 +0000 (06:28 +0000)]
Bail out of the script on FreeBSD due to deterministic panic issue

PR: 194586
Sponsored by: EMC / Isilon Storage Division

9 years agoBail out of the script on FreeBSD due to deterministic panic issue
ngie [Sat, 25 Oct 2014 06:10:01 +0000 (06:10 +0000)]
Bail out of the script on FreeBSD due to deterministic panic issue

PR: 191573
Sponsored by: EMC / Isilon Storage Division

9 years agorlimit: plug duplicate assertion
mjg [Sat, 25 Oct 2014 05:56:21 +0000 (05:56 +0000)]
rlimit: plug duplicate assertion

counter sanity is already checked by refcount_release.

9 years agoMove the redirection to stderr out of the cmd variable assignment
ngie [Sat, 25 Oct 2014 05:31:18 +0000 (05:31 +0000)]
Move the redirection to stderr out of the cmd variable assignment

Putting 2>/dev/null in cmd= escapes the redirection operation, which causes
mdconfig to think it's a filename

MFC after: 2 weeks
X-MFC with: r273627
Sponsored by: EMC / Isilon Storage Division

9 years ago- Print out "Bail out!" in die(..) so prove terminates immediately
ngie [Sat, 25 Oct 2014 04:52:48 +0000 (04:52 +0000)]
- Print out "Bail out!" in die(..) so prove terminates immediately
- Handle the output from newer versions of openssl md5, similar to what
  pjd@ did in r248304

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

9 years agoMFV r273617: netcat from OpenBSD 5.6.
delphij [Sat, 25 Oct 2014 00:37:35 +0000 (00:37 +0000)]
MFV r273617: netcat from OpenBSD 5.6.

MFC after: 2 weeks

9 years agoFix build.
delphij [Sat, 25 Oct 2014 00:16:36 +0000 (00:16 +0000)]
Fix build.

9 years agocxgbe(4): bump up PF4's share of some global resources.
np [Sat, 25 Oct 2014 00:14:44 +0000 (00:14 +0000)]
cxgbe(4): bump up PF4's share of some global resources.

This increases the size of the per-port RSS slice and also allows the
driver to use a larger number of tx and rx queues.

MFC after: 2 weeks

9 years agoUse the __DECONST macro rather than hand rolling the same thing.
brooks [Fri, 24 Oct 2014 23:25:44 +0000 (23:25 +0000)]
Use the __DECONST macro rather than hand rolling the same thing.

Sponsored by: DARPA, AFRL

9 years agoFix the build by installing acpi_hpet.h correctly.
rpaulo [Fri, 24 Oct 2014 23:25:11 +0000 (23:25 +0000)]
Fix the build by installing acpi_hpet.h correctly.

Submitted by: jase
MFC after: 1 week

9 years agoRemove an unused variable that would be better spelled __func__.
brooks [Fri, 24 Oct 2014 23:24:47 +0000 (23:24 +0000)]
Remove an unused variable that would be better spelled __func__.

Sponsored by: DARPA, AFRL

9 years agoAdd an iicbus_reset() method to bcm2835_bsc. While it is generally not
loos [Fri, 24 Oct 2014 22:06:21 +0000 (22:06 +0000)]
Add an iicbus_reset() method to bcm2835_bsc.  While it is generally not
used for kernel devices it is used by i2c(8).

This fix the 'error: Device not configured' when i2c(8) tries to reset the
controller, as an example:

# i2c -r
Resetting I2C controller on /dev/iic0: error: Device not configured

For now use conservative settings for default i2c speeds.

MFC after: 1 week

9 years agoAdd a sysctl to control the HPET allow_write behaviour.
rpaulo [Fri, 24 Oct 2014 21:08:36 +0000 (21:08 +0000)]
Add a sysctl to control the HPET allow_write behaviour.

Requested by: kib

9 years agoFix cpsw_detach() to not panic when called from cpsw_attach().
loos [Fri, 24 Oct 2014 21:08:02 +0000 (21:08 +0000)]
Fix cpsw_detach() to not panic when called from cpsw_attach().

For an unkown reason (at moment), sometimes if_cpsw cannot read from PHY
and fails to attach calling cpsw_detach() which end up in a panic.

Fix it by doing the proper check before detach the miibus and also fix the
leak of few variables.

And to actually make it work, ether_ifattach() has to be moved to the end
of cpsw_attach() to avoid a race where calling ether_ifdetach() before
domain_init() (which will only run later on) would make it crash at
INP_INFO_RLOCK() on in_pcbpurgeif0().

Tested on: BBB (am335x)
MFC after: 1 week

9 years agoEliminate conf_lock and instead rely on the NSS write lock to protect
markj [Fri, 24 Oct 2014 20:29:14 +0000 (20:29 +0000)]
Eliminate conf_lock and instead rely on the NSS write lock to protect
NSS configuration state.

As a side effect, this fixes a race condition which can occur if multiple
threads call nsdispatch(3) concurrently before nsswitch.conf has been
parsed. Previously, the thread holding conf_lock could cause other threads
to return from nss_configure() before nsswitch.conf had been parsed, forcing
them to fall back to the default sources for their NSS methods.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D994
MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division

9 years agoThe current POSIX semaphore implementation stores the _has_waiters flag
jhb [Fri, 24 Oct 2014 20:02:44 +0000 (20:02 +0000)]
The current POSIX semaphore implementation stores the _has_waiters flag
in a separate word from the _count.  This does not permit both items to
be updated atomically in a portable manner.  As a result, sem_post()
must always perform a system call to safely clear _has_waiters.

This change removes the _has_waiters field and instead uses the high bit
of _count as the _has_waiters flag.  A new umtx object type (_usem2) and
two new umtx operations are added (SEM_WAIT2 and SEM_WAKE2) to implement
these semantics.  The older operations are still supported under the
COMPAT_FREEBSD9/10 options.  The POSIX semaphore API in libc has
been updated to use the new implementation.  Note that the new
implementation is not compatible with the previous implementation.
However, this only affects static binaries (which cannot be helped by
symbol versioning).  Binaries using a dynamic libc will continue to work
fine.  SEM_MAGIC has been bumped so that mismatched binaries will error
rather than corrupting a shared semaphore.  In addition, a padding field
has been added to sem_t so that it remains the same size.

Differential Revision: https://reviews.freebsd.org/D961
Reported by: adrian
Reviewed by: kib, jilles (earlier version)
Sponsored by: Norse

9 years agoAdd COMPAT_FREEBSD9 and COMPAT_FREEBSD10 options to wrap code that
jhb [Fri, 24 Oct 2014 19:58:24 +0000 (19:58 +0000)]
Add COMPAT_FREEBSD9 and COMPAT_FREEBSD10 options to wrap code that
provides compatability for FreeBSD 9.x and 10.x binaries.  Enable
these options in kernel configs that enable other COMPAT_FREEBSD<n>
options.

9 years agoHPET: avoid handling the multiple file-descriptor case.
rpaulo [Fri, 24 Oct 2014 19:58:00 +0000 (19:58 +0000)]
HPET: avoid handling the multiple file-descriptor case.

It had two bugs: one where mmap was still allowed and another where
D_TRACKCLOSE doesn't handle all cases.

Thanks to jhb and kib for pointing them out.
MFC after: 1 week

9 years agoDon't reference sem(4) from the POSIX semaphore pages. POSIX semaphores
jhb [Fri, 24 Oct 2014 19:55:49 +0000 (19:55 +0000)]
Don't reference sem(4) from the POSIX semaphore pages.  POSIX semaphores
were reimplemented using umtx in FreeBSD 9 and no longer use sem(4).

9 years agoFix a bug where DMA maps created with bus_dmamap_create() won't increment
loos [Fri, 24 Oct 2014 19:18:39 +0000 (19:18 +0000)]
Fix a bug where DMA maps created with bus_dmamap_create() won't increment
the map count and without being able to keep track of the current map
allocation, bus_dma_tag_destroy() will fail to proceed and will return
EBUSY even after all the maps have been correctly destroyed with
bus_dmamap_destroy().

Found while testing the detach method of a NIC.

Tested on: BBB (am335x)
Reviewed by: cognet, ian
MFC after: 1 week

9 years agoHPET: create /dev/hpetN as a way to access HPET from userland.
rpaulo [Fri, 24 Oct 2014 18:39:15 +0000 (18:39 +0000)]
HPET: create /dev/hpetN as a way to access HPET from userland.

In some cases, TSC is broken and special applications might benefit
from memory mapping HPET and reading the registers to count time.
Most often the main HPET counter is 32-bit only[1], so this only gives
the application a 300 second window based on the default HPET
interval.
Other applications, such as Intel's DPDK, expect /dev/hpet to be
present and use it to count time as well.

Although we have an almost userland version of gettimeofday() which
uses rdtsc in userland, it's not always possible to use it, depending
on how broken the multi-socket hardware is.

Install the acpi_hpet.h so that applications can use the HPET register
definitions.

[1] I haven't found a system where HPET's main counter uses more than
32 bit.  There seems to be a discrepancy in the Intel documentation
(claiming it's a 64-bit counter) and the actual implementation (a
32-bit counter in a 64-bit memory area).

MFC after: 1 week
Relnotes: yes

9 years agoFix documentation issue.
melifaro [Fri, 24 Oct 2014 17:06:56 +0000 (17:06 +0000)]
Fix documentation issue.

PR: 194581
Submitted by: madpilot

9 years agoUpdate the network interface baudrate integer according to the actual
hselasky [Fri, 24 Oct 2014 16:39:01 +0000 (16:39 +0000)]
Update the network interface baudrate integer according to the actual
line rate.

Submitted by: jhb @
MFC after: 1 week

9 years ago- Add sys/types.h for the APIs in sys/sysctl.h
ngie [Fri, 24 Oct 2014 16:18:16 +0000 (16:18 +0000)]
- Add sys/types.h for the APIs in sys/sysctl.h
- Poke at VM_MIN_ADDRESS in machine/vmparam.h because FreeBSD doesn't have a
  vm.minaddress sysctl analog
- Expect ENOMEM instead of EAGAIN in mlock_limits
- Provide mlock an mmap'ed page twice to simulate MAP_WIRED on NetBSD

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoCorrect my previous commit:
ngie [Fri, 24 Oct 2014 16:07:31 +0000 (16:07 +0000)]
Correct my previous commit:

- getrusage_utime_back succeeds reliably on FreeBSD
- getrusage_utime_zero passes/fails in a seemingly non-deterministic manner.
  Skip it for now (and fix it later)

In the initial port of this testcase to FreeBSD, the results failed reliably
in the same manner as it does on NetBSD

Sponsored by: EMC / Isilon Storage Division

9 years agoAccept the documented FDT compatible string for the PL310 cache controller
ian [Fri, 24 Oct 2014 15:44:29 +0000 (15:44 +0000)]
Accept the documented FDT compatible string for the PL310 cache controller
as well as the non-standard string we've been using for a couple years.

9 years agoAdd D-Link DWA-123 rev D1 and Elecom WDC-150SU2M.
kevlo [Fri, 24 Oct 2014 15:36:30 +0000 (15:36 +0000)]
Add D-Link DWA-123 rev D1 and Elecom WDC-150SU2M.

9 years agoBump default dynamic limit to 16k entries.
melifaro [Fri, 24 Oct 2014 13:57:15 +0000 (13:57 +0000)]
Bump default dynamic limit to 16k entries.
Print better log message when limit is hit.

PR: 193300
Submitted by: me at nileshgr.com

9 years agoRemove redundant check and m_pullup() call.
ae [Fri, 24 Oct 2014 13:34:22 +0000 (13:34 +0000)]
Remove redundant check and m_pullup() call.

9 years agoFix displaying non-contiguous netmasks.
melifaro [Fri, 24 Oct 2014 13:29:12 +0000 (13:29 +0000)]
Fix displaying non-contiguous netmasks.

Found by: ae
Sponsored by: Yandex LLC