FreeBSD/src 353772projects/nfsv42/sys/fs/nfsserver nfs_nfsdserv.c

Replace the two sysctls with one to enable a Linux compatible NFSv4.2 server.

To be compatible with the NFSv4.2 client shipping in the 5.n Linux kernel,
two changes in behaviour are currently required. Replace the two sysctls
that enable these with the single sysctl vfs.nfsd.linux42server to minimize
confusion over what needs to be done to be Linux compatible.
There may also be more of these behaviour changes that have not yet been
found during interoperability testing with Linux.

FreeBSD/src 353771head/share/mk

Fix spelling of DPSRCS.

Submitted by:   vangyzen
Sponsored by:   DellEMC
MFC after:      2 weeks

FreeBSD/src 353770head/sys/net debugnet.c, head/sys/netinet/netdump netdump_client.c

Fix compile issues when building a kernel without the VIMAGE option.
Thanks to cem@ for discussing the issue which resulted in this patch.

Reviewed by:           cem@
Sponsored by:          Netflix, Inc.
Differential Revision:

FreeBSD/src 353769head/usr.bin/fstat fstat.c fstat.1

Add the fstat -s option to display socket information.

Reviewed by:    jilles
MFC after:      1 week
Relnotes:       yes
Differential Revision:

FreeBSD/src 353768head/usr.bin/procstat procstat_files.c


Requested by rgrimes@ in

FreeBSD/src 353767head/sys/x86/x86 intr_machdep.c

hw.intrbalance: Make sysctl tunable

This allows specifying a boot-time preference in loader.conf.

FreeBSD/src 353766head/sys/powerpc/booke pmap.c

powerpc/booke pmap: Fix printf format type warnings

FreeBSD/src 353765stable 12 11, stable/11/usr.bin/clang/lld Makefile

MFC r353655:

Ensure lld respects the WITH/WITHOUT_SHARED_TOOLCHAIN option

Traditionally, toolchain components such as cc, as, and ld have been
built as static executables.  The WITH_SHARED_TOOLCHAIN option from
src.conf(5) is meant to link these as regular executables, e.g. using
shared libraries.

The build of ld.lld did not yet check this option.  Fix the Makefile so
it will do so now.

Reported by:    Mike Cui <cuicui at>
PR:            241257

FreeBSD/src 353764head/sys/contrib/dev/acpica changes.txt, head/sys/contrib/dev/acpica/compiler dtcompilerparser.l dtcompilerparser.y

Merge ACPICA 20191018.

FreeBSD/src 353763user/uqs/git_conv/base-head.git/.git config, user/uqs/git_conv/doc-head.git/.git config

Update git configs to resolve the diffs against production.

FreeBSD/src 353762user/uqs/git_conv git_conv

Fix pushing after refactoring in r352632

FreeBSD/src 353761user/uqs/git_conv/svn2git/src svn.cpp

Prevent svn2git from recording a merge commit for r306097

This would pull in all history of stable into master, and we usually merge the
other way.

Reported by:    emaste

FreeBSD/src 353760stable 12, stable/12/sys/mips/include atomic.h

MFC r353166: add atomic_load_64 for mipsn32

FreeBSD/src 353759stable/11/cddl/contrib/opensolaris/cmd/zfs zfs_main.c zfs.8, stable/11/cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c

MFC r353037: ZFS: add bookmark renaming

FreeBSD/src 353758stable/12/cddl/contrib/opensolaris/cmd/zfs zfs_main.c zfs.8, stable/12/cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c

MFC r353037: ZFS: add bookmark renaming

FreeBSD/src 353757head/stand/libsa/zfs zfs.c

loader: zfs_fmtdev can crash when pool discovery did fail and we have no spa

When zfs probe did fail and no spa was created, but zfs_fmtdev() is called,
we will crash while dereferencing spa (NULL pointer dereference).

MFC after:      1 week

FreeBSD/src 353756stable 11, stable/11/cddl/contrib/opensolaris/lib/libzfs/common libzfs_sendrecv.c

MFC r353343: zfs: remove gratuitous divergence from other openzfs flavours

FreeBSD/src 353755stable 12, stable/12/cddl/contrib/opensolaris/lib/libzfs/common libzfs_sendrecv.c

MFC r353343: zfs: remove gratuitous divergence from other openzfs flavours

FreeBSD/src 353754stable 12, stable/12/cddl/contrib/opensolaris/cmd/zpool zpool-features.7

MFC r353341,r353342: zfs: document large_dnode feature

FreeBSD/src 353753stable/11/share/man/man4 Makefile

MFC r353434: man4/Makefile: fix sorting for some entries starting with 'v'

FreeBSD/src 353752stable 12, stable/12/share/man/man4 Makefile

MFC r353434: man4/Makefile: fix sorting for some entries starting with 'v'

FreeBSD/src 353751stable 11, stable/11/cddl/contrib/opensolaris/cmd/zfs zfs-program.8

MFC r353649: fix section number in zfs-program.8

FreeBSD/src 353750stable 12, stable/12/cddl/contrib/opensolaris/cmd/zfs zfs-program.8

MFC r353649: fix section number in zfs-program.8

FreeBSD/src 353749head Makefile.inc1

buildkernel: always add standard kernel configuration include path

This should change nothing for kernel configurations at the standard
locations in the source tree.  However, if KERNCONFDIR is used to
specify a custom location for a kernel configuration file (e.g., out of
tree), then both the custom location and the standard location, in this
order, will be used as include paths for config(8).  This will allow the
kernel configuration to include files from both locations.

Reviewed by:    bdrewery
MFC after:      16 days
Differential Revision:
+2-11 files

FreeBSD/src 353748head/sys/x86/x86 cpu_machdep.c

remove wmb() call from x86 cpu_reset()

The rationale is pretty much the same as in r353747.
There is no subsequent dependent store.
The store is to the regular (TSO) memory anyway.

MFC after:      23 days

FreeBSD/src 353747head/sys/amd64/vmm vmm.c

vmm: remove a wmb() call

After removing wmb(), vm_set_rendezvous_func() became super trivial, so
there was no point in keeping it.

The wmb (sfence on amd64, lock nop on i386) was not needed.  This can be
explained from several points of view.

First, wmb() is used for store-store ordering (although, the primitive
is undocumented).  There was no obvious subsequent store that needed the

Second, x86 has a memory model with strong ordering including total
store order.  An explicit store barrier may be needed only when working
with special memory (device, special caching mode) or using special
instructions (non-temporal stores).  That was not the case for this

Third, I believe that there is a misconception that sfence "flushes" the
store buffer in a sense that it speeds up the propagation of stores from
the store buffer to the global visibility.  I think that such
propagation always happens as fast as possible.  sfence only makes
subsequent stores wait for that propagation to complete.  So, sfence is
only useful for ordering of stores and only in the situations described

    [4 lines not shown]

FreeBSD/src 353746head/sys/powerpc/aim trap_subr64.S

powerpc/aim: Fix comment typo

FreeBSD/src 353745head/sys/powerpc/mpc85xx pci_mpc85xx.c

powerpc/mpc85xx: Replace global PCI config mutex with per-controller mutex

PCI controllers need to enforce exclusive config register access on their
own bus, not between all buses.

FreeBSD/src 353744user/cperciva/freebsd-update-build/scripts 12.1-RC2, user/cperciva/freebsd-update-build/scripts/12.1-RC2 amd64 i386

Add 12.1-RC2.

FreeBSD/src 353743head

Do not remove /usr/share/mk/  It was reintroduced by r353659.

FreeBSD/src 353742head/sys/conf files, head/sys/net debugnet.c

Fix debugnet(4) link/build fallout on some configurations

Introduced in r353685 (sys/conf/files), r353694 (debugnet.c db_printf).

Submitted by:   kevans
Reported by:    cy
X-MFC-With:     r353685, r353694

FreeBSD/src 353741head/sys/dev/netmap if_ptnet.c, head/sys/dev/virtio/network virtio_net.h

tap: add support for virtio-net offloads

This patch is part of an effort to make bhyve networking (in particular TCP)
faster. The key strategy to enhance TCP throughput is to let the whole packet
datapath work with TSO/LRO packets (up to 64KB each), so that the per-packet
overhead is amortized over a large number of bytes.
This capability is supported in the guest by means of the vtnet(4) driver,
which is able to handle TSO/LRO packets leveraging the virtio-net header
(see struct virtio_net_hdr and struct virtio_net_hdr_mrg_rxbuf).
A bhyve VM exchanges packets with the host through a network backend,
which can be vale(4) or if_tap(4).
While vale(4) supports TSO/LRO packets, if_tap(4) does not.
This patch extends if_tap(4) with the ability to understand the virtio-net
header, so that a tapX interface can process TSO/LRO packets.
A couple of ioctl commands have been added to configure and probe the
virtio-net header. Once the virtio-net header is set, the tapX interface
acquires all the IFCAP capabilities necessary for TSO/LRO.

Reviewed by:    kevans
Differential Revision:

FreeBSD/src 353740head/sys/dev/nvdimm nvdimm_spa.c nvdimm_var.h

nvdimm(4): Persist unit numbers in cdev

They're formatted into the device name like unit numbers, anyway; store the
number in mda_unit => si_drv0 like dev2unit() expects.

No functional change intended.

Sponsored by:   Dell EMC Isilon

FreeBSD/src 353739head/contrib/llvm/tools/clang/lib/Driver/ToolChains Gnu.cpp Clang.cpp, head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch Mips.cpp Mips.h

Pull in r374154 from upstream clang trunk (by Simon Atanasyan):

  [mips] Set default float ABI to "soft" on FreeBSD

  Initial patch by Kyle Evans.

  Fix PR43596

Requested by:   kevans
MFC after:      1 month
X-MFC-With:     r353358

FreeBSD/src 353738head/contrib/llvm/tools/lld/ELF Driver.cpp

Pull in r372651 from upstream lld trunk (by Simon Atanasyan):

  [mips] Support elf32btsmipn32_fbsd / elf32ltsmipn32_fbsd emulations

  Patch by Kyle Evans.

Requested by:   kevans
MFC after:      1 month
X-MFC-With:     r353358


Provide a src.conf(5) description for the new WITHOUT_CAROOT option, and
rename the WITH_LOADER_VERIEXEC_PASS_MANFIEST description to its correct
name.  Also correct a bunch of spelling errors in that description.

MFC after:      3 days

FreeBSD/src 353736vendor-sys/acpica 20191018

Tag ACPICA 20191018.

FreeBSD/src 353735vendor-sys/acpica/dist/source/compiler dtfield.c dtio.c, vendor-sys/acpica/dist/source/components/debugger dbnames.c

Import ACPICA 20191018.

FreeBSD/src 353734head/sys/vm vm_page.c

Further constrain the use of per-CPU caches for free pages.

In low memory conditions a significant number of pages may end up stuck
in the caches, and currently these caches cannot be reaped, leading to
spurious memory allocation failures and OOM kills.  So:

- Take into account the fact that we may cache up to two full buckets
  of pages per CPU, not just one.
- Increase the amount of RAM required per CPU to enable the caches.

This is a temporary measure until the page cache management policy is

PR:            241048
Reported and tested by: Kevin Oberman <rkoberman at>
Reviewed by:    alc, kib
Discussed with: jeff
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:

FreeBSD/src 353733head/sys/ufs/ffs ffs_softdep.c

Abbreviate softdep lock names.

The softdep lock names were unusually long and tended to stick out in
lock profiling reports.  Abbreviate them and make them consistent with
our conventional style for lock names.

Reviewed by:    mckusick
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:

FreeBSD/src 353732head/sys/net route.c route.h

Make rt_getifa_fib() static.

FreeBSD/src 353731head/sys/amd64/amd64 pmap.c, head/sys/conf ldscript.amd64

Tighten mapping protections on preloaded files on amd64.

- We load the kernel at 0x200000.  Memory below that address need not
  be executable, so do not map it as such.
- Remove references to .ldata and related sections in the kernel linker
  script.  They come from ld.bfd's default linker script, but are not
  used, and we now use ld.lld to link the amd64 kernel.  lld does not
  contain a default linker script.
- Pad the .bss to a 2MB as we do between .text and .data.  This
  forces the loader to load additional files starting in the following
  2MB page, preserving the use of superpage mappings for kernel data.
- Map memory above the kernel image with NX.  The kernel linker now
  upgrades protections as needed, and other preloaded file types
  (e.g., entropy, microcode) need not be mapped with execute permissions
  in the first place.

Reviewed by:    kib
MFC after:      1 month
Sponsored by:   Netflix
Differential Revision:

FreeBSD/src 353730head/sys/kern link_elf.c link_elf_obj.c, head/sys/vm vm_kern.c

Apply mapping protections to preloaded kernel modules on amd64.

With an upcoming change the amd64 kernel will map preloaded files RW
instead of RWX, so the kernel linker must adjust protections
appropriately using pmap_change_prot().

Reviewed by:    kib
MFC after:      1 month
Sponsored by:   Netflix
Differential Revision:

FreeBSD/src 353729head/sys/kern link_elf_obj.c

Apply mapping protections to .o kernel modules.

Use the section flags to derive mapping protections.  When multiple
sections overlap within a page, the union of their protections must be
applied.  With r353701 the .text and .rodata sections are padded to
ensure that this does not happen on amd64.

Reviewed by:    kib
MFC after:      1 month
Sponsored by:   Netflix
Differential Revision:

FreeBSD/src 353728stable 12, stable/12/sys/dev/xen/netback netback.c

MFC r353444:
Remove an unneeded include of opt_sctp.h.

FreeBSD/src 353727head/sys/dev/gpio gpioiic.c

gpioiic: add the detach method

bus_generic_detach was not enough, we also need to clean up the iicbus
child device.

MFC after:      1 week

FreeBSD/src 353726head/sbin/ddb ddb.conf, head/share/man/man4 textdump.4

ddb: use 'textdump dump' instead of 'call doadump'

The change is for the example in textdump.4 and the default ddb.conf.

First of all, doadump now requires an argument and it won't do a
textdump if the argument is not 'true'.
And 'textdump dump' is more idiomatic anyway.

For what it's worth, ddb 'dump' command seems to always request a vmcore
dump even if a textdump was requested earlier, e.g., by 'textdump set'.
Finally, ddb 'call' command is not documented.

MFC after:      2 weeks

FreeBSD/src 353725head/sys/amd64/linux linux_sysvec.c, head/sys/amd64/linux32 linux32_sysvec.c

linux: futex_mtx should follow futex_list

Move futex_mtx to linux_common.ko for amd64 and aarch64 along
with respective list/mutex init/destroy.

PR:            240989
Reported by:    Alex S <iwtcex at>

FreeBSD/src 353724head/sys/compat/linux linux_futex.c linux.c

linux: provide just one instance of futex_list

Move futex_list definition to linux.c which is included once
in linux.ko (i386) and in linux_common.ko (amd64 and aarch64)
allowing 32/64 bit linux programs to access the same futexes
in the latter case.

PR:            240989
Reviewed by:    dchagin
Differential Revision:

FreeBSD/src 353723stable 12, stable/12/sbin/ipfw ipv6.c

MFC r353545:
  Explicitly initialize the memory buffer to store O_ICMP6TYPE opcode.

  By default next_cmd() initializes only first u32 of opcode. O_ICMP6TYPE
  opcode has array of bit masks to store corresponding ICMPv6 types.
  An opcode that precedes O_ICMP6TYPE, e.g. O_IP6_DST, can have variable
  length and during opcode filling it can modify memory that will be used
  by O_ICMP6TYPE opcode. Without explicit initialization this leads to
  creation of wrong opcode.

  Reported by:  Boris N. Lytochkin
  Obtained from:        Yandex LLC