FreeBSD/src 353487head/sys/arm64/arm64 identcpu.c

Sort the id_aa64*_fields arrays to be in alphanumerical order.

Sponsored by:   DARPA, AFRL

FreeBSD/src 353486head/share/man/man3 arb.3

Fix some "RB_" -> "ARB_" copy and paste nits for text sourced from tree(3).

FreeBSD/src 353485head/sys/kern kern_thread.c subr_epoch.c, head/sys/sys proc.h

Since EPOCH_TRACE had been moved to opt_global.h, we don't need to waste
extra space in struct thread.

FreeBSD/src 353484head/sys/netinet in_mcast.c

Revert r353313. It is not needed with r353357 and is actually incorrect.

FreeBSD/src 353483head/sys/dev/hwpmc hwpmc_mod.c

Fix sample check in hwpmc

Don't drop samples with callchain pending

Tested by: mjg@

Submitted by:   Rajeeb Barman at amd.com
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D17011

FreeBSD/src 353482head/sys/net route.c

Add missing include which breaks builds without VIMAGE.
The bug was introduced by me in r353480.

Reported by:           Michael Butler
MFC after:             3 days

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

powerpc/pmap: Tighten condition for removing tracked pages in Book-E pmap

There are cases where there's no vm_page_t structure for a given physical
address, such as the CCSR.  In this case, trying to obtain the
md.page_tracked struct member would lead to a NULL dereference, and panic.
Tighten this up by checking for kernel_pmap AND that the page structure
actually exists before dereferencing.  The flag can only be set when it's
tracked in the kernel pmap anyway.

MFC after:      3 weeks

FreeBSD/src 353480head/sys/net route.c, head/sys/netinet sctp_bsd_addr.c sctp_usrreq.c

Use an event handler to notify the SCTP about IP address changes
instead of calling an SCTP specific function from the IP code.
This is a requirement of supporting SCTP as a kernel loadable module.
This patch was developed by markj@, I tweaked a bit the SCTP related
code.

Submitted by:          markj@
MFC after:             3 days

FreeBSD/src 353479head/share/misc committers-ports.dot, head/usr.bin/calendar/calendars calendar.freebsd

Add myself (samm) to calendar.freebsd

Approved by:    araujo (mentor), krion (mentor)
Differential Revision:  https://reviews.freebsd.org/D21985

FreeBSD/src 353478stable 12, stable/12/sys/kern link_elf.c

MFC r352829:
Fix some problems with the SPARSE_MAPPING option in the kernel linker.

FreeBSD/src 353477head/sys/conf files, head/sys/netinet sctp_dtrace_define.h sctp_kdtrace.c

Move SCTP DTrace probe definitions into a .c file.

Previously they were defined in a header which was included exactly
once.  Change this to follow the usual practice of putting definitions
in C files.  No functional change intended.

Discussed with: tuexen
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

FreeBSD/src 353476stable 12, stable/12/contrib/elftoolchain/nm nm.c

MFC r352908:
nm: Adjust argc and argv in get_opt().

FreeBSD/src 353475stable 12, stable/12/sys/riscv/riscv pmap.c

MFC r353308:
Avoid erroneously clearing PGA_WRITEABLE in riscv's pmap_enter().

FreeBSD/src 353474head/sys/fs/tmpfs tmpfs_vfsops.c

tmpfs: use MNTK_NOMSYNC

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D22009

FreeBSD/src 353473head/sys/fs/pseudofs pseudofs.c

pseudofs: use MNTK_NOMSYNC

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D22009

FreeBSD/src 353472head/sys/fs/nullfs null_vfsops.c

nullfs: use MNTK_NOMSYNC

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D22009

FreeBSD/src 353471head/sys/fs/devfs devfs_vfsops.c

devfs: use MNTK_NOMSYNC

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D22009

FreeBSD/src 353470head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs zfs_vfsops.c

zfs: use MNTK_NOMSYNC

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D22009

FreeBSD/src 353469head/sys/kern vfs_subr.c, head/sys/sys mount.h

vfs: add MNTK_NOMSYNC

On many filesystems the traversal is effectively a no-op. Add a way to avoid
the overhead.

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D22009

FreeBSD/src 353468head/sys/kern vfs_subr.c

vfs: return free vnode batches in sync instead of vfs_msync

It is a more natural fit. vfs_msync only deals with active vnodes.

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D22008

FreeBSD/src 353467head/sys/net if_vlan.c

vlan_config() isn't always called in epoch context.

Reported by:    kp

FreeBSD/src 353466head/sys/netinet6 sctp6_usrreq.c

Remove line not needed.

Submitted by:          markj@
MFC after:             3 days

FreeBSD/src 353465stable 11, stable/11/sys/sys lockf.h

MFC r353413:
Typo out->in.

FreeBSD/src 353464stable 12, stable/12/sys/sys lockf.h

MFC r353413:
Typo out->in.

FreeBSD/src 353463head/sys/vm vm_fault.c

Restore nofaulting operations after r352807

The TDP_NOFAULTING flag should be checked in vm_fault(), not in
vm_fault_trap().  Otherwise kernel accesses to userspace, like
vn_io_fault(), enter vm locking when it should not.

Reported and tested by: pho
Reviewed by:    alc, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D21992

FreeBSD/src 353462head/usr.sbin/pciconf pciconf.8 pciconf.c

Fix the botched field ordering in the last commit.  While here, fix
whitespace, and also reorder the fields so they are easier to read on
an 80 column display (the lines wrapped even before these changes).
Also fix non-standard nomenclature in the Caps code, and update the
man page.

Reported by:    rpokala

FreeBSD/src 353461head/sys/netinet6 in6_ifattach.c nd6.c

Don't cover in6_ifattach() with network epoch, as it may call into
network drivers ioctls, that may sleep.

PR:            241223

FreeBSD/src 353460head/sys/netpfil/pf pf.c

Fix the build after r353458.

MFC with:       r353458
Sponsored by:   The FreeBSD Foundation

FreeBSD/src 353459head/sys/contrib/ncsw/user/env xx.c

Fix read past end of struct in ncsw glue code.

The logic in XX_IsPortalIntr() was reading past the end of XX_PInfo.
This was causing it to erroneously return 1 instead of 0 in some
circumstances, causing a panic on the AmigaOne X5000 due to mixing
exclusive and nonexclusive interrupts on the same interrupt line.

Since this code is only called a couple of times during startup, use
a simple double loop instead of the complex read-ahead single loop.

This also fixes a bug where it would never check cpu=0 on type=1.

Approved by: jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D21988

FreeBSD/src 353458head/sys/modules/pf Makefile, head/sys/netpfil/pf pf.c

Add a missing include of opt_sctp.h.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

FreeBSD/src 353457head/sys/netinet6 ip6_forward.c

Add a missing include of opt_sctp.h.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

FreeBSD/src 353456head/usr.sbin/pciconf pciconf.c

Change from the non-standard nomenclature of "chip" and "card" to the
standard nomenclature of "device" and "vendor" with the "sub" variants.
This changes the printed format, so anything that scrapes and parses
this will need to be adapted.  No compatibility shims are provided,
but this will not be MFC'd.

Reviewed by:    jhb, emaste, gtetlow
Approved by:    jhb, emaste, gtetlow

FreeBSD/src 353455head/lib/csu/powerpc crt1.c

[PowerPC] force applications linked with lib CSU to have .got

Summary:
This forces applications linked with lib CSU to have a .got, fixing binaries
linked with LLD9 after secure-plt was enabled on FreeBSD.

Submitted by:   Alfredo Dal'Ava Junior (alfredo.junior_eldorado.org.br)
Differential Revision:  https://reviews.freebsd.org/D21476

FreeBSD/src 353454head/sys/kern subr_bus.c

Allocate device softc from the device domain.

Since we are trying to bind device interrupt threads to the device domain,
it should have sense to make memory often accessed by them local. If domain
is not known, fall back to round-robin.

MFC after:      2 weeks
Sponsored by:   iXsystems, Inc.

FreeBSD/src 353453head/sys/riscv/riscv machdep.c

A comment in subr_devmap.c mentions that devmap_print_table() should
be called on bootverbose.  Do so on RISV-V too.

Submitted by:   Nicholas O'Brien <nickisobrien_gmail.com>
Reviewed by:    imp, kp
Sponsored by:   Axiado
Differential Revision:  https://reviews.freebsd.org/D21998

FreeBSD/src 353452head/sys/netinet sctp_output.c

Ensure that local variables are reset to their initial value when
dealing with error cases in a loop over all remote addresses.
This issue was found and reported by OSS_Fuzz in:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18080
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18086
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18121
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18163

MFC after:             3 days

FreeBSD/src 353451releng 12.1, releng/12.1/lib/libucl Makefile

MFS r353450:
 MFC r353348:
  Connect the libucl(3) manual page to the build.

Approved by:    re (kib)
Sponsored by:   Rubicon Communications, LLC (Netgate)

FreeBSD/src 353450stable 11 12, stable/11/lib/libucl Makefile

MFC r353348:
 Connect the libucl(3) manual page to the build.

Sponsored by:   Rubicon Communications, LLC (Netgate)

FreeBSD/src 353449head Makefile.libcompat

Centralize adding OBJCOPY=${XOBJCOPY} to LIB32WMAKEFLAGS.

Reviewed by:    emaste, imp
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D21983

FreeBSD/src 353448head/tests/sys/kern coredump_phnum_test.sh

coredump_phnum_test: handle full file system gracefully

Skip the test if the file system is full.  That's out of scope
of this test.

MFC after:      1 week
Sponsored by:   Dell EMC Isilon

FreeBSD/src 353447head/sys/fs/devfs devfs_vnops.c

devfs_vptocnp(): correct the component name when node is not at top.

Node' cdp.si_name is the full path as provided by make_dev(9), it
should not be returned by VOP_VPTOCNP() when only the last component
is requested.  Use the dirent entry instead.

With this note, handling of VDIR and VCHR nodes only differs in
handling of root vnode, which simplifies and unifies the logic.

Reported by:    Li, Zhichao1 <Zhichao_Li1 at Dell.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week

FreeBSD/src 353446head/sys/fs/msdosfs msdosfs_fat.c

Plug the rest of undef behavior places that were missed in r337456.

There are three more places in msdosfs_fat.c which might shift one
into the sign bit.  While there, fix formatting of KASSERTs.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week

FreeBSD/src 353445stable 11, stable/11/lib/libnetgraph msg.c

MFC r347439 by markj: Atomically update the global gMsgId in libnetgraph.

Otherwise concurrently running threads may inadvertently use the same
token for different messages.

Preserve the behaviour of disallowing negative message tokens, but allow
a message token value of zero since this simplifies the code a bit and
tokens are documented to be non-negative.

PR:            234442

FreeBSD/src 353444head/sys/dev/xen/netback netback.c

Remove an unneeded include of opt_sctp.h.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

FreeBSD/src 353443head/sys/kern vfs_mountroot.c

mountroot: run statfs after mounting devfs

The usual flow for mounting a file system is to VFS_MOUNT() and then
immediately VFS_STATFS().

That's not done in vfs_mountroot_devfs(), which means the
mp->mnt_stat.f_iosize field is not correctly populated, which in turn
causes us to mark valid aio operations as unsafe (because the io size is
set to 0), ultimately causing the aio_test:md_waitcomplete test to fail.

Reviewed by:    mckusick
MFC after:      1 week
Sponsored by:   Axiado
Differential Revision:  https://reviews.freebsd.org/D21897

FreeBSD/src 353442head/sys/cddl/compat/opensolaris/sys atomic.h

fix up r353340, don't assume that fcmpset has strong semantics

fcmpset can have two kinds of semantics, weak and strong.
For practical purposes, strong semantics means that if fcmpset fails
then the reported current value is always different from the expected
value.  Weak semantics means that the reported current value may be the
same as the expected value even though fcmpset failed.  That's a so
called "sporadic" failure.

I originally implemented atomic_cas expecting strong semantics, but many
platforms actually have weak one.

Reported by:    pkubaj (not confirmed if same issue)
Discussed with: kib, mjg
MFC after:      19 days
X-MFC with:     r353340

FreeBSD/src 353441head/sys/riscv/riscv machdep.c

Call devmap_bootstrap in RISC-V machine dependent code to actually create
the static device mappings.

While RISC-V support was added to subr_devmap.c in r298631, it was never
actually initialised in the machine dependent code.

Submitted by:   Nicholas O'Brien <nickisobrien_gmail.com>
Reviewed by:    br, kp
Sponsored by:   Axiado
Differential Revision:  https://reviews.freebsd.org/D21975

FreeBSD/src 353440head/release Makefile.vm

Increase the default VMSIZE for raw, qcow2, vhd, and vmdk virtual
machine images due to 'filesystem full' failures.

Sponsored by:   Rubicon Communications, LLC (Netgate)

FreeBSD/src 353439head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs dmu.c

MFZol: Fix performance of "zfs recv" with many deletions

This patch fixes 2 issues with the DMU free throttle implemented
in dmu_free_long_range(). The first issue is that get_next_chunk()
was calculating the number of L1 blocks the free would dirty
incorrectly. In some cases involving extremely large files, this
code would greatly overestimate the number of affected L1 blocks,
causing excessive calls to txg_wait_open(). This patch corrects
the calculation.

The second issue is that the free throttle uses the total number
of free'd blocks in all (open, quiescing, and syncing) txgs to
determine whether to throttle. This causes large frees (such as
those created by the first issue) to cause 4 txg syncs before
any further frees were allowed to proceed. This patch ensures
that the accounting is done entirely in a per-txg fashion, so
that frees from a given txg don't affect those that immediately
follow it.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens at delphix.com>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
zfsonlinux/zfs at f4c594da94d856c422512a54e48070f890b2685b

Freeing throttle should account for holes

    [17 lines not shown]

FreeBSD/src 353438head/sys/amd64/amd64 pmap.c

amd64 pmap: handle fictitious mappigns with addresses beyond pv_table

There are provisions to do it already with pv_dummy, but new locking code
did not account for it. Previous one did not have the problem because
it hashed the address into the lock array.

While here annotate common vars with __read_mostly and __exclusive_cache_line.

Reported by:    Thomas Laus
Tesetd by:      jkim, Thomas Laus
Fixes: r353149 ("amd64 pmap: implement per-superpage locks")
Sponsored by:   The FreeBSD Foundation