]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoAdd support for pmap_enter(..., psind=1) to the amd64 pmap. In other words,
alc [Sun, 23 Jul 2017 06:33:58 +0000 (06:33 +0000)]
Add support for pmap_enter(..., psind=1) to the amd64 pmap.  In other words,
add support for explicitly requesting that pmap_enter() create a 2MB page
mapping.  (Essentially, this feature allows the machine-independent layer to
create superpage mappings preemptively, and not wait for automatic promotion
to occur.)

Export pmap_ps_enabled() to the machine-independent layer.

Add a flag to pmap_pv_insert_pde() that specifies whether it should fail or
reclaim a PV entry when one is not available.

Refactor pmap_enter_pde() into two functions, one by the same name, that is
a general-purpose function for creating PDE PG_PS mappings, and another,
pmap_enter_2mpage(), that is used to prefault 2MB read- and/or execute-only
mappings for execve(2), mmap(2), and shmat(2).

Submitted by: Yufeng Zhou <yz70@rice.edu> (an earlier version)
Reviewed by: kib, markj
Tested by: pho
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D11556

6 years agoIn vm_page_ps_test(), always check that the base pages within the specified
alc [Sun, 23 Jul 2017 05:54:56 +0000 (05:54 +0000)]
In vm_page_ps_test(), always check that the base pages within the specified
superpage all belong to the same object.  To date, that check has not been
needed, but upcoming changes require it.  (See the Differential Revision.)

Reviewed by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11556

6 years agolinuxkpi compiler.h: avoid gcc -Wunused-value in dummy expressions
rlibby [Sat, 22 Jul 2017 21:29:44 +0000 (21:29 +0000)]
linuxkpi compiler.h: avoid gcc -Wunused-value in dummy expressions

It looks like the __acquire and __release macros are for the consumption
of static analysis tools and have no semantic effect.  Transform the
definitions from constant expressions to empty statements in order to
avoid -Wunused-value from gcc.

Likewise avoid future warnings for __chk_{user,io}_ptr, but with a cast
to void, because it looks like some linux kernel code may use those in
expression contexts.

Reviewed by: hselasky, markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11695

6 years agoDo not allocate struct kinfo_vmobject on stack.
kib [Sat, 22 Jul 2017 13:33:06 +0000 (13:33 +0000)]
Do not allocate struct kinfo_vmobject on stack.

Its size is 1184 bytes.

Noted by: eugen
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoHandle WITH/WITHOUT_PF in libsysdecode
kp [Sat, 22 Jul 2017 12:51:19 +0000 (12:51 +0000)]
Handle WITH/WITHOUT_PF in libsysdecode

Only filter out the PF ioctls if we're building without pf support.
Until now those were always filtered out, so truss did not show symbolic
names for pf ioctls.

Differential Revision: https://reviews.freebsd.org/D11629

6 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
dim [Sat, 22 Jul 2017 11:08:25 +0000 (11:08 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
5.0.0 (trunk r308421).  Upstream has branched for the 5.0.0 release,
which should be in about a month.  Please report bugs and regressions,
so we can get them into the release.

Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.

MFC after: 2 months

6 years agoUse the "tree" word in ps(1) -d option description, to make it easier
trasz [Sat, 22 Jul 2017 10:38:44 +0000 (10:38 +0000)]
Use the "tree" word in ps(1) -d option description, to make it easier
to find.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoStyle(9) whitespace fix.
dchagin [Sat, 22 Jul 2017 09:03:40 +0000 (09:03 +0000)]
Style(9) whitespace fix.

MFC after: 1 week

6 years agoFix top(1) output when zfs.ko is loaded but ZFS is not in use.
markj [Fri, 21 Jul 2017 23:53:48 +0000 (23:53 +0000)]
Fix top(1) output when zfs.ko is loaded but ZFS is not in use.

Reviewed by: allanjude
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11693

6 years agoMerge ^/head r321307 through r321350.
dim [Fri, 21 Jul 2017 18:54:34 +0000 (18:54 +0000)]
Merge ^/head r321307 through r321350.

6 years agoSet tentative merge dates, bump __FreeBSD_version.
dim [Fri, 21 Jul 2017 18:53:43 +0000 (18:53 +0000)]
Set tentative merge dates, bump __FreeBSD_version.

6 years agoImprove publication of the newly allocated snapdata.
kib [Fri, 21 Jul 2017 18:42:35 +0000 (18:42 +0000)]
Improve publication of the newly allocated snapdata.

For freshly allocated snapdata, Lock sn_lock in advance, so
si_snapdata readers see the locked snapdata and not race.

For existing snapdata, if the thread was put to sleep waiting for
sn_lock, re-read si_snapdata.  This either closes the race or makes
the reliance on LK_DRAIN less important.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoUnlock correct lock in ffs_snapblkfree().
kib [Fri, 21 Jul 2017 18:36:17 +0000 (18:36 +0000)]
Unlock correct lock in ffs_snapblkfree().

It is possible for ffs_snapblkfree() to race and lock snaplock while
the devvp snapdata is instantiated, but no snapshots exist.  In this
case the loop over snapshots in ffs_snapblkfree() is not executed, and
the local variable vp is left initialized to NULL.

Unlock using &sn->sn_lock and not vp->v_vnlock.  For the inodes on the
snapshot list, the locks are same.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoAccount for lock recursion when transfering snaplock to the vnode lock
kib [Fri, 21 Jul 2017 18:28:27 +0000 (18:28 +0000)]
Account for lock recursion when transfering snaplock to the vnode lock
in ffs_snapremove().

Apparently ffs_snapremove() may be called with the snap lock recursed,
at least one trace demonstrated this when snapshot vnode was unlinked
while synced.  It was inactivated from the syncer thread.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoPull in r295886 from upstream clang trunk (by Richard Smith):
dim [Fri, 21 Jul 2017 17:59:54 +0000 (17:59 +0000)]
Pull in r295886 from upstream clang trunk (by Richard Smith):

  PR32034: Evaluate _Atomic(T) in-place when T is a class or array type.

  This is necessary in order for the evaluation of an _Atomic
  initializer for those types to have an associated object, which an
  initializer for class or array type needs.

This fixes an assertion when building recent versions of LinuxCNC.

Reported by: trasz
PR: 220883
MFC after: 1 week

6 years agoDo not update stats counter in SWI context. Defer to the already existing
sbruno [Fri, 21 Jul 2017 17:42:54 +0000 (17:42 +0000)]
Do not update stats counter in SWI context.  Defer to the already existing
admin thread.

Submitted by: Matt Macy <mmacy@mattmacy.io>
Sponsored by: Limelight Networks

6 years ago__pcpu: gcc -Wredundant-decls
rlibby [Fri, 21 Jul 2017 17:11:36 +0000 (17:11 +0000)]
__pcpu: gcc -Wredundant-decls

Pollution from counter.h made __pcpu visible in amd64/pmap.c.  Delete
the existing extern decl of __pcpu in amd64/pmap.c and avoid referring
to that symbol, instead accessing the pcpu region via PCPU_SET macros.
Also delete an unused extern decl of __pcpu from mp_x86.c.

Reviewed by: kib
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11666

6 years agoRespect INSTALL_AS_USER for FILES.
bdrewery [Fri, 21 Jul 2017 16:14:35 +0000 (16:14 +0000)]
Respect INSTALL_AS_USER for FILES.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoProperly set userid for truncate_test.
bdrewery [Fri, 21 Jul 2017 16:14:06 +0000 (16:14 +0000)]
Properly set userid for truncate_test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoImplement SIGEV_THREAD notifications for lio_listio(2)
asomers [Fri, 21 Jul 2017 15:09:24 +0000 (15:09 +0000)]
Implement SIGEV_THREAD notifications for lio_listio(2)

Our man pages have always indicated that this was supported, but in fact the
feature was never implemented for lio_listio(2).

Reviewed by: jhb, kib (earlier version)
MFC after: 20 days
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11680

6 years agoAdd warning flags for GCC 7.1.0 compiler.
br [Fri, 21 Jul 2017 14:50:32 +0000 (14:50 +0000)]
Add warning flags for GCC 7.1.0 compiler.

Sponsored by: DARPA, AFRL

6 years agoFix style: change spaces to tabs.
br [Fri, 21 Jul 2017 14:14:47 +0000 (14:14 +0000)]
Fix style: change spaces to tabs.

Sponsored by: DARPA, AFRL

6 years agoMake truss(1) cross-reference dtrace(1) and bump .Dd.
trasz [Fri, 21 Jul 2017 13:58:51 +0000 (13:58 +0000)]
Make truss(1) cross-reference dtrace(1) and bump .Dd.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoUse more usual formatting for the EXAMPLES section of truss(1).
trasz [Fri, 21 Jul 2017 13:50:59 +0000 (13:50 +0000)]
Use more usual formatting for the EXAMPLES section of truss(1).

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoUse more usual formatting for the EXAMPLES section of ktrace(1).
trasz [Fri, 21 Jul 2017 13:27:25 +0000 (13:27 +0000)]
Use more usual formatting for the EXAMPLES section of ktrace(1).

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoRemove stack guard option from hardening menu.
robak [Fri, 21 Jul 2017 08:50:22 +0000 (08:50 +0000)]
Remove stack guard option from hardening menu.

Since kib's change the stack guard is now ON by default,
this option in hardening menu of bsdinstall is no longer needed.

Submitted by: Bartlomiej Rutkowski <robak@FreeBSD.org>
Reviewed by: bapt
Approved by: bapt
MFC after: 1 day
Sponsored by: Pixeware LTD
Differential Revision: https://reviews.freebsd.org/D11686

6 years agoFix getsockopt() for listening sockets when using SO_SNDBUF, SO_RCVBUF,
tuexen [Fri, 21 Jul 2017 07:44:43 +0000 (07:44 +0000)]
Fix getsockopt() for listening sockets when using SO_SNDBUF, SO_RCVBUF,
SO_SNDLOWAT, SO_RCVLOWAT. Since r31972 it only worked for non-listening
sockets.

Sponsored by: Netflix, Inc.

6 years agoRestore the changes done in r313982: Replace zero with NULL for pointers.
loos [Fri, 21 Jul 2017 03:59:56 +0000 (03:59 +0000)]
Restore the changes done in r313982: Replace zero with NULL for pointers.

Spotted by: Harry Schmalzbauer
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

6 years agoCompile the atomic64 emulation for powerpcspe
jhibbits [Fri, 21 Jul 2017 03:48:09 +0000 (03:48 +0000)]
Compile the atomic64 emulation for powerpcspe

With this, ZFS builds for and runs (not quite stablely) on powerpcspe.

6 years agoUpdate netmap_user.h with the current version of netmap. This file should
loos [Fri, 21 Jul 2017 03:42:09 +0000 (03:42 +0000)]
Update netmap_user.h with the current version of netmap.  This file should
have been committed together with r319881.

MFC after: 1 week
MFC with: r319881
Pointy hat to: loos

6 years agoAdd cpufreq support for P1022 and MPC8536
jhibbits [Fri, 21 Jul 2017 03:40:05 +0000 (03:40 +0000)]
Add cpufreq support for P1022 and MPC8536

P1022 and MPC8536  include a 'jog' feature for clock control
(jog being a slower form of run mode).  This is done by changing the
PLL multiplier, and cannot be done if any core is in doze or sleep mode.

6 years agoDo not allow the use of the loopback interface in netmap.
loos [Fri, 21 Jul 2017 03:28:35 +0000 (03:28 +0000)]
Do not allow the use of the loopback interface in netmap.

The generic support in netmap send the packets using if_transmit() and the
loopback do not support packets coming from if_transmit()/if_start().

This avoids the use of the loopback interface and the subsequent crash that
happens when the application send packets to the loopback interface.

Details in: https://github.com/luigirizzo/netmap/issues/322
Reported by: Vincenzo Maffione <v.maffione@gmail.com>
Sponsored by: Rubicon Communications, LLC (Netgate)

6 years agoFix a couple of typos in a comment.
loos [Fri, 21 Jul 2017 03:04:55 +0000 (03:04 +0000)]
Fix a couple of typos in a comment.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

6 years agoAdd regression test for recent regex(3) breakage
kevans [Fri, 21 Jul 2017 01:35:55 +0000 (01:35 +0000)]
Add regression test for recent regex(3) breakage

BREs recently became prematurely sensitive to the branching operator, which
outright broke expressions that used it instead of failing silently. Test
that \| is matching a literal | for the time being.

Reviewed by: cem, emaste, ngie
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11577

6 years agor320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.
rmacklem [Fri, 21 Jul 2017 00:14:43 +0000 (00:14 +0000)]
r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.

r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for
the NFSv4.1 session. If rsize,wsize are not specified as options, the
value of nm_rsize, nm_wsize is 0 at session creation, resulting in
values for request/response that are too small.
This patch fixes the problem. A workaround is to specify rsize=N,wsize=N
mount options explicitly, so they are set before session creation.
This bug only affects NFSv4.1 mounts against some non-FreeBSD servers.

MFC after: 1 week

6 years agoRevert r321308. I'll commit a better fix soon.
rmacklem [Thu, 20 Jul 2017 23:59:47 +0000 (23:59 +0000)]
Revert r321308. I'll commit a better fix soon.

6 years agor320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.
rmacklem [Thu, 20 Jul 2017 23:15:50 +0000 (23:15 +0000)]
r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.

r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for
the NFSv4.1 session. If rsize,wsize are not specified as options, the
value of nm_rsize, nm_wsize is 0 at session creation, resulting in
values for request/response that are too small.
This patch fixes the problem. A workaround is to specify rsize=N,wsize=N
mount options explicitly, so they are set before session creation.
This bug only affects NFSv4.1 mounts against some non-FreeBSD servers.

MFC after: 1 week

6 years agoMerge ^/head r321239 through r321306.
dim [Thu, 20 Jul 2017 20:37:23 +0000 (20:37 +0000)]
Merge ^/head r321239 through r321306.

6 years agoFix printf format warning in iflib.c
dim [Thu, 20 Jul 2017 20:28:31 +0000 (20:28 +0000)]
Fix printf format warning in iflib.c

Clang 5.0.0 got better warnings about printf format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

    sys/net/iflib.c:1517:8: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
                                              sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
                                              ^~~~~~~~~~~~~~~~~~~~
    sys/net/iflib.c:1517:41: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
                                              sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
                                                                               ^~~~~~~~~~~~~~~~~~~~~~~

Fix this by casting bus_size_t arguments to uintmax_t, and using %ju
instead.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11679

6 years agoFix printf format warning in zfs_module.c
dim [Thu, 20 Jul 2017 20:27:19 +0000 (20:27 +0000)]
Fix printf format warning in zfs_module.c

Clang 5.0.0 got better warnings about print format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

    sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                        "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
                                   ^~~~~~~~~~

Fix this by casting off_t arguments to intmax_t, and using %jd instead.

Reviewed by: tsoome
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11678

6 years agoadd arm64 objcopy output target for embedfs
emaste [Thu, 20 Jul 2017 18:22:49 +0000 (18:22 +0000)]
add arm64 objcopy output target for embedfs

PR: 220877
Submitted by: David NewHamlet
MFC after: 1 week

6 years agoAdd myself and mentor line to committers-src.dot.
mjoras [Thu, 20 Jul 2017 18:14:27 +0000 (18:14 +0000)]
Add myself and mentor line to committers-src.dot.

Approved by: rstone (mentor)
Differential Revision: https://reviews.freebsd.org/D11672

6 years agoacpidump: add GIC ITS srat type
emaste [Thu, 20 Jul 2017 17:36:17 +0000 (17:36 +0000)]
acpidump: add GIC ITS srat type

From ACPI 6.2, 5.2.16.5

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoacpidump: add ACPI NFIT (NVDIMM Firmware Interface Table)
emaste [Thu, 20 Jul 2017 17:31:27 +0000 (17:31 +0000)]
acpidump: add ACPI NFIT (NVDIMM Firmware Interface Table)

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11479

6 years agoRemove some private symbols from librt
asomers [Thu, 20 Jul 2017 16:24:29 +0000 (16:24 +0000)]
Remove some private symbols from librt

Private functions like __aio_read and _aio_read were exposed in
FBSDprivate_1.0 by r169090, even though they've never been used outside of
librt. Also, remove some weak references from r156136 that have never
resolved.

Reviewed by: kib
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11649

6 years agoacpidump: use C99 designated initializers
emaste [Thu, 20 Jul 2017 15:52:36 +0000 (15:52 +0000)]
acpidump: use C99 designated initializers

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11659

6 years agodate: avoid crash on invalid time
emaste [Thu, 20 Jul 2017 15:28:48 +0000 (15:28 +0000)]
date: avoid crash on invalid time

localtime(3) returns NULL when passed an invalid time_t but date(1)
previously did not handle it. Exit with an error in that case.

PR: 220828
Reported by: Vinícius Zavam
Reviewed by: cem, kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11660

6 years agoDeal with listening socket correctly.
tuexen [Thu, 20 Jul 2017 14:50:13 +0000 (14:50 +0000)]
Deal with listening socket correctly.

6 years agoFix the explicit EOR mode. If the final messages is not complete, send
tuexen [Thu, 20 Jul 2017 11:09:33 +0000 (11:09 +0000)]
Fix the explicit EOR mode. If the final messages is not complete, send
an ABORT.
Joint work with rrs@
MFC after: 1 week

6 years agohyperv/storvsc: Force SPC3 for CDROM attached.
sephe [Thu, 20 Jul 2017 07:13:26 +0000 (07:13 +0000)]
hyperv/storvsc: Force SPC3 for CDROM attached.

This unbreaks the CDROM attaching on GEN2 VMs.  On GEN1 VMs, CDROM is
attached to emulated ATA controller.

PR: 220790
Submitted by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11634

6 years agoefi: restrict visibility of EFIABI_ATTR-declared functions
rlibby [Thu, 20 Jul 2017 06:47:06 +0000 (06:47 +0000)]
efi: restrict visibility of EFIABI_ATTR-declared functions

In-tree gcc (4.2) doesn't understand __attribute__((ms_abi))
(EFIABI_ATTR).  Avoid declaring functions with that attribute when the
compiler is detected to be gcc < 4.4.

Reviewed by: kib, imp (previous version)
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11636

6 years agoprocstat(8): clarify program usage
ngie [Thu, 20 Jul 2017 05:43:48 +0000 (05:43 +0000)]
procstat(8): clarify program usage

- Visualize mutually exclusive options and their corresponding
  arguments.
- Try to make the subtleties that are expressed in the code, and
  potentially in the manpages, more apparent.

6 years agoSome trivial style(9) fixes
ngie [Thu, 20 Jul 2017 04:32:06 +0000 (04:32 +0000)]
Some trivial style(9) fixes

- Delete trailing whitespace.
- Fix leading indentation (convert single column spaces to tabs).
- Convert "[Ff]all through" to "FALLTHROUGH", per implicit project
  style/spelling.

Reviewed by: sbruno
Differential Revision: D11665

6 years agoClean up leading whitespace (convert single column spaces to hard tabs)
ngie [Thu, 20 Jul 2017 00:40:03 +0000 (00:40 +0000)]
Clean up leading whitespace (convert single column spaces to hard tabs)

MFC after: now

6 years agoDecode FreeBSD11 fstatat calls.
markj [Wed, 19 Jul 2017 23:34:28 +0000 (23:34 +0000)]
Decode FreeBSD11 fstatat calls.

6 years agoRestore igb(4) code dropped during iflib conversion
sbruno [Wed, 19 Jul 2017 22:41:22 +0000 (22:41 +0000)]
Restore igb(4) code dropped during iflib conversion
 - restore newer code for vf, i350, i210, i211
 - restore dmac init code for i354 and i350
 - restore WUC/WUFC update
 - check for igb mac type before attempting trying to assert
   a media changed event.
 - handle link events for igb(4) and em(4) devices differently
   and appropriately for their respective model types.

Submitted by: Matt Macy <mmacy@mattmacy.io>
Sponsored by: Limelight Networks

6 years agoInclude ARCH_FLAGS in CFLAGS when building modules.
brooks [Wed, 19 Jul 2017 22:06:35 +0000 (22:06 +0000)]
Include ARCH_FLAGS in CFLAGS when building modules.

Without this change, modules will match the default compiler
configuration which may not be the same as the kernel values.

Reviewed by: imp
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11633

6 years agoDon't cache mbuf pointers if the number of descriptors is greater than
sbruno [Wed, 19 Jul 2017 21:18:04 +0000 (21:18 +0000)]
Don't cache mbuf pointers if the number of descriptors is greater than
the number of buffers.

Submitted by: Matt Macy <mmacy@mattmacy.io>
Sponsored by: Limelight Networks

6 years agoUpdate the nfsv4 man page to reflect recent changes to support
rmacklem [Wed, 19 Jul 2017 20:57:41 +0000 (20:57 +0000)]
Update the nfsv4 man page to reflect recent changes to support
the newer RFCs (5661 and 7530). The main man changes are for the
case of "numbers in strings" for user/groups that RFC7530 allows
and avoids use of nfsuserd(8).

This is a content change.

Reviewed by: trasz (earlier version)
MFC after: 1 week

6 years agoAdd pctrie_init() and vm_radix_init() to initialize generic pctrie and
kib [Wed, 19 Jul 2017 20:52:47 +0000 (20:52 +0000)]
Add pctrie_init() and vm_radix_init() to initialize generic pctrie and
vm_radix trie.

Existing vm_radix_init() function is renamed to vm_radix_zinit().
Inlines moved out of the _ headers.

Reviewed by: alc, markj (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D11661

6 years agocron(8) manpage updates
ngie [Wed, 19 Jul 2017 19:53:07 +0000 (19:53 +0000)]
cron(8) manpage updates

- Document /etc/cron.d and /usr/local/etc/cron.d under FILES.
- Reword documentation for -n: add appropriate soft-stop and remove
  contraction to appease igor.

MFC after: 3 days

6 years agoMerge ^/head r320994 through r321238.
dim [Wed, 19 Jul 2017 19:43:10 +0000 (19:43 +0000)]
Merge ^/head r320994 through r321238.

6 years agoMerge llvm, clang, lld, lldb, compiler-rt and libc++ r308421, and update
dim [Wed, 19 Jul 2017 19:41:41 +0000 (19:41 +0000)]
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r308421, and update
build glue.

6 years agoFix trivial whitespace bug introduced in usage message changes for -n
ngie [Wed, 19 Jul 2017 19:38:25 +0000 (19:38 +0000)]
Fix trivial whitespace bug introduced in usage message changes for -n
support (r304570).

MFC after: now

6 years agoRaise the watchdog timer interval to 2 ticks, there by guaranteeing
davidcs [Wed, 19 Jul 2017 19:08:37 +0000 (19:08 +0000)]
Raise the watchdog timer interval to 2 ticks, there by guaranteeing
that it fires between 1ms and 2ms. `
Treat two consecutive occurrences of Heartbeat failures as a legitimate
Heartbeat failure

MFC after:3 days

6 years agoDisable stack growth when accessed by AIO daemons.
kib [Wed, 19 Jul 2017 19:00:32 +0000 (19:00 +0000)]
Disable stack growth when accessed by AIO daemons.

Commit message for r321173 incorrectly stated that the change disables
automatic stack growth from the AIO daemons contexts, with explanation
that this is currently prevents applying wrong resource limits.  Fix
this by actually disabling the growth.

Noted by: alc
Reviewed by: alc, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoAllow matches of truncated version strings.
markj [Wed, 19 Jul 2017 18:41:16 +0000 (18:41 +0000)]
Allow matches of truncated version strings.

Long objdir paths make it easy to hit the version string length limit in
kernel dump headers. The build number and timestamp are unlikely to be
truncated and ought to be sufficient to protect against false positives.

Discussed with: jhb
MFC after: 1 week

6 years agoUse more flexible expression for replacing t_diff in
ngie [Wed, 19 Jul 2017 18:30:16 +0000 (18:30 +0000)]
Use more flexible expression for replacing t_diff in
contrib/netbsd-tests/usr.bin/diff/t_diff.sh with the name of the script via
`basename $0`.

This was a change I forgot to port over from
^/head/gnu/usr.bin/diff/tests/Makefile@r272787.

6 years agobsdinstall: improve checksum mismatch error for snapshots
emaste [Wed, 19 Jul 2017 18:25:52 +0000 (18:25 +0000)]
bsdinstall: improve checksum mismatch error for snapshots

The usual case of a mismatched checksum for installer snapshots
(e.g., -CURRENT, -ALPHA*) is that a newer snapshot has been built and
the old install sets have been replaced.  Provide a specific error
message for checksum mismatches there that suggests looking for a newer
snapshot.

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11641

6 years agozfs: Fix a typo in the delay_min_dirty_percent sysctl description
emaste [Wed, 19 Jul 2017 18:17:41 +0000 (18:17 +0000)]
zfs: Fix a typo in the delay_min_dirty_percent sysctl description

The description is FreeBSD-specific and was added in r266497
to fix PR189865.

PR: 220825
Submitted by: Fabian Keil
Obtained from: ElectroBSD
MFC after: 1 week

6 years agoRemove unused function swap_pager_isswapped().
kib [Wed, 19 Jul 2017 17:28:46 +0000 (17:28 +0000)]
Remove unused function swap_pager_isswapped().

Noted by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoUpdate targets/pseudo/tests/Makefile.depend after recent additions/subtractions
ngie [Wed, 19 Jul 2017 16:45:57 +0000 (16:45 +0000)]
Update targets/pseudo/tests/Makefile.depend after recent additions/subtractions
from the FreeBSD test suite.

MFC after: 3 days
MFC with: r316603

6 years agoClean up :coredump_phnum
ngie [Wed, 19 Jul 2017 16:23:02 +0000 (16:23 +0000)]
Clean up :coredump_phnum

- Use "atf_check -x 'cmd1 | cmd2'" instead of "cmd1 | atf_check cmd2". The
  two forms are idiomatically similar, but subtly different in the sense of
  what program invokes the other, and there could be unwanted side effects
  of the latter idiom dealing with forking, pipes, etc.
- Remove chmod and instead source coredump_phnum_restore_state.sh directly.
  This avoids the need to check the result of the chmod call.
- Fix indentation in an if-block (4 column space indentation -> hard tab).

6 years agoRemove expected failure for :coredump_phnum
ngie [Wed, 19 Jul 2017 16:08:08 +0000 (16:08 +0000)]
Remove expected failure for :coredump_phnum

The testcase no longer fails on ^/head because readelf has established parity
with binutils' copy of readelf.

This issue is not seen on Jenkins because
`test_suites.FreeBSD.allow_sysctl_side_effects` isn't set in kyua.conf on
the CI host, i.e., the test is skipped.

PR: 215019
Tested with: binutils (amd64-binutils-2.28,1); elftoolchain (r3561M)

6 years agoFix spurious timeouts on commands sent to mps(4) and mpr(4) controllers.
ken [Wed, 19 Jul 2017 15:39:01 +0000 (15:39 +0000)]
Fix spurious timeouts on commands sent to mps(4) and mpr(4) controllers.

mps_wait_command() and mpr_wait_command() were using getmicrotime() to
determine elapsed time when checking for a timeout in polled mode.
getmicrotime() isn't guaranteed to monotonically increase, and that
caused spurious timeouts occasionally.

Switch to using getmicrouptime(), which does increase monotonically.
This fixes the spurious timeouts in my test case.

Reviewed by: slm, scottl
MFC after: 3 days
Sponsored by: Spectra Logic

6 years agoRemove dead code that was killed by r320975
asomers [Wed, 19 Jul 2017 15:22:10 +0000 (15:22 +0000)]
Remove dead code that was killed by r320975

Reported by: Coverity
CID: 1377977
MFC after: 15 days
X-MFC-With: 320975
Sponsored by: Spectra Logic Corp

6 years agoAvoid shadowed variables.
tuexen [Wed, 19 Jul 2017 15:12:23 +0000 (15:12 +0000)]
Avoid shadowed variables.

MFC after: 1 week

6 years agoUse memset/memcpy instead of bzero/bcopy.
tuexen [Wed, 19 Jul 2017 14:28:58 +0000 (14:28 +0000)]
Use memset/memcpy instead of bzero/bcopy.

Just use one variant instead of both. Use the memset/memcpy
ones since they cause less problems in crossplatform deployment.

MFC after: 1 week

6 years agoAdd HPE FlexFabric 10Gb 4-port 536FLR-T device id to the bxe(4) driver.
ae [Wed, 19 Jul 2017 14:21:29 +0000 (14:21 +0000)]
Add HPE FlexFabric 10Gb 4-port 536FLR-T device id to the bxe(4) driver.

Tested by: David Miguel Almas <dmalmas gmail com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11478

6 years agoenable pidfile tests on arm64
emaste [Wed, 19 Jul 2017 14:07:38 +0000 (14:07 +0000)]
enable pidfile tests on arm64

Pidfile tests were disabled on arm64 (in r286863) because they hung.
They have been fixed (r306098) and so can be enabled now.

PR: 202304
Sponsored by: The FreeBSD Foundation

6 years agoFix the accounting and add code to detect errors in accounting.
tuexen [Wed, 19 Jul 2017 12:27:40 +0000 (12:27 +0000)]
Fix the accounting and add code to detect errors in accounting.
Joint work with rrs@
MFC after: 1 week

6 years agoRename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring.
trasz [Wed, 19 Jul 2017 09:59:32 +0000 (09:59 +0000)]
Rename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring.
It applies to both NFS client and NFS server, and is useful for both.
This is different from vfs.nfsd.enable_stringtouid, which is specific
to server side.

Reviewed by: rmacklem@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoVendor import of compiler-rt trunk r308421:
dim [Wed, 19 Jul 2017 07:02:40 +0000 (07:02 +0000)]
Vendor import of compiler-rt trunk r308421:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@308421

6 years agoVendor import of clang trunk r308421:
dim [Wed, 19 Jul 2017 07:02:30 +0000 (07:02 +0000)]
Vendor import of clang trunk r308421:
https://llvm.org/svn/llvm-project/cfe/trunk@308421

6 years agoVendor import of llvm trunk r308421:
dim [Wed, 19 Jul 2017 07:02:10 +0000 (07:02 +0000)]
Vendor import of llvm trunk r308421:
https://llvm.org/svn/llvm-project/llvm/trunk@308421

6 years agocxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the
np [Wed, 19 Jul 2017 01:49:01 +0000 (01:49 +0000)]
cxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the
trace buffer.

MFC after: 3 days

6 years agobsdinstall: remove EOL whitespace
emaste [Tue, 18 Jul 2017 23:35:19 +0000 (23:35 +0000)]
bsdinstall: remove EOL whitespace

6 years agoRemove special handling for 'disk*.h'
jhb [Tue, 18 Jul 2017 21:09:29 +0000 (21:09 +0000)]
Remove special handling for 'disk*.h'

This was originally added so that only one of diskmbr.h or diskpc98.h
was chosen and is no longer needed after PC98's removal.  However, the
special handling was also broken as it effectively prevented the decoding
of ioctls declared in other headers such as <sys/disk.h> or
<sys/disklabel.h>.

6 years agoConvert assertion that only vmspace owner grows the stack, into a
kib [Tue, 18 Jul 2017 20:26:41 +0000 (20:26 +0000)]
Convert assertion that only vmspace owner grows the stack, into a
check blocking grow from other processes accesses.

Debugger may access stack grow area with ptrace(2).  In this case,
real state of the process is to not have the stack grown, which
provides more accurate inspection.  Technical reason to avoid the grow
is to avoid applying wrong process (debugger) stack limit.

This change also has a consequence of making aio workers accesses past
the bottom of stacks into EFAULT, arguably the situation is a
programmers mistake.

Reported by: jhb
Discussed with: alc, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoAllwinner EHCI: Do not fail if we cannot get a phy
manu [Tue, 18 Jul 2017 19:50:02 +0000 (19:50 +0000)]
Allwinner EHCI: Do not fail if we cannot get a phy

If we cannot get a phy, do not detach the driver, some boards have phy
always enabled and not exposed.
While here do not release the clocks if we fails as we release them
in a10_ehci_detach.

Tested-on: OrangePi-One

6 years agosh: Remove broken #ifdef NOHACK code (related to sh -c).
jilles [Tue, 18 Jul 2017 19:00:15 +0000 (19:00 +0000)]
sh: Remove broken #ifdef NOHACK code (related to sh -c).

Apart from the fact that subtle syntactic changes make a poor compile-time
option, the NOHACK case has been obviously broken since it was added,
because it uses q uninitialized if (*p != '\0').

No functional change is intended.

6 years agoRemove unnecessary make logic added in r319339
ngie [Tue, 18 Jul 2017 17:29:12 +0000 (17:29 +0000)]
Remove unnecessary make logic added in r319339

This makes the change cleaner and easier to backport to ^/stable/10.

MFC after: now

6 years agoAdd support for passing FPU_KERN_NOCTX to fpu_kern_enter on arm64. This
andrew [Tue, 18 Jul 2017 16:36:32 +0000 (16:36 +0000)]
Add support for passing FPU_KERN_NOCTX to fpu_kern_enter on arm64. This
will be used to call into UEFI from the kernel.

Sponsored by: DARPA, AFRL

6 years agoipfw_netflow: Add support for FIB
manu [Tue, 18 Jul 2017 14:02:02 +0000 (14:02 +0000)]
ipfw_netflow: Add support for FIB

If ipfw_netflow_fib, the ipfw rule will only match packets in that FIB.

While here correct some value in rc.conf(5) to be int and not str.

Sponsored by: Gandi.net

6 years agofix a regression in r320452, ZFS ABD import
avg [Tue, 18 Jul 2017 07:41:38 +0000 (07:41 +0000)]
fix a regression in r320452, ZFS ABD import

I overlooked the fact that vdev_op_io_done hook is called even if the
actual I/O is skipped, for example, in the case of a missing vdev.
Arguably, this could be considered an issue in the zio pipeline engine,
but for now I am adding defensive code to check for io_bp being NULL
along with assertions that that happens only when it can be really
expected.

PR: 220691
Reported by: peter, cy
Tested by: cy
MFC after: 1 week
X-MFC with: r320156, r320452

6 years agoFix whitespace regression accidentally checked in via ^/head@r280149
ngie [Tue, 18 Jul 2017 06:51:27 +0000 (06:51 +0000)]
Fix whitespace regression accidentally checked in via ^/head@r280149

MFC after: now

6 years agoqlnx: gcc build errors
rlibby [Tue, 18 Jul 2017 06:15:05 +0000 (06:15 +0000)]
qlnx: gcc build errors

Propagate warning flags from kern.opts.mk and then fix minor -Werror
issues when building with gcc from -Wredundant-decls, -Wnested-externs,
-Wuninitialized.

Reviewed by: davidcs
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11413

6 years agocxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or
np [Tue, 18 Jul 2017 03:58:59 +0000 (03:58 +0000)]
cxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or
remove bootrom and boot config.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoMake ZFS not crash on mount on 32-bit systems
jhibbits [Tue, 18 Jul 2017 01:08:45 +0000 (01:08 +0000)]
Make ZFS not crash on mount on 32-bit systems

ZPL_VERSION is unsigned long long, not an int.  With this change, a zpool can be
created on a 32-bit system (tested on powerpcspe) and mounted correctly.

Reviewed by: allanjude

6 years agocxgbe(4): New ioctls to flash bootrom and boot config to the card.
np [Tue, 18 Jul 2017 00:50:58 +0000 (00:50 +0000)]
cxgbe(4): New ioctls to flash bootrom and boot config to the card.

MFC after: 2 weeks
Sponsored by: Chelsio Communications