freebsd.git
8 years agoSubmitted by: phil
phil [Sun, 29 May 2016 01:43:28 +0000 (01:43 +0000)]
Submitted by: phil
Reviewed by: sjg (mentor)
Approved by: sjg

8 years agoFix "make installworld" with MK_CDDL == no after r300906 by
ngie [Sun, 29 May 2016 01:38:12 +0000 (01:38 +0000)]
Fix "make installworld" with MK_CDDL == no after r300906 by
adding a missing entry for ${TESTSBASE}/cddl/sbin

X-MFC with: r300906
Pointyhat to: asomers
Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>
Sponsored by: EMC / Isilon Storage Division

8 years agoImport the skein hashing algorithm, based on the threefish block cipher
allanjude [Sun, 29 May 2016 01:15:36 +0000 (01:15 +0000)]
Import the skein hashing algorithm, based on the threefish block cipher

Connect it to userland (libmd, libcrypt, sbin/md5) and kernel (crypto.ko)

Support for skein as a ZFS checksum algorithm was introduced in r289422
but is disconnected because FreeBSD lacked a Skein implementation.

A further commit will enable it in ZFS.

Reviewed by: cem
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D6166

8 years agoFix with external GCC after r300886.
bdrewery [Sun, 29 May 2016 01:15:15 +0000 (01:15 +0000)]
Fix with external GCC after r300886.

Somehow the /usr/include path got lost in this particular case.
Just pass it along from --sysroot as was already done for
DIRDEPS_BUILD.

Sponsored by: EMC / Isilon Storage Division

8 years agoAvoid more literal-suffix errors with C++11
bdrewery [Sun, 29 May 2016 00:40:29 +0000 (00:40 +0000)]
Avoid more literal-suffix errors with C++11

8 years agoExternal GCC: Ensure our libstdc++ symlink to libc++ is found.
bdrewery [Sun, 29 May 2016 00:10:23 +0000 (00:10 +0000)]
External GCC: Ensure our libstdc++ symlink to libc++ is found.

Similar to r300917, the search path for our symlink hack must come
before the =/usr/lib search path.

This fixes the atf-check build after r300886.

8 years agoGCC XCC -isystem hack: Ensure CXX search =/usr/include/c++1/v1 first.
bdrewery [Sat, 28 May 2016 23:10:07 +0000 (23:10 +0000)]
GCC XCC -isystem hack: Ensure CXX search =/usr/include/c++1/v1 first.

The C++ header files must be searched before /usr/include.

The original code in Makefile.inc1 did this before the change in r297271 to
use -isystem.  The libc++ import in r300770 fixed the bug introduced in
r297271 by swapping XCFLAGS and XCXXFLAGS ordering in CROSSENV.

Moving the code from Makefile.inc1 to bsd.sys.mk in r300886 also made it
more difficult to control the order of the flags.  CXXFLAGS is based on
CFLAGS, so any additions to it will come after CFLAGS.  The CROSSENV
code from Makefile.inc1 was such that it was ensured the CXXFLAGS came
first by setting them directly in CXX.  Using CXXFLAGS+=-I would work
here, but instead continue to use -isystem by adding it to CXX so it
comes before CFLAGS.

Reported by: dim

8 years agoAvoid literal-suffix error due to missing space.
bdrewery [Sat, 28 May 2016 22:27:54 +0000 (22:27 +0000)]
Avoid literal-suffix error due to missing space.

8 years agoReadd week day to default dates
bapt [Sat, 28 May 2016 21:26:50 +0000 (21:26 +0000)]
Readd week day to default dates

Requested by: many

8 years agoAdd a hack to readd the day of weeks in default date formats
bapt [Sat, 28 May 2016 21:25:24 +0000 (21:25 +0000)]
Add a hack to readd the day of weeks in default date formats

8 years agoUndo meaningless local changes to libxo so we're in sync with the github repo.
phil [Sat, 28 May 2016 19:39:15 +0000 (19:39 +0000)]
Undo meaningless local changes to libxo so we're in sync with the github repo.

Submitted by: phil
Reviewed by: sjg (mentor)
Approved by: sjg

8 years agonet80211: replace m_getcl/m_gethdr pair with m_get2 in ieee80211_fragment()
avos [Sat, 28 May 2016 19:13:39 +0000 (19:13 +0000)]
net80211: replace m_getcl/m_gethdr pair with m_get2 in ieee80211_fragment()

- Switch to m_get2() for mbuf allocation instead of manual mbuf size
determination.
- Reuse MIN() macro for mbuf size selection.

8 years agonet80211: fix use-after-free in frame defragmentation procedure.
avos [Sat, 28 May 2016 18:49:17 +0000 (18:49 +0000)]
net80211: fix use-after-free in frame defragmentation procedure.

- Assign frame sequence/fragment number before frame concatenation;
otherwise, frame header pointer (wh) will be invalid.
- Move this code block upper and eliminate duplicate 'lwh = mtod()'
assignment.

Tested with wpi(4) (transmitter) (STA mode) and urtwn(4) (receiver)
(HOSTAP mode).

8 years agozfsd(8), the ZFS fault management daemon
asomers [Sat, 28 May 2016 17:43:40 +0000 (17:43 +0000)]
zfsd(8), the ZFS fault management daemon

Add zfsd, which deals with hard drive faults in ZFS pools. It manages
hotspares and replements in drive slots that publish physical paths.

cddl/usr.sbin/zfsd
Add zfsd(8) and its unit tests

cddl/usr.sbin/Makefile
Add zfsd to the build

lib/libdevdctl
A C++ library that helps devd clients process events

lib/Makefile
share/mk/bsd.libnames.mk
share/mk/src.libnames.mk
Add libdevdctl to the build. It's a private library, unusable by
out-of-tree software.

etc/defaults/rc.conf
By default, set zfsd_enable to NO

etc/mtree/BSD.include.dist
Add a directory for libdevdctl's include files

etc/mtree/BSD.tests.dist
Add a directory for zfsd's unit tests

etc/mtree/BSD.var.dist
Add /var/db/zfsd/cases, where zfsd stores case files while it's shut
down.

etc/rc.d/Makefile
etc/rc.d/zfsd
Add zfsd's rc script

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
Fix the resource.fs.zfs.statechange message. It had a number of
problems:

It was only being emitted on a transition to the HEALTHY state.
That made it impossible for zfsd to take actions based on drives
getting sicker.

It compared the new state to vdev_prevstate, which is the state that
the vdev had the last time it was opened.  That doesn't make sense,
because a vdev can change state multiple times without being
reopened.

vdev_set_state contains logic that will change the device's new
state based on various conditions.  However, the statechange event
was being posted _before_ that logic took effect.  Now it's being
posted after.

Submitted by: gibbs, asomers, mav, allanjude
Reviewed by: mav, delphij
Relnotes: yes
Sponsored by: Spectra Logic Corp, iX Systems
Differential Revision: https://reviews.freebsd.org/D6564

8 years agoUse a relative symlink for proper --sysroot support.
bdrewery [Sat, 28 May 2016 16:38:09 +0000 (16:38 +0000)]
Use a relative symlink for proper --sysroot support.

Sponsored by: EMC / Isilon Storage Division

8 years agoAlways export X_* vars.
bdrewery [Sat, 28 May 2016 16:21:05 +0000 (16:21 +0000)]
Always export X_* vars.

This fixes CROSS_TOOLCHAIN builds after r300886 since it
relies on X_COMPILER_TYPE being set.

The X_* vars will only represent the external compiler
being used.

Sponsored by: EMC / Isilon Storage Division

8 years agoImplement SHA-512 truncated (224 and 256 bits)
allanjude [Sat, 28 May 2016 16:06:07 +0000 (16:06 +0000)]
Implement SHA-512 truncated (224 and 256 bits)

This implements SHA-512/256, which generates a 256 bit hash by
calculating the SHA-512 then truncating the result. A different initial
value is used, making the result different from the first 256 bits of
the SHA-512 of the same input. SHA-512 is ~50% faster than SHA-256 on
64bit platforms, so the result is a faster 256 bit hash.

The main goal of this implementation is to enable support for this
faster hashing algorithm in ZFS. The feature was introduced into ZFS
in r289422, but is disconnected because SHA-512/256 support was missing.
A further commit will enable it in ZFS.

This is the follow on to r292782

Reviewed by: cem
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D6061

8 years agoDon't panic in hwpmc when stopping sampling.
andrew [Sat, 28 May 2016 13:05:39 +0000 (13:05 +0000)]
Don't panic in hwpmc when stopping sampling.

When hwpmc stops sampling it will set the pm_state to something other
than PMC_STATE_RUNNING. This means the following sequence can happen:

CPU 0: Enter the interrupt handler
CPU 0: Set the thread TDP_CALLCHAIN pflag
CPU 1: Stop sampling
CPU 0: Call pmc_process_samples, sampling is stopped so clears ps_nsamples
CPU 0: Finishes interrupt processing with the TDP_CALLCHAIN flag set
CPU 0: Call pmc_capture_user_callchain to capture the user call chain
CPU 0: Find all the pmc sample are free so no call chains need to be captured
CPU 0: KASSERT because of this

This fixes the issue by checking if any of the samples have been stopped
and including this in te KASSERT.

PR: 204273
Reviewed by: bz, gnn
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6581

8 years agoIn if_attachdomain1() there does not seem to be any reason
bz [Sat, 28 May 2016 08:32:15 +0000 (08:32 +0000)]
In if_attachdomain1() there does not seem to be any reason
to use TRYLOCK rather than just acquire the lock, so just do that.

Reviewed by: markj
Obtained from: projects/vnet
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6578

8 years ago[ath] add WB335 btcoex for initial testing.
adrian [Sat, 28 May 2016 02:14:24 +0000 (02:14 +0000)]
[ath] add WB335 btcoex for initial testing.

This is like the WB222 coexistence (ie, "MCI", a message bus inside the
chip), and it's currently a cut/paste so I can start using it to flesh
out the differences with WB222.

It doesn't completely /do/ bluetooth coexistence, because it turns out
I need to add some contigmalloc'ed buffers to the btcoex path for this
type of hardware.  I'm putting this work in the "people would like
to see functioning-ish btcoex before FreeBSD-11" bucket because I see
this as "broken".

Tested:

* QCA9535 (WB335) NIC, BT + 2GHz STA

8 years agocxgbe/t4_tom: Exempt RDMA connections from a TCP sanity test for now, to
np [Sat, 28 May 2016 00:38:17 +0000 (00:38 +0000)]
cxgbe/t4_tom: Exempt RDMA connections from a TCP sanity test for now, to
avoid panicking debug kernels.

t4_tom does not keep track of a connection once it switches to ULP mode
iWARP.  If the connection falls out of ULP mode the driver/hardware seq#
etc. are out of sync.  A better fix would be to figure out what the
current seq# are, update the driver's state, and perform all sanity
checks as usual.

8 years agoAdd gpiokeys to the list of GPIO modules built only if FDT is enabled
gonzo [Sat, 28 May 2016 00:22:39 +0000 (00:22 +0000)]
Add gpiokeys to the list of GPIO modules built only if FDT is enabled

8 years agoDon't truncate existing error when writing the log.
bdrewery [Fri, 27 May 2016 23:58:00 +0000 (23:58 +0000)]
Don't truncate existing error when writing the log.

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

8 years agoRename function to be less generic.
bdrewery [Fri, 27 May 2016 23:57:57 +0000 (23:57 +0000)]
Rename function to be less generic.

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

8 years agoWrite to the log using the tracer's credentials.
bdrewery [Fri, 27 May 2016 23:57:53 +0000 (23:57 +0000)]
Write to the log using the tracer's credentials.

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

8 years agoexec: Cease tracing if credentials will change with the new image.
bdrewery [Fri, 27 May 2016 23:57:43 +0000 (23:57 +0000)]
exec: Cease tracing if credentials will change with the new image.

This also prevents tracing to a P_INEXEC process since it could race
with other processes attaching to it in filemon_event_process_exec() due
to the filemon_get_proc() race of incrementing ref and then locking the
filemon.  With the no-P_INEXEC invariant in place the p_filemon may only
be the same or NULL when trying to drop it in
filemon_event_process_exec().

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6545

8 years agoFix taskqueue groups to work with EARLY_AP_STARTUP.
jhb [Fri, 27 May 2016 23:49:16 +0000 (23:49 +0000)]
Fix taskqueue groups to work with EARLY_AP_STARTUP.

In the EARLY_AP_STARTUP case the APs are already running when a taskqgroup
is created, so adjust the group at the same time it is created.

Sponsored by: Netflix

8 years agoiw_cxgbe: Plug a lock leak in process_mpa_request().
np [Fri, 27 May 2016 23:44:33 +0000 (23:44 +0000)]
iw_cxgbe: Plug a lock leak in process_mpa_request().

If the parent is DEAD or connect_request_upcall() fails, the parent
mutex is left locked.  This leads to a hang when process_mpa_request()
is called again for another child of the listening endpoint.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Obtained from: upstream iw_cxgb4
Sponsored by: Chelsio Communications

8 years agoMove external GCC compiler hacks to bsd.sys.mk.
bdrewery [Fri, 27 May 2016 23:03:44 +0000 (23:03 +0000)]
Move external GCC compiler hacks to bsd.sys.mk.

This allows respecting -nostdinc, -nostdinc++ and -nostdlib before
making the decision to add in -isystem, etc.  The -isystem flags
are problematic for building lib/libc++ and lib/libcxxrt which wants
to only use its own headers.

More information the need of these flags can be found at
https://gcc.gnu.org/ml/gcc/2016-03/msg00219.html

This also reverts r300873.

Sponsored by: EMC / Isilon Storage Division

8 years agoLibcompat: Only pass -isystem =/usr/include for external GCC.
bdrewery [Fri, 27 May 2016 23:03:28 +0000 (23:03 +0000)]
Libcompat: Only pass -isystem =/usr/include for external GCC.

This is the same as the main build logic.  GCC with a cross-compiler
requires using -isystem to =/usr/include to get the search order
correct.

Reported by: dim, asomers
Sponsored by: EMC / Isilon Storage Division

8 years agoFix up r300870
ngie [Fri, 27 May 2016 22:56:00 +0000 (22:56 +0000)]
Fix up r300870

The sys/types.h fix I proposed was only tested with zfs(4), not with
libzpool, which is where the build failure actually existed

Remove vm/vm_pageout.h from arc.c and zfs_vnops.c because they're both
unneeded

MFC after: 1 week
X-MFC with: r300865, r300870
In collaboration with: kib
Submitted by: alc
Sponsored by: EMC / Isilon Storage Division

8 years agoFix typo from r300880
asomers [Fri, 27 May 2016 22:44:33 +0000 (22:44 +0000)]
Fix typo from r300880

Reported by: rpokala
MFC after: Never
Sponsored by: Spectra Logic Corp

8 years agoAlways create loopback routes on every fib
asomers [Fri, 27 May 2016 22:40:40 +0000 (22:40 +0000)]
Always create loopback routes on every fib

Always create loopback routes on every fib, for both IPv4 and IPv6

etc/rc.d/routing
Create loopback IPv4 and IPv6 routes on every fib at boot. Revert
278302; now that all FIBs have IPv6 loopback routes, the
"route add -reject" commands won't fail.

tests/etc/rc.d/routing_test.sh
Greatly simplify static_ipv6_loopback_route_for_each_fib. It was
written under the assumption that loopback routes would be added to
a given fib by the kernel as soon as an interface is configured on
that fib. However, the logic can be much simpler now that we simply
add loopback routes to all fibs at boot. This also removes the need
to run the test as root, removes the restriction that
net.add_addr_allfibs=0, and removes the need to configure fibs in
kyua.conf.

Also, add a test case for IPv4 loopback routes

Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6582

8 years agoAvoid issuing spa config updates for physical path when not necessary
asomers [Fri, 27 May 2016 22:32:44 +0000 (22:32 +0000)]
Avoid issuing spa config updates for physical path when not necessary

ZFS's configuration needs to be updated whenever the physical path for a
device changes, but not when a new device is introduced. This is because new
devices necessarily cause config updates, but only if they are actually
accepted into the pool.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Split vdev_geom_set_physpath out of vdev_geom_attrchanged.  When
setting the vdev's physical path, only request a config update if
the physical path has changed.  Don't request it when opening a
device for the first time, because the config sync will happen
anyway upstack.

sys/geom/geom_dev.c
Split g_dev_set_physpath and g_dev_set_media out of
g_dev_attrchanged

Submitted by: will, asomers
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6428

8 years agoStrip leading spaces off of a SCSI disk's serial number
asomers [Fri, 27 May 2016 22:26:43 +0000 (22:26 +0000)]
Strip leading spaces off of a SCSI disk's serial number

sys/cam/scsi/scsi_xpt.c
Strip leading spaces off of a SCSI disk's reported serial number
when populating the CAM serial number. This affects the output of
"diskinfo -v" and the names of /dev/diskid/DISK-* device nodes,
among other things.

SPC5r05 says that the Product Serial Number field from the Unit
Serial Number VPD page is right-aligned. So any leading spaces are
not part of the actual serial number. Most devices don't left-pad
their serial numbers, but some do. In particular, the SN VPD page
that an LSI HBA emulates for a SATA drive contains enough
left-padding to fill a 20-byte field.

UPDATING
Add a note to UPDATING, because some users may have to update
/etc/fstab or geom labels.

Reviewed by: ken, mav
MFC after: Never
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6516

8 years agoMerge ACPICA 20160527.
jkim [Fri, 27 May 2016 22:16:46 +0000 (22:16 +0000)]
Merge ACPICA 20160527.

Relnotes: yes

8 years agoFix erronious mixed use of tx/rx variables/constants in the same expression.
ian [Fri, 27 May 2016 22:14:39 +0000 (22:14 +0000)]
Fix erronious mixed use of tx/rx variables/constants in the same expression.

Pointed out by jmcneill; other instances found by grep -iE 'rx.*tx|tx.*rx'

8 years agoiw_cxgbe: Use vmem(9) to manage PBL and RQT allocations.
np [Fri, 27 May 2016 21:26:26 +0000 (21:26 +0000)]
iw_cxgbe: Use vmem(9) to manage PBL and RQT allocations.

Submitted by: Krishnamraju Eraparaju at Chelsio
Reviewed by: Steve Wise
Sponsored by: Chelsio Communications

8 years agoUpdate usage(..)
ngie [Fri, 27 May 2016 21:12:25 +0000 (21:12 +0000)]
Update usage(..)

- Document missing options
- Sync options with ioatcontrol(8).
- Make it clear that the first 2 parameters are always required.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoAfter r300770, for libc++ and libcxxrt, use -isystem instead of -I.
dim [Fri, 27 May 2016 20:45:32 +0000 (20:45 +0000)]
After r300770, for libc++ and libcxxrt, use -isystem instead of -I.
This should fix builds with external gcc toolchains from ports, which
also use -isystem to work around problems with gcc's --sysroot
implementation.  Thanks to Bryan Drewery for this workaround.

8 years agoGo back to unconditionally compiling modules/gpio now that the parts of it
ian [Fri, 27 May 2016 20:43:46 +0000 (20:43 +0000)]
Go back to unconditionally compiling modules/gpio now that the parts of it
dependent on FDT support are conditionally compiled only on FDT platforms.

8 years agoDon't wrap the declaration of gpio_alloc_intr_resource() in #ifdef INTRNG,
ian [Fri, 27 May 2016 20:41:25 +0000 (20:41 +0000)]
Don't wrap the declaration of gpio_alloc_intr_resource() in #ifdef INTRNG,
wrap the implementation so that it returns an error if INTRNG support is
not available.  It should be possible to write a non-INTRNG implementation
of this function some day.  In the meantime, there is code that contains
calls to this function (so the decl is needed), but have runtime checks to
avoid calling it in the non-INTRNG case.

8 years agoUnbreak the zfs(4) build
ngie [Fri, 27 May 2016 20:33:38 +0000 (20:33 +0000)]
Unbreak the zfs(4) build

vm/vm_pageout.h grew a dependency on the bool typedef in r300865

arc.c didn't include sys/types.h, which included the definition for the typedef

Other items (ofed, drm2) might need to be chased for this commit.

X-MFC with: r300865
MFC after: 1 week
Pointyhat to: alc
Sponsored by: EMC / Isilon Storage Division

8 years agoMake PKG_VERSION aware of '-ALPHA*'.
gjb [Fri, 27 May 2016 20:33:14 +0000 (20:33 +0000)]
Make PKG_VERSION aware of '-ALPHA*'.

Submitted by: Ben Woods
Sponsored by: The FreeBSD Foundation

8 years agoRemove note about bogus chain-len maximum
ngie [Fri, 27 May 2016 20:12:32 +0000 (20:12 +0000)]
Remove note about bogus chain-len maximum

There's no current limit on chain-len with Broadwell DE chips; it isn't
enforced in software, and there doesn't appear to be a hardware limitation
either on the Intel Xeon D-1527 (Broadwell-DE) chip.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoOnly expose `hint_uaddr` in the ND_DEBUG case
ngie [Fri, 27 May 2016 19:30:13 +0000 (19:30 +0000)]
Only expose `hint_uaddr` in the ND_DEBUG case

This fixes a -Wunused-but-set-variable warning with gcc

MFC after: 1 week
Reported by: gcc 5
Sponsored by: EMC / Isilon Storage Division

8 years agoIf the I/O offset and length is multiple of the media size then
ambrisko [Fri, 27 May 2016 19:23:15 +0000 (19:23 +0000)]
If the I/O offset and length is multiple of the media size then
directly pass the request otherwise use a buffer that is a
multiple of the media size.  This speeds up I/O quite a bit
when using large transfer sizes on 4Kn disks etc.

MFC after: 1 week

8 years agoThe flag "vm_pages_needed" has long served two distinct purposes: (1) to
alc [Fri, 27 May 2016 19:15:45 +0000 (19:15 +0000)]
The flag "vm_pages_needed" has long served two distinct purposes: (1) to
indicate that threads are waiting for free pages to become available and
(2) to indicate whether a wakeup call has been sent to the page daemon.
The trouble is that a single flag cannot really serve both purposes, because
we have two distinct targets for when to wakeup threads waiting for free
pages versus when the page daemon has completed its work.  In particular,
the flag will be cleared by vm_page_free() before the page daemon has met
its target, and this can lead to the OOM killer being invoked prematurely.
To address this problem, a new flag "vm_pageout_wanted" is introduced.

Discussed with: jeff
Reviewed by: kib, markj
Tested by: markj
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove duplicate sentence from pfsync.8.
dru [Fri, 27 May 2016 18:52:58 +0000 (18:52 +0000)]
Remove duplicate sentence from pfsync.8.

PR: 209539
Submitted by: olivier@
Reviewed by: timmoore88@gmail.com
Sponsored by: iXsystems

8 years agoIn pmap_advise(), avoid leaking DI start for EPT pmaps which needs A/D
kib [Fri, 27 May 2016 18:45:11 +0000 (18:45 +0000)]
In pmap_advise(), avoid leaking DI start for EPT pmaps which needs A/D
emulation.  Assert that syscalls do not leak DI.

Reported by: gjb
Sponsored by: The FreeBSD Foundation

8 years agoInstall ioatcontrol to /usr/bin by default instead of /
ngie [Fri, 27 May 2016 18:40:38 +0000 (18:40 +0000)]
Install ioatcontrol to /usr/bin by default instead of /

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years ago- Sort make variables
ngie [Fri, 27 May 2016 18:39:47 +0000 (18:39 +0000)]
- Sort make variables
- Use SRCTOP instead of ad hoc definition for it

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoReplace linux-f10 packages with updated linux-c6.
gjb [Fri, 27 May 2016 18:20:07 +0000 (18:20 +0000)]
Replace linux-f10 packages with updated linux-c6.

PR:  208280
Submitted by:  Johannes Meixner
Sponsored by: The FreeBSD Foundation

8 years agoCorrect the implementation of dtrace_interrupt_disable/enable.
br [Fri, 27 May 2016 17:58:10 +0000 (17:58 +0000)]
Correct the implementation of dtrace_interrupt_disable/enable.

Pointed out by: andrew
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoFix description for -V in the -r case
ngie [Fri, 27 May 2016 17:57:30 +0000 (17:57 +0000)]
Fix description for -V in the -r case

t.verify_test = true is always set when -V is specified, regardless of whether
or not the tool is being run in raw mode

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoDocument the default behavior for -c (0)
ngie [Fri, 27 May 2016 17:44:30 +0000 (17:44 +0000)]
Document the default behavior for -c (0)

Bump .Dd for the change

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoInitialize `t` with memset(.., 0, ..)
ngie [Fri, 27 May 2016 17:42:59 +0000 (17:42 +0000)]
Initialize `t` with memset(.., 0, ..)

This will help ensure that we're not using random garbage on the stack by
accident with respect to the variable

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoWhen building modules, define make variable OPT_FDT if the kernel config
ian [Fri, 27 May 2016 17:40:29 +0000 (17:40 +0000)]
When building modules, define make variable OPT_FDT if the kernel config
includes the FDT option.  Use OPT_FDT to conditionally compile modules
that require FDT support.

In the past we've gotten away with using the arch name as a proxy for FDT
support in makefile conditional logic, but now mips has some platforms with
fdt support and some without and we need a more direct test.

8 years agoPlug route reference underleak that happens with FLOWTABLE after r297225.
glebius [Fri, 27 May 2016 17:31:02 +0000 (17:31 +0000)]
Plug route reference underleak that happens with FLOWTABLE after r297225.

Submitted by: Mike Karels <mike karels.net>

8 years agoDisconnect PIE from the build until it is free of floating point math.
truckman [Fri, 27 May 2016 17:07:07 +0000 (17:07 +0000)]
Disconnect PIE from the build until it is free of floating point math.

Reported by: lidl, adrian

8 years agofd: provide a common exit point for unlock in kern_dup
mjg [Fri, 27 May 2016 17:00:15 +0000 (17:00 +0000)]
fd: provide a common exit point for unlock in kern_dup

While here assert dropped filedesc lock on return from closefp.

8 years agoexec: get rid of one vnode lock/unlock pair in do_execve
mjg [Fri, 27 May 2016 15:03:38 +0000 (15:03 +0000)]
exec: get rid of one vnode lock/unlock pair in do_execve

The lock was temporarily dropped for vrele calls, but they can be
postponed to a point where the lock is not held in the first place.

While here shuffle other code not needing the lock.

8 years agoFix dtrace_interrupt_disable and dtrace_interrupt_enable by having the
andrew [Fri, 27 May 2016 12:02:12 +0000 (12:02 +0000)]
Fix dtrace_interrupt_disable and dtrace_interrupt_enable by having the
former return the current status for the latter to use. Without this we
could enable interrupts when they shouldn't be.

It's still not quite right as it should only update the bits we care about,
bit should be good enough until the correct fix can be tested.

PR: 204270
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agosfxge(4): fix typo in monitor types strings in common code
arybchik [Fri, 27 May 2016 11:50:26 +0000 (11:50 +0000)]
sfxge(4): fix typo in monitor types strings in common code

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agosfxge(4): avoid necessity to add one more constant condition note
arybchik [Fri, 27 May 2016 11:49:46 +0000 (11:49 +0000)]
sfxge(4): avoid necessity to add one more constant condition note

Use for forever loop instead of while.

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agosfxge(4): cope with always true unsigned comparison with 0 to make lint happier
arybchik [Fri, 27 May 2016 11:49:05 +0000 (11:49 +0000)]
sfxge(4): cope with always true unsigned comparison with 0 to make lint happier

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agosfxge(4): unsigned 1 should be shifted to produce bitmask
arybchik [Fri, 27 May 2016 11:48:25 +0000 (11:48 +0000)]
sfxge(4): unsigned 1 should be shifted to produce bitmask

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agosfxge(4): cope with lint for EFX_SET_OWORD_BIT() with const bit arg
arybchik [Fri, 27 May 2016 11:47:56 +0000 (11:47 +0000)]
sfxge(4): cope with lint for EFX_SET_OWORD_BIT() with const bit arg

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agosfxge(4): remove set but not used variable
arybchik [Fri, 27 May 2016 11:47:11 +0000 (11:47 +0000)]
sfxge(4): remove set but not used variable

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agoImprove error message when failing to open a backing file
bapt [Fri, 27 May 2016 11:46:54 +0000 (11:46 +0000)]
Improve error message when failing to open a backing file

When bhyve cannot open a backing file, it now says explicitly which file
could not be opened

Note that the change has only be maed in block_if.c and not in
pci_virtio_block.c as the error will always be catched by the first

PR: 202321 (different patch)
Reviewed by: grehan
MFC after: 3 day
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D6576

8 years agosfxge(4): remove unreachable break after goto
arybchik [Fri, 27 May 2016 11:46:35 +0000 (11:46 +0000)]
sfxge(4): remove unreachable break after goto

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agosfxge(4): add constant condition note to make lint happier
arybchik [Fri, 27 May 2016 11:45:42 +0000 (11:45 +0000)]
sfxge(4): add constant condition note to make lint happier

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agosfxge(4): note unused variables to make lint happier
arybchik [Fri, 27 May 2016 11:44:40 +0000 (11:44 +0000)]
sfxge(4): note unused variables to make lint happier

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agoAttach iser(4) to the build.
trasz [Fri, 27 May 2016 11:39:08 +0000 (11:39 +0000)]
Attach iser(4) to the build.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoBuild iscsi(4) with ICL_KERNEL_PROXY when building with WITH_OFED.
trasz [Fri, 27 May 2016 11:37:56 +0000 (11:37 +0000)]
Build iscsi(4) with ICL_KERNEL_PROXY when building with WITH_OFED.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix build on i386.
trasz [Fri, 27 May 2016 11:37:02 +0000 (11:37 +0000)]
Fix build on i386.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoQuell false positives in svc_vc_create and svc_vc_create_conn with cd and xprt
ngie [Fri, 27 May 2016 08:48:33 +0000 (08:48 +0000)]
Quell false positives in svc_vc_create and svc_vc_create_conn with cd and xprt

Both cd and xprt will be non-NULL after their respective malloc(9) wrappers are
called (mem_alloc and svc_xprt_alloc, which calls mem_alloc) as mem_alloc
always gets called with M_WAITOK|M_ZERO today. Thus, testing for them being
non-NULL is incorrect -- it misleads Coverity and it misleads the reader.

Remove some unnecessary NULL initializations as a follow up to help solidify
the fact that these pointers will be initialized properly in sys/rpc/.. with
the interfaces the way they are currently.

Differential Revision: https://reviews.freebsd.org/D6572
MFC after: 2 weeks
Reported by: Coverity
CID: 1007338, 1007339, 1007340
Reviewed by: markj, truckman
Sponsored by: EMC / Isilon Storage Division

8 years agoThe SCHEDULER_STOPPED() macro already contains a predict false statement.
hselasky [Fri, 27 May 2016 07:33:49 +0000 (07:33 +0000)]
The SCHEDULER_STOPPED() macro already contains a predict false statement.
Remove superfluous unlikely() wrapper.

Suggested by: glebius
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agohyperv: Test features before enabling optional functionalities
sephe [Fri, 27 May 2016 07:29:31 +0000 (07:29 +0000)]
hyperv: Test features before enabling optional functionalities

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6571

8 years ago[iwm] remove dead code.
adrian [Fri, 27 May 2016 07:10:11 +0000 (07:10 +0000)]
[iwm] remove dead code.

if_iwm - GC some dead code, left by a partially applied OpenBSD change.

Taken-From: OpenBSD (if_iwm.c r1.69)

Submitted by: Imre Vadasz <imre@vdsz.com>
Obtained from: DragonflyBSD git 07dfed32ea39b980b0b80d27ff938e7c3ca4c0b5

8 years agohyperv: Clean up Hyper-V timecounter a bit.
sephe [Fri, 27 May 2016 07:05:30 +0000 (07:05 +0000)]
hyperv: Clean up Hyper-V timecounter a bit.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6569

8 years agohyperv: GC unneeded bits
sephe [Fri, 27 May 2016 06:55:05 +0000 (06:55 +0000)]
hyperv: GC unneeded bits

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6568

8 years agohyperv/vmbus: Move MSR EOM to hyperv_reg.h
sephe [Fri, 27 May 2016 06:47:04 +0000 (06:47 +0000)]
hyperv/vmbus: Move MSR EOM to hyperv_reg.h

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6567

8 years agohyperv: Move timer related MSRs into hyperv_reg.h
sephe [Fri, 27 May 2016 06:12:43 +0000 (06:12 +0000)]
hyperv: Move timer related MSRs into hyperv_reg.h

And avoid bit fields for event timer.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6566

8 years agoUse vm_page_replace_checked() instead of vm_page_rename() for implementing
alc [Fri, 27 May 2016 06:05:12 +0000 (06:05 +0000)]
Use vm_page_replace_checked() instead of vm_page_rename() for implementing
optimized copy-on-write faults.  This has two advantages: (1) one less radix
tree operation is performed and (2) vm_page_replace_checked() cannot fail,
making the code simpler.

Submitted by: Ryan Libby
Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4478

8 years agohyperv: Move CPUID related bits to hyperv_reg.h and give them clean name
sephe [Fri, 27 May 2016 05:58:53 +0000 (05:58 +0000)]
hyperv: Move CPUID related bits to hyperv_reg.h and give them clean name

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6565

8 years agolibmd: Work around C++'s inability to understand C
cem [Fri, 27 May 2016 05:31:14 +0000 (05:31 +0000)]
libmd: Work around C++'s inability to understand C

Reported by: antoine@ (x265)

8 years agoFix parallel builds by specifying *all* required headers in SRCS.
ian [Fri, 27 May 2016 04:34:42 +0000 (04:34 +0000)]
Fix parallel builds by specifying *all* required headers in SRCS.

Submitted by: manu
Pointy hat: ian

8 years agogcc42: Fix minor C99 parse bug
cem [Fri, 27 May 2016 03:40:52 +0000 (03:40 +0000)]
gcc42: Fix minor C99 parse bug

DR #289[0] came down and gcc4.2.1 was on the wrong side of history.
Partially revert GCC r42574 (just remove the error) to rectify the parse
bug to match Clang and other compliant C99 compilers.

An example declaration gcc tripped on before this fix:

  void foobar(int [static 1]);

An example declaration gcc did not trip on before this fix:

  void foobar(int name[static 1]);

Bump __FreeBSD_cc_version.

[0]: http://www.open-std.org/JTC1/SC22/WG14/www/docs/dr_289.htm

Reported by: allanjude
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd rtwn(4) and rtwnfw(4).
kevlo [Fri, 27 May 2016 03:30:42 +0000 (03:30 +0000)]
Add rtwn(4) and rtwnfw(4).

8 years agoImport Skein 1.3
allanjude [Fri, 27 May 2016 02:42:46 +0000 (02:42 +0000)]
Import Skein 1.3

Bruce Schneier's hashing algorithm

Used by newer versions of ZFS

8 years ago[gpio] add gpiospi to the gpio module.
adrian [Fri, 27 May 2016 01:42:55 +0000 (01:42 +0000)]
[gpio] add gpiospi to the gpio module.

8 years ago[spigen] add the userland ioctl API for spigen.
adrian [Fri, 27 May 2016 01:40:33 +0000 (01:40 +0000)]
[spigen] add the userland ioctl API for spigen.

8 years ago[gpiospi] add debug option.
adrian [Fri, 27 May 2016 01:36:29 +0000 (01:36 +0000)]
[gpiospi] add debug option.

This was missing from the previous commit that introduced gpiospi.
It's required for it to build.

Pointy-hat-to: me

8 years agoOnly build gpio modules on armv6, until it's known that they can be built
ian [Fri, 27 May 2016 01:14:35 +0000 (01:14 +0000)]
Only build gpio modules on armv6, until it's known that they can be built
succesfully on other arches.

8 years agoMake Makefile.mirrors -ALPHA${N}-aware.
gjb [Fri, 27 May 2016 01:07:48 +0000 (01:07 +0000)]
Make Makefile.mirrors -ALPHA${N}-aware.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoUpdate head from 11.0-CURRENT to 11.0-ALPHA1, marking the official
gjb [Fri, 27 May 2016 00:01:48 +0000 (00:01 +0000)]
Update head from 11.0-CURRENT to 11.0-ALPHA1, marking the official
start of the code slush.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoRevert changes for local testing, inadvertantly commited in r300811.
ian [Thu, 26 May 2016 23:59:42 +0000 (23:59 +0000)]
Revert changes for local testing, inadvertantly commited in r300811.

8 years agoAdd a PPS driver that takes the timing pulse from a gpio pin. Currently
ian [Thu, 26 May 2016 23:56:12 +0000 (23:56 +0000)]
Add a PPS driver that takes the timing pulse from a gpio pin.  Currently
supports only ofw/fdt systems.  Some day, hinted attachment for non-fdt
systems should be possible too.

8 years agoFix unit number of EFI net interfaces and ignore psuedo network interfaces.
jhb [Thu, 26 May 2016 23:32:28 +0000 (23:32 +0000)]
Fix unit number of EFI net interfaces and ignore psuedo network interfaces.

In r277943, the efinet_match() routine was changed to use an off by one
when matching network interfaces.  The effect was that using "net1"
actually used the device attached to "net0".

Digging into the hardware that needed this workaround more, I found that
UEFI was creating two simple network protocol devices for each physical
NIC.  The first device was a "raw" Ethernet device and the second device
was a "IP" device that used the IP protocol on top of the underlying
"raw" device.  The PXE code in the firmware used the "IP" device to pull
across the loader.efi, so currdev was set to "net1" when booting from the
physical interface "net0".  (The loaded image's device handle referenced
the "IP" device that "net1" claimed.)

However, the IP device isn't suitable for doing raw packet I/O (and the
current code to open devices exclusively actually turns the "IP" devices
off on these systems).

To fix, change the efinet driver to only attach to "raw" devices.  This
is determined by fetching the DEVICE_PATH for each handle which supports
the simple network protocol and examining the last node in the path.  If
the last node in the path is a MAC address, the device is assumed to be
a "raw" device and is added as a 'netX' device.  If the last node is not
a MAC address, the device is ignored.

However, this causes a new problem as the device handle associated with
the loaded image no longer matches any of the handles enumerated by
efinet for systems that load the image via the "IP" device.  To handle
this case, expand the logic that resolves currdev from the loaded image
in main().  First, the existing logic of looking for a handle that
matches the loaded image's handle is tried.  If that fails, the device
path of the handle that loaded the loaded image is fetched via
efi_lookup_image_devpath().  This device path is then walked from the
end up to the beginning using efi_handle_lookup() to fetch the handle
associated with a path.  If the handle is found and is a known handle,
then that is used as currdev.  The effect for machines that load the
image via the "IP" device is that the first lookup fails (the handle
for the "IP" device isn't claimed by efinet), but walking up the
image's device path finds the handle of the raw MAC device which is used
as currdev.

With these fixes in place, the hack to subtract 1 from the unit can now
be removed, so that setting currdev to 'net0' actually uses 'net0'.

PR: 202097
Tested by: ambrisko
Sponsored by: Cisco Systems