dim [Sat, 10 Jun 2017 19:17:14 +0000 (19:17 +0000)]
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305145, and update
build glue.
dim [Sat, 10 Jun 2017 13:44:06 +0000 (13:44 +0000)]
Vendor import of llvm trunk r305145:
https://llvm.org/svn/llvm-project/llvm/trunk@305145
dim [Sat, 10 Jun 2017 13:22:49 +0000 (13:22 +0000)]
Merge ^/head r319548 through r319778.
trasz [Sat, 10 Jun 2017 08:25:46 +0000 (08:25 +0000)]
Remove mentions of recently removed /usr/share/doc/ subdirectories
from hier(7).
trasz [Sat, 10 Jun 2017 08:08:14 +0000 (08:08 +0000)]
/usr/share/doc/bind is gone since
20040925.
MFC after: 2 weeks
trasz [Sat, 10 Jun 2017 08:01:05 +0000 (08:01 +0000)]
Improve formatting by removing yet another case of '-width ".Pa'.
MFC after: 2 weeks
trasz [Sat, 10 Jun 2017 07:47:21 +0000 (07:47 +0000)]
Remove /usr/include/readline/ from hier(7); it's long gone.
trasz [Sat, 10 Jun 2017 07:43:24 +0000 (07:43 +0000)]
Remove groff(1) leftovers from hier(7).
avg [Sat, 10 Jun 2017 06:13:52 +0000 (06:13 +0000)]
follow up to r319746: add the new test files to the make file
Reported by: markj
MFC after: 2 days
X-MFC with: r319746
jhb [Sat, 10 Jun 2017 01:32:35 +0000 (01:32 +0000)]
Decode arguments to rtprio() and rtprio_thread().
jhb [Sat, 10 Jun 2017 01:32:18 +0000 (01:32 +0000)]
Decode arguments to rtprio_thread() (same as rtprio()).
jhb [Sat, 10 Jun 2017 01:22:40 +0000 (01:22 +0000)]
Decode the 'howto' argument to reboot().
jhb [Sat, 10 Jun 2017 01:20:08 +0000 (01:20 +0000)]
Improve decoding of RB_AUTOBOOT in the 'howto' argument to reboot().
The reboot() system call accepts a mode (RB_AUTOBOOT, RB_HALT, RB_POWEROFF,
or RB_REROOT) as well as zero or more optional flags in 'howto'.
However, RB_AUTOBOOT was only displayed if 'howto' was exactly 0.
Combinations like 'RB_AUTOBOOT | RB_DUMP' were decoded as 'RB_DUMP'.
Instead, imply that RB_AUTOBOOT was specified if none of the other "mode"
flags were specified.
jhb [Sat, 10 Jun 2017 00:53:00 +0000 (00:53 +0000)]
Decode the arguments to quotactl().
jhb [Sat, 10 Jun 2017 00:45:07 +0000 (00:45 +0000)]
Decode the arguments to ptrace().
This does not decode structures returned by ptrace().
jhb [Sat, 10 Jun 2017 00:37:02 +0000 (00:37 +0000)]
Decode arguments to getpriority() and setpriority().
jhb [Sat, 10 Jun 2017 00:35:45 +0000 (00:35 +0000)]
Fix decoding of setpriority() arguments.
The PRIO_* 'which' value is stored in the first argument to setpriority(2),
not the last. While here, decode the arguments to getpriority(2).
loos [Fri, 9 Jun 2017 20:38:18 +0000 (20:38 +0000)]
Remove an unnecessary variable from the switch softc structure and make the
functions that are used as booleans return real boolean values.
Sponsored by: Rubicon Communications, LLC (Netgate)
jhibbits [Fri, 9 Jun 2017 20:26:42 +0000 (20:26 +0000)]
Follow up r313841 on powerpc
Close a potential race in reading the CPU dtrace flags, where a thread can
start on one CPU, and partway through retrieving the flags be swapped out,
while another thread traps and sets the CPU_DTRACE_NOFAULT. This could
cause the first thread to return without handling the fault.
Discussed with: markj@
markj [Fri, 9 Jun 2017 19:57:27 +0000 (19:57 +0000)]
Implement pci_disable_device() in the LinuxKPI.
Submitted by: kmacy
MFC after: 2 weeks
markj [Fri, 9 Jun 2017 19:41:12 +0000 (19:41 +0000)]
Augment wait queue support in the LinuxKPI.
In particular:
- Don't evaluate event conditions with a sleepqueue lock held, since such
code may attempt to acquire arbitrary locks.
- Fix the return value for wait_event_interruptible() in the case that the
wait is interrupted by a signal.
- Implement wait_on_bit_timeout() and wait_on_atomic_t().
- Implement some functions used to test for pending signals.
- Implement a number of wait_event_*() variants and unify the existing
implementations.
- Unify the mechanism used by wait_event_*() and schedule() to put the
calling thread to sleep.
This is required to support updated DRM drivers. Thanks to hselasky for
finding and fixing a number of bugs in the original revision.
Reviewed by: hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10986
alc [Fri, 9 Jun 2017 17:19:27 +0000 (17:19 +0000)]
Style and comment fixes only.
Reviewed by: kib
MFC after: 6 weeks
alc [Fri, 9 Jun 2017 16:19:24 +0000 (16:19 +0000)]
blist_fill()'s return type is too narrow. blist_fill() accepts a 64-bit
quantity as the size of the range to fill, but returns a 32-bit quantity
as the number of blocks that were allocated to fill that range. This
revision corrects that mismatch. Currently, swaponsomething() limits
the size of a swap area to prevent arithmetic arithmetic overflow in
other parts of the blist allocator. That limit has also prevented this
type mismatch from causing problems.
Reviewed by: kib, markj
MFC after: 6 weeks
Differential Revision: https://reviews.freebsd.org/D11096
glebius [Fri, 9 Jun 2017 15:54:48 +0000 (15:54 +0000)]
Fix stat(2) on a listening socket.
andrew [Fri, 9 Jun 2017 15:47:14 +0000 (15:47 +0000)]
Allow the arm64 machine/vfp.h to be included without first including
machine/pcb.h. It he latter is only needed for struct pcb.
andrew [Fri, 9 Jun 2017 15:37:17 +0000 (15:37 +0000)]
Store the read-only thread pointer when scheduling a new thread. This is
not currently set, however we may wish to set it later.
avg [Fri, 9 Jun 2017 15:30:41 +0000 (15:30 +0000)]
MFV r319740: 8168 NULL pointer dereference in zfs_create()
illumos/illumos-gate@
690031d326342fa4ea28b5e80f1ad6a16281519d
https://github.com/illumos/illumos-gate/commit/
690031d326342fa4ea28b5e80f1ad6a16281519d
https://www.illumos.org/issues/8168
If we manage to export the pool on which we are creating a dataset (filesystem
or zvol) between entering libzfs`zfs_create() and libzfs`zpool_open() call (for
which we never check the return value) we end up dereferencing a NULL pointer
in libzfs`zpool_close().
This was discovered on ZFS on Linux. The same issue can be reproduced on
Illumos running in parallel:
while :; do zpool import -d /tmp testpool ; zpool export testpool ; done
while :; do zfs create testpool/fs; zfs destroy testpool/fs ; done
Eventually this will result in several core dumps like this one:
[root@52-54-00-d3-7a-01 /cores]# mdb core.zfs.4244
Loading modules: [ libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1
libnvpair.so.1 ld.so.1 ]
> ::stack
libzfs.so.1`zpool_close+0x17(0, 0, 0, 8047450)
libzfs.so.1`zfs_create+0x1bb(8090548, 8047e6f, 1, 808cba8)
zfs_do_create+0x545(2, 8047d74, 80778a0, 801, 0, 3)
main+0x22c(8047d2c,
fef5c6e8, 8047d64, 8055a17, 3, 8047d70)
_start+0x83(3, 8047e64, 8047e68, 8047e6f, 0, 8047e7b)
>
Fix and reproducer (systemtap): https://github.com/zfsonlinux/zfs/pull/6096
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
MFC after: 2 weeks
avg [Fri, 9 Jun 2017 15:28:57 +0000 (15:28 +0000)]
MFV r319741: 8156 dbuf_evict_notify() does not need dbuf_evict_lock
illumos/illumos-gate@
dbfd9f930004c390a2ce2cf850c71b4f880eef9c
https://github.com/illumos/illumos-gate/commit/
dbfd9f930004c390a2ce2cf850c71b4f880eef9c
https://www.illumos.org/issues/8156
dbuf_evict_notify() holds the dbuf_evict_lock while checking if it should do
the eviction itself (because the evict thread is not able to keep up).
This can result in massive lock contention.
It isn't necessary to hold the lock, because if we make the wrong choice
occasionally, nothing bad will happen.
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>
MFC after: 1 week
avg [Fri, 9 Jun 2017 15:27:22 +0000 (15:27 +0000)]
MFV r319739: 8005 poor performance of 1MB writes on certain RAID-Z configurations
illumos/illumos-gate@
5b062782532a1d5961c4a4b655906e1238c7c908
https://github.com/illumos/illumos-gate/commit/
5b062782532a1d5961c4a4b655906e1238c7c908
https://www.illumos.org/issues/8005
RAID-Z requires that space be allocated in multiples of P+1 sectors,
because this is the minimum size block that can have the required amount
of parity. Thus blocks on RAIDZ1 must be allocated in a multiple of 2
sectors; on RAIDZ2 multiple of 3; and on RAIDZ3 multiple of 4. A sector
is a unit of 2^ashift bytes, typically 512B or 4KB.
To satisfy this constraint, the allocation size is rounded up to the
proper multiple, resulting in up to 3 "pad sectors" at the end of some
blocks. The contents of these pad sectors are not used, so we do not
need to read or write these sectors. However, some storage hardware
performs much worse (around 1/2 as fast) on mostly-contiguous writes
when there are small gaps of non-overwritten data between the writes.
Therefore, ZFS creates "optional" zio's when writing RAID-Z blocks that
include pad sectors. If writing a pad sector will fill the gap between
two (required) writes, we will issue the optional zio, thus doubling
performance. The gap-filling performance improvement was introduced in
July 2009.
Writing the optional zio is done by the io aggregation code in
vdev_queue.c. The problem is that it is also subject to the limit on
the size of aggregate writes, zfs_vdev_aggregation_limit, which is by
default 128KB. For a given block, if the amount of data plus padding
written to a leaf device exceeds zfs_vdev_aggregation_limit, the
optional zio will not be written, resulting in a ~2x performance
degradation.
The problem occurs only for certain values of ashift, compressed block
size, and RAID-Z configuration (number of parity and data disks). It
cannot occur with the default recordsize=128KB. If compression is
enabled, all configurations with recordsize=1MB or larger will be
impacted to some degree.
The problem notably occurs with recordsize=1MB, compression=off, with 10
disks in a RAIDZ2 or RAIDZ3 group (with 512B or 4KB sectors). Therefore
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>
MFC after: 10 days
avg [Fri, 9 Jun 2017 15:26:03 +0000 (15:26 +0000)]
MFV r319738: 8155 simplify dmu_write_policy handling of pre-compressed buffers
illumos/illumos-gate@
adaec86ad212d9fd756bee322934fa54d1258605
https://github.com/illumos/illumos-gate/commit/
adaec86ad212d9fd756bee322934fa54d1258605
https://www.illumos.org/issues/8155
When writing pre-compressed buffers, arc_write() requires that the compression
algorithm used to compress the buffer matches the compression algorithm
requested by the zio_prop_t, which is set by dmu_write_policy().
This makes dmu_write_policy() and its callers a bit more complicated.
We can simplify this by making arc_write() trust the caller to supply the type
of pre-compressed buffer that it wants to write, and override the compression
setting in the zio_prop_t.
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>
MFC after: 10 days
avg [Fri, 9 Jun 2017 15:21:28 +0000 (15:21 +0000)]
remove an unrelated local change from r319746
MFC after: 1 day
X-MFC with: r319746
avg [Fri, 9 Jun 2017 15:16:39 +0000 (15:16 +0000)]
MFV r319744,r319745: 8269 dtrace stddev aggregation is normalized incorrectly
illumos/illumos-gate@
79809f9cf402f130667349b2d4007ecd65d63c6f
https://github.com/illumos/illumos-gate/commit/
79809f9cf402f130667349b2d4007ecd65d63c6f
https://www.illumos.org/issues/8269
It seems that currently normalization of stddev aggregation is done
incorrectly.
We divide both the sum of values and the sum of their squares by the
normalization factor. But we should divide the sum of squares by the
normalization factor squared to scale the original values properly.
FreeBSD note: the actual change was committed in r316853, this commit
adds the test files and record merge information.
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
MFC after: 1 week
Sponsored by: Panzura
avg [Fri, 9 Jun 2017 15:06:50 +0000 (15:06 +0000)]
fix up r319744, add new files
8269 dtrace stddev aggregation is normalized incorrectly
illumos/illumos-gate@
79809f9cf402f130667349b2d4007ecd65d63c6f
https://github.com/illumos/illumos-gate/commit/
79809f9cf402f130667349b2d4007ecd65d63c6f
https://www.illumos.org/issues/8269
It seems that currently normalization of stddev aggregation is done
incorrectly.
We divide both the sum of values and the sum of their squares by the
normalization factor. But we should divide the sum of squares by the
normalization factor squared to scale the original values properly.
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
avg [Fri, 9 Jun 2017 15:04:10 +0000 (15:04 +0000)]
8269 dtrace stddev aggregation is normalized incorrectly
illumos/illumos-gate@
79809f9cf402f130667349b2d4007ecd65d63c6f
https://github.com/illumos/illumos-gate/commit/
79809f9cf402f130667349b2d4007ecd65d63c6f
https://www.illumos.org/issues/8269
It seems that currently normalization of stddev aggregation is done
incorrectly.
We divide both the sum of values and the sum of their squares by the
normalization factor. But we should divide the sum of squares by the
normalization factor squared to scale the original values properly.
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
avg [Fri, 9 Jun 2017 15:03:07 +0000 (15:03 +0000)]
8108 zdb -l fails to read labels 2 and 3
illumos/illumos-gate@
22c8b9583d07895c16549075a53668d7bc988cf3
https://github.com/illumos/illumos-gate/commit/
22c8b9583d07895c16549075a53668d7bc988cf3
https://www.illumos.org/issues/8108
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>
avg [Fri, 9 Jun 2017 15:00:13 +0000 (15:00 +0000)]
8168 NULL pointer dereference in zfs_create()
illumos/illumos-gate@
690031d326342fa4ea28b5e80f1ad6a16281519d
https://github.com/illumos/illumos-gate/commit/
690031d326342fa4ea28b5e80f1ad6a16281519d
https://www.illumos.org/issues/8168
If we manage to export the pool on which we are creating a dataset (filesystem
or zvol) between entering libzfs`zfs_create() and libzfs`zpool_open() call (for
which we never check the return value) we end up dereferencing a NULL pointer
in libzfs`zpool_close().
This was discovered on ZFS on Linux. The same issue can be reproduced on
Illumos running in parallel:
while :; do zpool import -d /tmp testpool ; zpool export testpool ; done
while :; do zfs create testpool/fs; zfs destroy testpool/fs ; done
Eventually this will result in several core dumps like this one:
[root@52-54-00-d3-7a-01 /cores]# mdb core.zfs.4244
Loading modules: [ libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1
libnvpair.so.1 ld.so.1 ]
> ::stack
libzfs.so.1`zpool_close+0x17(0, 0, 0, 8047450)
libzfs.so.1`zfs_create+0x1bb(8090548, 8047e6f, 1, 808cba8)
zfs_do_create+0x545(2, 8047d74, 80778a0, 801, 0, 3)
main+0x22c(8047d2c,
fef5c6e8, 8047d64, 8055a17, 3, 8047d70)
_start+0x83(3, 8047e64, 8047e68, 8047e6f, 0, 8047e7b)
>
Fix and reproducer (systemtap): https://github.com/zfsonlinux/zfs/pull/6096
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
kib [Fri, 9 Jun 2017 12:06:22 +0000 (12:06 +0000)]
Remove msdosfs -o large support.
Its purpose was to translate the values for msdosfs inode numbers,
which is calculated from the msdosfs structures describing the file,
into the range representable by 32bit ino_t. The translation acted
for filesystems larger than 128Gb, it reserved the range 0xf0000000
(FILENO_FIRST_DYN) to UINT32_MAX and remembered some arbitrary
translation of ino >= FILENO_FIRST_DYN into this range. It consumed
memory that could be only freed by unmount, and the translation was
not stable across remounts.
With ino_t type extended to 64 bit, there is no such issue and values
can be returned without compaction to 32bit. That is, for the native
environments, the translation layer is not necessary and adds
significant undeserved code complexity. For compat ABIs which use
32bit ino_t, the vfs.ino64_trunc_error sysctl provides some measures
to soften the failure mode when inode numbers truncation is not safe.
Discussed with: bde
Sponsored by: The FreeBSD Foundation
kib [Fri, 9 Jun 2017 11:17:08 +0000 (11:17 +0000)]
Enhance vfs.ino64_trunc_error sysctl.
Provide a new mode "2" which returns a special overflow indicator in
the non-representable field instead of the silent truncation (mode
"0") or EOVERFLOW (mode "1").
In particular, the typical use of st_ino to detect hard links with
mode "2" reports false positives, which might be more suitable for
some uses.
Discussed with: bde
Sponsored by: The FreeBSD Foundation
avos [Fri, 9 Jun 2017 07:08:58 +0000 (07:08 +0000)]
rtwn: rename module (if_rtwn.ko -> rtwn.ko) to match module name + drop
manpage link.
Reported by: mav, hselasky
phil [Fri, 9 Jun 2017 03:32:49 +0000 (03:32 +0000)]
Import libxo-0.8.1 with official fix to today's build break.
Submitted by: phil
jhb [Thu, 8 Jun 2017 21:34:54 +0000 (21:34 +0000)]
Add the ccr0 device to the opencrypto tests against the NIST KAT tests.
The ccr0 device supports both AES and SHA tests.
Sponsored by: Chelsio Communications
glebius [Thu, 8 Jun 2017 21:33:19 +0000 (21:33 +0000)]
When we are in UMA_STARTUP use startup_alloc() for any zone, not for
internal zones only. This allows to create new zones at early stages
of boot, without need to mark them as internal to UMA, which isn't
always true.
Reviewed by: alc
jhb [Thu, 8 Jun 2017 21:33:10 +0000 (21:33 +0000)]
Fix the software fallback for GCM to validate the existing tag for decrypts.
Sponsored by: Chelsio Communications
glebius [Thu, 8 Jun 2017 21:30:34 +0000 (21:30 +0000)]
Listening sockets improvements.
o Separate fields of struct socket that belong to listening from
fields that belong to normal dataflow, and unionize them. This
shrinks the structure a bit.
- Take out selinfo's from the socket buffers into the socket. The
first reason is to support braindamaged scenario when a socket is
added to kevent(2) and then listen(2) is cast on it. The second
reason is that there is future plan to make socket buffers pluggable,
so that for a dataflow socket a socket buffer can be changed, and
in this case we also want to keep same selinfos through the lifetime
of a socket.
- Remove struct struct so_accf. Since now listening stuff no longer
affects struct socket size, just move its fields into listening part
of the union.
- Provide sol_upcall field and enforce that so_upcall_set() may be called
only on a dataflow socket, which has buffers, and for listening sockets
provide solisten_upcall_set().
o Remove ACCEPT_LOCK() global.
- Add a mutex to socket, to be used instead of socket buffer lock to lock
fields of struct socket that don't belong to a socket buffer.
- Allow to acquire two socket locks, but the first one must belong to a
listening socket.
- Make soref()/sorele() to use atomic(9). This allows in some situations
to do soref() without owning socket lock. There is place for improvement
here, it is possible to make sorele() also to lock optionally.
- Most protocols aren't touched by this change, except UNIX local sockets.
See below for more information.
o Reduce copy-and-paste in kernel modules that accept connections from
listening sockets: provide function solisten_dequeue(), and use it in
the following modules: ctl(4), iscsi(4), ng_btsocket(4), ng_ksocket(4),
infiniband, rpc.
o UNIX local sockets.
- Removal of ACCEPT_LOCK() global uncovered several races in the UNIX
local sockets. Most races exist around spawning a new socket, when we
are connecting to a local listening socket. To cover them, we need to
hold locks on both PCBs when spawning a third one. This means holding
them across sonewconn(). This creates a LOR between pcb locks and
unp_list_lock.
- To fix the new LOR, abandon the global unp_list_lock in favor of global
unp_link_lock. Indeed, separating these two locks didn't provide us any
extra parralelism in the UNIX sockets.
- Now call into uipc_attach() may happen with unp_link_lock hold if, we
are accepting, or without unp_link_lock in case if we are just creating
a socket.
- Another problem in UNIX sockets is that uipc_close() basicly did nothing
for a listening socket. The vnode remained opened for connections. This
is fixed by removing vnode in uipc_close(). Maybe the right way would be
to do it for all sockets (not only listening), simply move the vnode
teardown from uipc_detach() to uipc_close()?
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D9770
jhb [Thu, 8 Jun 2017 21:06:18 +0000 (21:06 +0000)]
Add explicit handling for requests with an empty payload.
- For HMAC requests, construct a special input buffer to request an empty
hash result.
- For plain cipher requests and requests that chain an AES cipher with an
HMAC, fail with EINVAL if there is no cipher payload. If needed in
the future, chained requests that only contain AAD could be serviced as
HMAC-only requests.
- For GCM requests, the hardware does not support generating the tag for
an AAD-only request. Instead, complete these requests synchronously
in software on the assumption that such requests are rare.
Sponsored by: Chelsio Communications
jtl [Thu, 8 Jun 2017 20:47:18 +0000 (20:47 +0000)]
With EARLY_AP_STARTUP enabled, we are seeing crashes in softclock_call_cc()
during bootup. Debugging information shows that softclock_call_cc() is
trying to execute the vt_consdev.vd_timer callout, and the callout
structure contains a NULL c_func.
This appears to be due to a race between vt_upgrade() running
callout_reset() and vt_resume_flush_timer() calling callout_schedule().
Fix the race by ensuring that vd_timer_armed is always set before
attempting to (re)schedule the callout.
Discussed with: emaste
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D9828
jtl [Thu, 8 Jun 2017 20:41:28 +0000 (20:41 +0000)]
Add the infrastructure to support loading multiple versions of TCP
stack modules.
It adds support for mangling symbols exported by a module by prepending
a string to them. (This avoids overlapping symbols in the kernel linker.)
It allows the use of a macro as the module name in the DECLARE_MACRO()
and MACRO_VERSION() macros.
It allows the code to register stack aliases (e.g. both a generic name
["default"] and version-specific name ["default_10_3p1"]).
With these changes, it is trivial to compile TCP stack modules with
the name defined in the Makefile and to load multiple versions of the
same stack simultaneously. This functionality can be used to enable
side-by-side testing of an old and new version of the same TCP stack.
It also could support upgrading the TCP stack without a reboot.
Reviewed by: gnn, sjg (makefiles only)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D11086
emaste [Thu, 8 Jun 2017 20:06:09 +0000 (20:06 +0000)]
arm64: add ".arch armv8-a+crc" to allow use of crc instructions
With Clang 5.0 the .arch directive is required, otherwise Clang
complains "error: instruction requires: crc".
This was reported in D10499 but not added initially, because clang 3.8
available on a ref machine reported unknown directive. Clang 4.0 allows
but does not require the directive.
Submitted by: andrew
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
bapt [Thu, 8 Jun 2017 19:40:00 +0000 (19:40 +0000)]
Import mandoc snapshot 2017-06-08
It implements missing man(7) macros used in base by kerberos/ntp and makes them
supported by mandoc.
This import should have been done before the removal of groff.
Reported by: gordon
bapt [Thu, 8 Jun 2017 19:29:07 +0000 (19:29 +0000)]
Import mandoc 2017-06-08
asomers [Thu, 8 Jun 2017 19:09:55 +0000 (19:09 +0000)]
Add tests for ln(1)
* Verify that when creating a hard link to a symbolic link, '-L' option
creates a hard link to the target of the symbolic link
* Verify that when creating a hard link to a symbolic link, '-P' option
creates a hard link to the symbolic link itself
* Verify that if the target file already exists, '-f' option unlinks it so
that link may occur
* Verify that if the target file or directory is a symbolic link, '-shf'
option prevents following the link
* Verify that if the target file or directory is a symbolic link, '-snf'
option prevents following the link
* Verify that '-s' option creates a symbolic link
* Verify that '-w' option produces a warning if the source of a symbolic
link does not currently exist
Submitted by: shivansh
Reviewed by: asomers, ngie
MFC after: 1 month
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D11084
jkim [Thu, 8 Jun 2017 18:20:32 +0000 (18:20 +0000)]
Correct an obsolete path to delete.
bapt [Thu, 8 Jun 2017 17:06:16 +0000 (17:06 +0000)]
Bump _FreeBSD_version after removal of groff
Reported by: antoine
phil [Thu, 8 Jun 2017 17:00:40 +0000 (17:00 +0000)]
remove xo_color_t dup typedef
zbb [Thu, 8 Jun 2017 16:57:06 +0000 (16:57 +0000)]
Add function to dump PCIE MBUS decoding windows and bars
This commit allows to dump PCIE MBUS and bars configuration
for Marvell platforms.
Submitted by: Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Netgate
Differential revision: https://reviews.freebsd.org/D10908
zbb [Thu, 8 Jun 2017 16:55:58 +0000 (16:55 +0000)]
Restore DTS node of PCIe controller for A38X boards
Add pcie-controller node as a bus-parent of pcie nodes for Armada38x
boards. This reduces diff between Linux and FreeBSD PCIe device tree
representation to the minimum. This commit also allows for using multiple
PCIe ports, thanks to the recent driver updates, which support such
hierarchy. Restore original PCIe nodes in armada-385.dtsi and
apply necessary changes in hitherto unused armada-380.dtsi.
Submitted by: Michal Mazur <mkm@semihalf.com>
Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield, Netgate
Differential revision: https://reviews.freebsd.org/D10907
zbb [Thu, 8 Jun 2017 16:54:02 +0000 (16:54 +0000)]
Support multi-port PCIe hierarchy in Marvell boards DTS
This commit is another part of preparation for PCIe multi-port
support for Marvell SoCs. Some device trees include pcie-controller
node as a bus-parent of pcie nodes. This patch adds support for
new bus, collects and configures device informations and finally
adds PCIB devices as a childs of pcie-controller in Newbus hierarchy.
Submitted by: Marcin Mazurek <mma@semihalf.com>
Obtained form: Semihalf
Sponsored by: Stormshield
Reviewed by: https://reviews.freebsd.org/D10906
zbb [Thu, 8 Jun 2017 16:51:46 +0000 (16:51 +0000)]
Fix PCIe window decoding on Armada 38x
Original PCIe nodes for Marvell SoCs consists of ports' nodes
under main controller node. In order to properly parse
this kind of representation in DT a mechanism for traversing
through the tree required an update. Moreover, processing FDT
data consisting of more than 2 cells had to be fixed,
because the 'reg' property of mrvl,pcie node have additional
parameter in front of 64-bit address. It should be skipped
by default. This commit works properly with old mrvl,pcie
representation for Kirkwood and ArmadaXP SoCs.
Submitted by: Wojciech Macek <wma@semihalf.com>
Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield, Netgate
Differential revision: https://reviews.freebsd.org/D10905
zbb [Thu, 8 Jun 2017 16:48:09 +0000 (16:48 +0000)]
Enable MBUS bridge configuration in mv_rtc driver
This patch fixes sporadic problems with updating time
with mv_rtc driver by configuring access to it via MBUS.
For this purpose already existing second set of resources
in rtc@3800 node of Armada 38x DT is used.
Submitted by: Dominik Ermel <der@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D10901
zbb [Thu, 8 Jun 2017 16:46:38 +0000 (16:46 +0000)]
Add reset capability to mv_rtc driver
This commit enables optional reset of the RTC, in case
its registers' contents did not sustain the reboot or power-off/on
sequence. Without it, further usage of RTC is impossible
(e.g. writing values to RTC_TIME register will not succeed).
The reset is performed only if Clock Correction register
does not comprise RTC_NOMINAL_TIMING, what helps to distinguish,
whether the software configured RTC before or it comprises
the default value.
Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D10900
jhb [Thu, 8 Jun 2017 16:18:41 +0000 (16:18 +0000)]
Fix an off-by-one error in the VM page array on some systems.
r31386 changed how the size of the VM page array was calculated to be
less wasteful. For most systems, the amount of memory is divided by
the overhead required by each page (a page of data plus a struct vm_page)
to determine the maximum number of available pages. However, if the
remainder for the first non-available page was at least a page of data
(so that the only memory missing was a struct vm_page), this last page
was left in phys_avail[] but was not allocated an entry in the VM page
array. Handle this case by explicitly excluding the page from
phys_avail[].
Reviewed by: alc
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D11000
alc [Thu, 8 Jun 2017 15:48:54 +0000 (15:48 +0000)]
When allocating swap blocks, if the available number of free blocks in a
subtree is already zero, then setting the "largest contiguous free block"
hint for that subtree to anything other than zero makes no sense. To be
clear, assigning a value to the hint that is too large is not a correctness
problem, only a pessimization.
Dragonfly BSD has applied the same change to blst_meta_alloc() but not
blst_meta_fill().
MFC after: 6 weeks
phil [Thu, 8 Jun 2017 13:04:01 +0000 (13:04 +0000)]
Import libxo-0.8.0:
- addition of --libxo colors=xxxxx color map (so I never see "blue")
- fix bugs from -fsanitize=address and =undefined
- utf-8 changes (remove support fore 6 byte utf-8 values, which are "historical")
- add comments
- fix man pages
- update test cases
Submitted by: phil
Reviewed by: sjg
Approved by: sjg (mentor)
dexuan [Thu, 8 Jun 2017 12:11:30 +0000 (12:11 +0000)]
hyperv/pcib: use the device serial number as PCI domain
Currently the PCI domain is initialized with the instance GUID in
vmbus_pcib_attach(). It turns out the GUID can change across VM reboot,
while some users want a persistent value for PCI domain. The solution is
that we can change to use the device serial number, which starts with 1
and is unique within a VM.
Obtained from: Haiyang Zhang
MFC after: 1 day
Sponsored by: Microsoft
jhb [Thu, 8 Jun 2017 08:10:57 +0000 (08:10 +0000)]
Decode arguments passed to msync().
jhb [Thu, 8 Jun 2017 08:07:51 +0000 (08:07 +0000)]
Decode flags passed to mount(), nmount(), and unmount().
glebius [Thu, 8 Jun 2017 06:37:11 +0000 (06:37 +0000)]
This code was missing socket unlock and socket buffer lock, but it
worked since right now these two locks are the same.
glebius [Thu, 8 Jun 2017 06:34:09 +0000 (06:34 +0000)]
The desired lock here is socket buffer, not socket.
Right now they match, but won't in future.
glebius [Thu, 8 Jun 2017 06:16:47 +0000 (06:16 +0000)]
Fix a degenerate case when soisdisconnected() would call soisconnected().
This happens when closing a socket with upcall, and trace is: soclose()->
... protocol ... -> soisdisconnected() -> socantrcvmore_locked() ->
sowakeup() -> soisconnected().
Right now this case is innocent for two reasons. First, soisconnected()
doesn't clear SS_ISDISCONNECTED flag. Second, the mutex to lock the
socket is the socket receive buffer mutex, and sodisconnected() first
disables the receive buffer. But in future code, the mutex to lock
socket is different to buffer mutex, and we would get undesired mutex
recursion.
The fix is to check SS_ISDISCONNECTED flag before calling upcall.
glebius [Thu, 8 Jun 2017 06:13:53 +0000 (06:13 +0000)]
Make the test to leave one connection on the incomplete queue
before exiting. This examines some race conditions in kernel.
glebius [Thu, 8 Jun 2017 05:12:11 +0000 (05:12 +0000)]
Improve this unit test: make sure that the accept filter actually works.
Before this test just checked scenario of setting and removing the accept
filter at different states of the socket. Now it also checks that accept
filter works: we connect to the server, and then check that we can't accept,
then we send 1 byte of data and check again.
araujo [Thu, 8 Jun 2017 04:54:15 +0000 (04:54 +0000)]
Make the VNC authentication build with LibreSSL on HardenedBSD and TrueOS.
PR: 219790
Submitted by: Shirkdog <mshirk@daemon-security.com>
Reviewed by: grehan and rgrimes
MFC after: 4 weeks.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D11071
jhb [Thu, 8 Jun 2017 04:50:50 +0000 (04:50 +0000)]
Decode arguments to mlock(), mlockall(), and munlock().
jhb [Thu, 8 Jun 2017 04:45:13 +0000 (04:45 +0000)]
Decode arguments to minherit().
jhb [Thu, 8 Jun 2017 04:31:15 +0000 (04:31 +0000)]
Decode arguments passed to extended attribute related system calls.
The cmd argument passed to extattrctl() is not decoded as a string constant
but is just printed in hex. The value is filesystem-specific but in
practice is only used with UFS1 filesystems.
araujo [Thu, 8 Jun 2017 04:02:14 +0000 (04:02 +0000)]
Allow sysctl kern.vm_guest to return bhyve when running under bhyve.
Submitted by: Sean Fagan <sef@ixsystems.com>
Reviewed by: grehan
MFH: 4 weeks.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D11090
jhb [Thu, 8 Jun 2017 03:51:17 +0000 (03:51 +0000)]
Decode arguments to ACL related system calls.
This only decodes the raw arguments but not the contents of the struct acl
objects.
pfg [Thu, 8 Jun 2017 03:15:08 +0000 (03:15 +0000)]
patch: if reading fails, do not go into infinite loop asking for a filename.
This can happen if no tty is available.
Obtained from: OpenBSD (CVS rev 1.54)
MFC after: 5 days
jhibbits [Thu, 8 Jun 2017 02:44:34 +0000 (02:44 +0000)]
Remove ARM and MIPS from linuxkpi ioremap_attr definition
ARM and MIPS fail universe builds.
ARM and MIPS are missing the following:
* VM_MEMATTR_WRITE_THROUGH
* VM_MEMATTR_WRITE_COMBINING
Pointy-hat to: jhibbits
ultima [Thu, 8 Jun 2017 01:42:32 +0000 (01:42 +0000)]
Add myself (ultima) as a new port committer.
Reviewed by: matthew (mentor), lifanov (mentor)
Approved by: matthew (mentor), lifanov (mentor)
Differential Revision: https://reviews.freebsd.org/D11089
bapt [Thu, 8 Jun 2017 01:41:20 +0000 (01:41 +0000)]
Remove directories for the roff documentations which is built and installed
anymore
Reported by: trasz
allanjude [Thu, 8 Jun 2017 01:39:17 +0000 (01:39 +0000)]
New sentences start on new lines, fix two violations
Reviewed by: bcr
Sponsored by: BSDCan Dev Summit
allanjude [Thu, 8 Jun 2017 01:29:24 +0000 (01:29 +0000)]
SHA-512 and Skein have been supported by the boot loader for some time.
Submitted by: lifanov
Reviewed by: bcr
Sponsored by: BSDCan Dev Summit
jpaetzel [Thu, 8 Jun 2017 00:48:26 +0000 (00:48 +0000)]
Fix SMBFS when saved passwords are greater than 18 characters
PR: 132302
Submitted by: dhorn2000@gmail.com guru@unixarea.de
MFC after: 1 week
bapt [Thu, 8 Jun 2017 00:41:25 +0000 (00:41 +0000)]
Fix src.conf.5 generation
When makeman is generating src.conf(5) it tries to test all variation of options
including WITH_DIRDEPS_BUILD. it results in an error when filemon(4) is not
loaded.
Export variables that are needed to prevent this behaviour.
Helped by: sjg
bapt [Thu, 8 Jun 2017 00:36:58 +0000 (00:36 +0000)]
Regenerate src.conf.5 after removal of groff
bapt [Wed, 7 Jun 2017 23:42:37 +0000 (23:42 +0000)]
Remove some workaround for an option that does not exists anymore.
bapt [Wed, 7 Jun 2017 23:41:33 +0000 (23:41 +0000)]
Remove leftovers from groff removal
Reported by: rpokala
bapt [Wed, 7 Jun 2017 23:26:28 +0000 (23:26 +0000)]
Finish removal of groff
bapt [Wed, 7 Jun 2017 23:00:34 +0000 (23:00 +0000)]
Remove groff from base
All manpages in base are now compatible with mandoc(1), all roff documentation
will be relocated in the doc tree. man(1) can now use groff from the ports tree
if it needs.
Also remove checknr(1) and colcrt(1) which are only useful with groff.
Approved by: (no objections on the mailing lists)
jilles [Wed, 7 Jun 2017 21:21:14 +0000 (21:21 +0000)]
libc: Remove futimens() and utimensat() compat stubs.
The futimens() and utimensat() compat stubs allowed using these functions on
kernels that did not have the system calls yet (10.2, old 11-current).
Also remove the documentation of the [ENOTSUP] error that could occur with
an old kernel.
A -DNO_CLEAN build may fail because the depend files refer to the deleted
files.
ngie [Wed, 7 Jun 2017 21:18:28 +0000 (21:18 +0000)]
Add MLINKS for atf-sh(3) to each of the functions it implements
This hopefully will make atf-sh(3) easier to understand for newcomers,
without having to go through the atf-sh(3) level of indirection.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
ngie [Wed, 7 Jun 2017 21:14:06 +0000 (21:14 +0000)]
Remove incorrect manpage link I added for atf_check(1) in r319659 for
completeness.
MFC after: never
Sponsored by: Dell EMC Isilon
ngie [Wed, 7 Jun 2017 21:11:32 +0000 (21:11 +0000)]
Revert r319659
I missed the fact that atf-sh(3) already documents atf_check(3). I'll
be adding an manpage link for that instead in the next commit.
MFC after: 1 week
MFC with: r319659
Sponsored by: Dell EMC Isilon
ngie [Wed, 7 Jun 2017 21:03:27 +0000 (21:03 +0000)]
Add an MLINK for atf_check(1) -> atf-check(1)
This is being done to make the documentation for atf-check(1) easier to find/more
intuitive for new users, because atf_check is the atf-run(1) shell version of the
standalone atf-check(1) command, which is used in atf-sh(3) test programs.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
bdrewery [Wed, 7 Jun 2017 19:42:17 +0000 (19:42 +0000)]
vm.defer_swapspace_pageouts was removed in r308474.
Reported by: pstef
bdrewery [Wed, 7 Jun 2017 19:36:17 +0000 (19:36 +0000)]
vm.defer_swapspace_pageouts was removed in r308474.
jhibbits [Wed, 7 Jun 2017 18:08:11 +0000 (18:08 +0000)]
Add more #ifdef arch checks to the linuxkpi
arm, mips, and powerpc all implement pmap_mapdev_attr() and pmap_unmapdev(),
so add those archs to the checks. powerpc also includes the atomic_swap_*()
functions, so add that to the supported list as well. Not tested except by
compiling powerpc.
Reviewed by: markj
alc [Wed, 7 Jun 2017 16:04:34 +0000 (16:04 +0000)]
Originally, this file could be compiled as a user-space application for
testing purposes. However, over the years, various changes to the kernel
have broken this feature. This revision applies some fixes to get user-
space compilation working again. There are no changes in this revision
to code that is used by the kernel.
MFC after: 3 days
kevlo [Wed, 7 Jun 2017 09:10:24 +0000 (09:10 +0000)]
Change R88E_EFUSE_MAX_LEN to use the same value as the vendor's driver
that contains the length of the efuse content.
Reviewed by: avos