FreeBSD/src 336357head/sys/fs/nfs nfsproto.h, head/sys/fs/nfsserver nfs_nfsdstate.c nfs_nfsdserv.c

Modify the reasons for not issuing a delegation in the NFSv4.1 server.

The ESXi NFSv4.1 client will generate warning messages when the reason for
not issuing a delegation is two. Two refers to a resource limit and I do
not see why it would be considered invalid. However it probably was not the
best choice of reason for not issuing a delegation.
This patch changes the reasons used to ones that the ESXi client doesn't
complain about. This change does not affect the FreeBSD client and does
not appear to affect behaviour of the Linux NFSv4.1 client.
RFC5661 defines these "reasons" but does not give any guidance w.r.t. which
ones are more appropriate to return to a client.

Tested by:      andreas.nagy at frequentis.com
PR:            226650
MFC after:      2 weeks

FreeBSD/src 336356head/sys/dev/e1000 if_em.c

Update igb_sctx_init for r336313, missed when incorporating shurd@'s
feedback on the initial D15720.

Reported by:    kib

FreeBSD/src 336355head/sys/cddl/dev/dtrace/powerpc dtrace_isa.c

dtrace/powerpc: Correct register indices for non-indexed registers in the trapframe

Fix an off-by-one error, LR starts at index 32, not index 33, and the others
follow suit.

FreeBSD/src 336354head/stand/i386/zfsboot zfsboot.c

zfsboot: fix build with WITHOUT_LOADER_GELI

Reviewed by:    ian
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D16292

FreeBSD/src 336353head/sys/conf Makefile.amd64 Makefile.arm

config(8): Bump major version after r335998

config-generated hints.c/env.c from r335998 and later are incompatible with
earlier kernels due to no longer setting envmode/hintmode. A minor bump for
this is insufficient, as matching major version with a later minor version
is still viewed as backwards-compatible.

This was an MI kernel change, soo all VERSREQ's are bumped.

FreeBSD/src 336352head/sys/geom/eli g_eli_crypto.c g_eli.h, head/sys/kgssapi/krb5 kcrypto_aes.c kcrypto_des.c

OCF: Convert consumers to the session id typedef

These were missed in the earlier r336269.

No functional change.

Sponsored by:   Dell EMC Isilon

FreeBSD/src 336351head/gnu/lib/libstdc++ config.h

Update libstdc++ configuration.

Its been quite a while since the last time we updated this and since then
we have grown iconv and a bunch of complex math functions.

This only applies to the platforms which still use GCC 4.2.1 in the
toolchain.

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

FreeBSD/src 336350head/usr.sbin/sysrc sysrc

sysrc(8): Send error message to stderr (not stdout)

PR:            bin/229806
Reported by:    Andreas Sommer <andreas.sommer87 at googlemail.com>
MFC after:      3 days
X-MFC-to:       stable/11 stable/10 stable/9
Sponsored by:   Smule, Inc.

FreeBSD/src 336349head/sys/sys pcpu.h

Don't use the static keyword with DPCPU defines in arm64 modules.

On arm64 compiler will create PC-relative loads and stores for static data.
This means it doesn't emit a relocation. Unfortunately the in-kernel linker
expects there to be one for DPCPU defines so it can modify its value so the
code will use the correct DPCPU region.

To workaround the lack of a relocation with static data remove it when
building modules on arm64. The kernel is unaffected as it doesn't rely on
modifying these relocations to find the data.

PR:            225684
Reported by:    Johannes Lundberg <johalun0 at gmail.com>
Reported by:    Jose Luis Duran <jlduran at gmail.com>
Reported by:    Greg V <greg at unrelenting.technology>
Reviewed by:    bz
Sponsored by:   ABT Systems Ltd
Differential Revision:  https://reviews.freebsd.org/D16145
DeltaFile
+18-0head/sys/sys/pcpu.h
+18-01 files

FreeBSD/src 336348head/sys/conf files.arm64, head/sys/crypto/armv8 stdint.h

Create an empty stdint.h for arm_neon.h to include.

The armv8crypto module includes arm_neon.h for the compiler intrinsic
functions. This includes the userland stdint.h file that doesn't exist in
the kernel. Fix this by providing an empty stdint.h to be used when we
include arm_neon.h.

Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D16254

FreeBSD/src 336347head MAINTAINERS

Add pointer to freebsd-numerics for libm.
DeltaFile
+1-0head/MAINTAINERS
+1-01 files

FreeBSD/src 336346stable/11/lib/libnv/tests nvlist_append_test.c, stable/11/share/man/man9 cnv.9 Makefile

MFC r304910, r304912, r304915, r304952, r325019, r328164, r331094, r332664,
r335341-r335345, r335347, r335379-r335380, r335382

r304910:
Introduce cnv man page.

r304912:
Add missed header file for cnv.h .

r304915:
Bump date in the man page.

r304952:
Remove duplicated declaration.

r325019:
Introduce cnvlist_name() and cnvlist_type() functions.

Those function can be used when we are iterating over nvlist to reduce
amount of extra variables we need to declare.

r328164:
libnv: Use mallocarray(9) for the nv_calloc.

r331094:

    [50 lines not shown]

FreeBSD/src 336345stable/11/lib/libnv Makefile, stable/11/lib/libnv/tests cnv_tests.cc Makefile

MFC r304908-r304909

r304908:
Add cnv API.

cnv API is a set of functions for managing name/value pairs by cookie.
The cookie can be obtained by nvlist_next(), nvlist_get_parent() or
nvlist_get_pararr() function. This patch also includes unit tests.

Submitted by:   Adam Starak <starak.adam at gmail.com>

r304909:
Fix style issue in the cnv API.
Remove unused arguments in a macro.
Remove unused typedef.

FreeBSD/src 336344stable 11, stable/11/sbin/ifconfig ifieee80211.c

MFC r335757:

ifconfig(8): Attempt to render non-printable sequences w/ UTF-8 Environment

Currently ifconfig(8) only prints the hex representation of ssid names
with non-ASCII characters. Many modern terminals are able to properly render
non-ASCII characters. This change checks if the terminal charmap is UTF-8,
and if so, will render the characters, rather than the hex value.

This behavior is circumvented by running ifconfig(8) in a non-UTF8 locale;
e.g. C or POSIX.

It was pointed out by kp@ during the review that APs have the option to
broadcast whether their SSIDs may be interpreted as UTF-8. Ideally, we would
honor this and only attempt this behavior if it's so-broadcasted by the AP.

However, a sample survey showed that hostapd will advertise this if
indicated in config but it doesn't seem to be so common in the AP market, so
this would be effectively useless as we'll rarely know if the SSID should be
renderable as UTF-8.

Despite this, it was decided to be OK with this anyways- there's a
straightforward path to doing it the right way based on advertisement by AP
if we need to go that route, and one can revert to old behavior easily
enough at runtime if we get it wrong.

FreeBSD/src 336343stable 11, stable/11/usr.sbin/config mkmakefile.c config.y

MFC r335652-r335654

r335652:
config(8): Make 'env' files consistent with other file-accepting options

Previously, only one 'env' file could be specified. Later 'env' directives
would overwrite earlier 'env' directives. This is inconsistent with every
other file-accepting directives which process files in order, including
hints.

A caveat applies to both hints and env that isn't mentioned: they're
concatenated in the order of appearance, so they're not actually applied in
the way one might think by supplying:

hints x
hints y

Hints in x will take precedence over same-name hints in y due to how
the kernel processes them, stopping at the first line that matches the hint
we're searching for. Future work will flip the order of concatenation so
that later files may still properly override earlier files.

In practice, this likely doesn't matter at all due to the nature of the
beast.


    [25 lines not shown]

FreeBSD/src 336342stable 11

Record-only MFC r336011-r336013

r336013 reverts the previous two commits, which broke the build due to poor
testing form.
DeltaFile
+0-0stable/11/
+0-01 files

FreeBSD/src 336341stable 11

Record-only MFC of r335995, r335997; latter reverts the former
DeltaFile
+0-0stable/11/
+0-01 files

FreeBSD/src 336340stable 11, stable/11/sys/kern kern_exec.c

MFC r336238:

Round down the location of execpathp to slightly improve copyout speed.

In practice, this moves the padding from below the canary to above
execpathp has no impact on stack consumption.

Submitted by:          Wuyang-Chung (via github pull request #159)

FreeBSD/src 336339head/sys/arm/allwinner/clkng ccu_a83t.c

allwinner: a83t: Fix PLL_CPU clocks

The PLL_CPU clocks formula is 24Mhz * N and not 24Mhz / N
Fix it by using a NKMP clock with fixed factor values for the one
unused.

FreeBSD/src 336338stable 11, stable/11/usr.sbin/cpucontrol amd10h.c

MFC r336257, r336258, r336263:
Use the MSR name.

FreeBSD/src 336337head Makefile.inc1

Unconditionally build libnv in legacy

Rather than using a config(8) built from new tree linking libnv built on
host.
DeltaFile
+1-7head/Makefile.inc1
+1-71 files

FreeBSD/src 336336head/tools/build strings.h Makefile

Fix buildworld on FreeBSD 10

Since r336126 we depend on explicit_bzero() for the libmd
bootstrap. Add it to -legacy if it is not found in /usr/include/strings.h.

Reviewed By:    ian
Approved By:    brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16245

FreeBSD/src 336335head/lib/libnv Makefile, head/tools/build Makefile

No longer install sys/nv.h and sys/cnv.h in lib/libnv/Makefile

Use tools/build/Makefile to install the headers into ${WORLDTMP}/legacy
instead. Compared to r336026 this has the minor advantage that it avoids
unncessary header installation when building the non-bootstrap libnv.

Reviewed By:    bdrewery, kevans
Approved By:    brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16187

FreeBSD/src 336334stable 11, stable/11/sys/netipsec key_debug.c

MFC r335795,335796:
  Make debug output produced by `setkey -x` command a more human readable.

  Add text names of SADB message types and extension headers to the output.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC
  Differential Revision:        https://reviews.freebsd.org/D16036

FreeBSD/src 336333head/usr.bin/indent lexi.c indent.c, head/usr.bin/indent/tests float.0 float.0.stdout

indent(1): rewrite the integer/floating constant scanning part of lexi.c

Remove procedural code that did the scanning, which was faulty and didn't
support complex constants such as 0x1p-61. Replace it with a finite state
machine expressed as a transition table. The table was rewritten by hand
from lx's output, given parts of grammar expressed as regular expressions.

lx is Katherine Flavel's lexer generator, currently available at
https://github.com/katef/libfsm and the parts of grammar were taken from
http://quut.com/c/ANSI-C-grammar-l-2011.html and extended to support binary
integer constants which are a popular GCC extension.

Reported by:    bde

FreeBSD/src 336332stable 11, stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChains Gnu.cpp

MFC r336227:

Pull in r336008 from upstream clang trunk:

  Request init/fini array on FreeBSD 12 and later

  Summary:

  It seems a bad idea to change the default in the middle of a release
  branch due to possible changes in global ctor / dtor ordering between
  .ctors and .init_array. With FreeBSD 11.0's release imminent lets
  change the default now for FreeBSD 12 (the current development
  stream) and later.

  FreeBSD rtld has supported .init_array / .fini_array for many years.
  As of Jan 1 2017 all supported FreeBSD releases and branches will
  have support.

  Reviewers: dim, brooks, arichardson

  Reviewed By: dim, brooks, arichardson

  Subscribers: bsdjhb, krytarowski, emaste, cfe-commits

  Differential Revision: https://reviews.llvm.org/D24867

    [2 lines not shown]

FreeBSD/src 336331stable 11, stable/11/contrib/llvm/tools/lld/ELF Writer.cpp

MFC r333401 (by emaste):

lld: Omit PT_NOTE for SHT_NOTE without SHF_ALLOC

A non-alloc note section should not have a PT_NOTE program header.

Found while linking ghc (Haskell compiler) with lld on FreeBSD.  Haskell
emits a .debug-ghc-link-info note section (as the name suggests, it
contains link info) as a SHT_NOTE section without SHF_ALLOC set.

For this case ld.bfd does not emit a PT_NOTE segment for
.debug-ghc-link-info.  lld previously emitted a PT_NOTE with p_vaddr = 0
and FreeBSD's rtld segfaulted when trying to parse a note at address 0.

LLVM PR:        https://llvm.org/pr37361
LLVM review:    https://reviews.llvm.org/D46623

PR:            226872
Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation

FreeBSD/src 336330stable 11, stable/11/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD FreeBSDThread.cpp

MFC r332965 (by emaste):

lldb: remove assertion that target_arch is FreeBSD

The target is not necessarily a FreeBSD binary - for example, it may be
a Linux binary running under the linuxulator.  Basic ptrace (live)
debugging already worked in this case, except for the assertion.

Sponsored by:   Turing Robotic Industries Inc.

FreeBSD/src 336329stable 11, stable/11/sbin/newfs_msdos mkfs_msdos.c newfs_msdos.c

MFC r335189:

Added option to cluster-align the start of the root directory.

Obtained from:  Android
Obtained from:  
https://android.googlesource.com/platform/system/core/+/052f27562154d175267999106bd6bf18fc8c363e
Obtained from:  
https://android.googlesource.com/platform/system/core/+/8218b6aae9cd4a19fa074a8a8203fe9275b35447
Differential Revision:  https://reviews.freebsd.org/D15672

FreeBSD/src 336328stable 11, stable/11/sbin/newfs_msdos newfs_msdos.c newfs_msdos.8

MFC r318355,318366: add -T (timestamp) option for reproducible builds

FreeBSD/src 336327stable 11, stable/11/stand/zfs zfs.c

MFC r335874: Cut currdev dev and path fields for ZFS on the last colon.

Previously the code cut those fields on second colon, that prevented
boot from boot environments with colon in their names.  This change
moves the limitation from dev field to path, which is empty by default.

FreeBSD/src 336326head/sys/dev/ichiic ig4_pci.c

Remove MODULE_PNP_INFO for ig4(4) driver

ig4(4) does not support suspend/resume but present on the hardware where
such functionality is critical, like laptops. Remove PNP info to avoid
breaking suspend/resume on the systems where ig4(4) load is not explicitly
requested by the user.

PR:             229791
Reported by:    Ali Abdallah

FreeBSD/src 336325head/sys/arm/broadcom/bcm2835 bcm2835_sdhost.c

Remove two checks that are always false

Outer loop condition contradicts inner check so code under inner condition
is not reachable. Remove it.

PR:            229722
Reported by:    David Binderman

FreeBSD/src 336324stable 10, stable/10/lib/libiconv_modules/mapper_std citrus_mapper_std.c

MFC r336115;
libiconv: correct undefined behavior.

Detected on NetBSD:
# nm /usr/lib/libc.so|grep sanit
    /public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8:
runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Obtained from:  NetBSD (CVS Rev. 1.11)

FreeBSD/src 336323stable 11, stable/11/usr.bin/gzip gzip.c

MFC r336113:
gzip: fix for undefined behavior.

Unportable left shift reported with MKSANITIZER=yes
USE_SANITIZER=undefined:

# progress -zf ./games.tgz  tar -xp -C "./" -f -
/public/src.git/usr.bin/gzip/gzip.c:2126:33: runtime error: left shift of
251 by 24 places cannot be represented in type 'int'
100%
|****************************************************************************************************************|
44500 KiB  119.69 MiB/s    00:00 ETA

Refactor the following code into something that is more clear
and fix signed integer shift, by casting all buf[] elements to
(unsigned int):

unsigned char buf[8];
uint32_t usize;
[...]
else {
    usize = buf[4] | buf[5] << 8 |
            buf[6] << 16 | buf[7] << 24;
[...]


    [13 lines not shown]

FreeBSD/src 336322stable 11, stable/11/lib/libiconv_modules/mapper_std citrus_mapper_std.c

MFC r336115;
libiconv: correct undefined behavior.

Detected on NetBSD:
# nm /usr/lib/libc.so|grep sanit
    /public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8:
runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Obtained from:  NetBSD (CVS Rev. 1.11)

FreeBSD/src 336321head/sys/i386/i386 pmap.c, head/sys/i386/include pmap.h

Restore the check for the page size extension after r332489.

Without this, the support for transparent superpage promotion on i386
was left disabled.

Reviewed by:    alc, kib
Differential Revision:  https://reviews.freebsd.org/D16279

FreeBSD/src 336320head/bin/sh exec.c main.c, head/bin/sh/tests/builtins cd11.0 Makefile

sh: Don't treat % specially in CDPATH

FreeBSD/src 336319head/sys/security/audit audit_syscalls.c

auditon(2): fix A_SETPOLICY with 64-bit values

A_SETPOLICY is supposed to work with either 64 or 32-bit values, but due to a
typo the 64-bit version has never worked correctly.

Submitted by:   aniketp
Reviewed by:    asomers, cem
MFC after:      2 weeks
Sponsored by:   Google, Inc. (GSoC 2018)
Differential Revision:  https://reviews.freebsd.org/D16222

FreeBSD/src 336318head/usr.bin/indent parse.c args.c

indent(1): move case_indent from parser state to the options struct

This was missed in r334927.

FreeBSD/src 336317head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip tst.ipv4localtcp.ksh

Adjust comment to reality since r286171.

Sponsored by:          Netflix, Inc.

FreeBSD/src 336316head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip tst.localtcpstate.ksh

Don't require a local sshd for the local TCP state dtrace test

This change is similar to the one done in r286171 for
tst.ipv4localtcp.ksh. This not only reduces the requirements on the
system used for testing but results also in a graceful teardown of
the TCP connection.

Reviewed by:           gnn@
Sponsored by:          Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D16276

FreeBSD/src 336315head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip tst.ipv4localudp.ksh tst.ipv4remoteudp.ksh, head/cddl/usr.sbin/dtrace/tests/tools exclude.sh

Fix the UDP tests for dtrace.

The code imported from opensolaris was depending on ping supporting
UDP for sending probes. Since this is not supported by ping on FreeBSD
use a perl script instead.
The remote test requires the usage of ksh93, so state that in the
sheband.
Enable the local test, but keep the remote test disabled, since it
requires a remote machine on the LAN.

Reviewed by:           markj@, gnn@
Sponsored by:          Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D16268

FreeBSD/src 336314head/sys/vm vm_pageout.c

Test PGA_REFERENCED after calling pmap_ts_referenced(), rather than before,
so that a reference from a concurrently destroyed mapping is observed
during the current scan.

Reviewed by:    kib, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D16277
DeltaFile
+34-23head/sys/vm/vm_pageout.c
+34-231 files

FreeBSD/src 336313head/sys/dev/bnxt if_bnxt.c, head/sys/dev/e1000 if_em.c

Assorted TSO fixes for em(4)/iflib(9) and dead code removal:
- Ever since the workaround for the silicon bug of TSO4 causing MAC hangs
  was committed in r295133, CSUM_TSO always got disabled unconditionally
  by em(4) on the first invocation of em_init_locked(). However, even with
  that problem fixed, it turned out that for at least e. g. 82579 not all
  necessary TSO workarounds are in place, still causing MAC hangs even at
  Gigabit speed. Thus, for stable/11, TSO usage was deliberately disabled
  in r323292 (r323293 for stable/10) for the EM-class by default, allowing
  users to turn it on if it happens to work with their particular EM MAC
  in a Gigabit-only environment.
  In head, the TSO workaround for speeds other than Gigabit was lost with
  the conversion to iflib(9) in r311849 (possibly along with another one
  or two TSO workarounds). Yet at the same time, for EM-class MACs TSO4
  got enabled by default again, causing device hangs. Therefore, change the
  default for this hardware class back to have TSO4 off, allowing users
  to turn it on manually if it happens to work in their environment as
  we do in stable/{10,11}. An alternative would be to add a whitelist of
  EM-class devices where TSO4 actually is reliable with the workarounds in
  place, but given that the advantage of TSO at Gigabit speed is rather
  limited - especially with the overhead of these workarounds -, that's
  really not worth it. [1]
  This change includes the addition of an isc_capabilities to struct
  if_softc_ctx so iflib(9) can also handle interface capabilities that
  shouldn't be enabled by default which is used to handle the default-off
  capabilities of e1000 as suggested by shurd@ and moving their handling

    [62 lines not shown]

FreeBSD/src 336312head/sys/fs/nfs nfs_var.h, head/sys/fs/nfsclient nfs_clstate.c nfs_clrpcops.c

Shut down the TCP connection to a DS in the pNFS client when Renew fails.

When a NFSv4.1 client mount using pNFS detects a failure trying to do a
Renew (actually just a Sequence operation), the code would simply try
again and again and again every 30sec.
This would tie up the "nfscl" thread, which should also be doing other
things like Renews on other DSs and the MDS.
This patch adds code which closes down the TCP connection and marks it
defunct when Renew detects an failure to communicate with the DS, so
further Renews will not be attempted until a new working TCP connection to
the DS is established.
It also makes the call to nfscl_cancelreqs() unconditional, since
nfscl_cancelreqs() checks the NFSCLDS_SAMECONN flag and does so while holding
the lock.
This fix only applies to the NFSv4.1 client whne using pNFS and without it
the only effect would have been an "nfscl" thread busy doing Renew attempts
on an unresponsive DS.

MFC after:      2 weeks

FreeBSD/src 336311head/sys/dev/ixgbe if_ix.c

Remove code to disable IFCAP_VLAN_HWFILTER by default for ixgbe(4) as VLAN
events are passed through by lagg(4) ever since r203548. Deactivation of
this capability by default due to lagg(4) was already not done for ixgbev(4)
and has been - although inadvertently - broken when em(4)/igb(4)/lem(4) and
ixl(4) were converted to iflib(9) in r311849 and r335338 respectively.

Reviewed by:    erj
Differential Revision:  https://reviews.freebsd.org/D15720 (part of)

FreeBSD/src 336310head/sys/geom/eli g_eli_privacy.c g_eli.c

Let geli deal with lost devices without crashing.

PR:            162036
Submitted by:   Fabian Keil <fk at fabiankeil.de>
Obtained from:  ElectroBSD
Discussed with: pjd@

FreeBSD/src 336309head/sys/dev/ixl ixl_pf_main.c ixl_txrx.c

As suggested by a comment in ixl_initialize_vsi(), use if_getcapenable(9)
instead of directly interrogating ifp->if_capenable.

Reviewed by:    erj (ixl_initialize_vsi())
Differential Revision:  https://reviews.freebsd.org/D15720 (part of)

FreeBSD/src 336308head/lib/libcapsicum capsicum_helpers.3

Fix declaration.