FreeBSD/src 343338head/usr.bin/systat devs.c

Fix systat's :only command parser for the multiple arguments case

According to systat(1) :only option is supposed to accept multiple drives
but the parser for its arguments stops after first entry. Fix the parser
logic to accept multiple drives.

PR:            59220
Reported by:    Andy Farkas <andyf at speednet.com.au>
MFC after:      1 week

FreeBSD/src 343337stable 10 12, stable/10/contrib/ipfilter pcap-bpf.h

MFC r343103:

Remove redundant ipfilter version of pcap-bpf.h. As of r214535 it was
no longer needed.

FreeBSD/src 343336stable 10 12, stable/10/contrib/ipfilter mli_ipl.c

MFC r343073:

Remove an IRIX-only source file.

FreeBSD/src 343335head/lib/libbe be.c

libbe(3): simplify import, allow replication streams

Previously, we directly used libzfs_core's lzc_receive to import to a
temporary snapshot, then cloned the snapshot and setup the properties. This
failed when attempting to import replication streams with questionable
error.

libzfs's zfs_receive is a much better fit here, so we now use it instead
with the destination dataset and let libzfs take care of the dirty details.
be_import is greatly simplified as a result.

Reported by:    Marie Helene Kvello-Aune <freebsd at mhka.no>
MFC after:      1 week
DeltaFile
+7-42head/lib/libbe/be.c
+7-421 files

FreeBSD/src 343334stable 11, stable/11/sys/geom geom_dev.c

MFC r342558: Switch from mutexes to atomics in GEOM_DEV I/O path.

Mutexes in I/O path there were used twice per I/O to atomically access
several variables to close and/or destroy the device on last request
completion.  I found the way to fit all required info into one integer,
suitable for atomic operations.  It opened race window on device close,
but addition of timeout to the msleep() there should cover it.

Profiling shows removal of significant spinning time on those mutexes
and IOPS increase from ~600K to >800K to NVMe on 72-core systems.

FreeBSD/src 343333stable 12, stable/12/sys/geom geom_dev.c

MFC r342558: Switch from mutexes to atomics in GEOM_DEV I/O path.

Mutexes in I/O path there were used twice per I/O to atomically access
several variables to close and/or destroy the device on last request
completion.  I found the way to fit all required info into one integer,
suitable for atomic operations.  It opened race window on device close,
but addition of timeout to the msleep() there should cover it.

Profiling shows removal of significant spinning time on those mutexes
and IOPS increase from ~600K to >800K to NVMe on 72-core systems.

FreeBSD/src 343332stable 11, stable/11/sys/dev/nvme nvme_qpair.c

MFC r342546: Add descriptions to NVMe interrupts.

FreeBSD/src 343331stable 12, stable/12/sys/dev/nvme nvme_qpair.c

MFC r342546: Add descriptions to NVMe interrupts.

FreeBSD/src 343330stable 12, stable/12/sys/kern kern_mtxpool.c

Increase MTX_POOL_SLEEP_SIZE from 128 to 1024.

This value remained unchanged for 15 years, and now this bump reduces
lock spinning in GEOM and BIO layers while doing ~1.6M IOPS to 4 NVMe
on 72-core system from ~25% to ~5% by the cost of additional 28KB RAM.

While there, align struct mtx_pool fields to cache lines.

FreeBSD/src 343329stable 11, stable/11/sys/kern kern_mtxpool.c

MFC r342400: Increase MTX_POOL_SLEEP_SIZE from 128 to 1024.

This value remained unchanged for 15 years, and now this bump reduces
lock spinning in GEOM and BIO layers while doing ~1.6M IOPS to 4 NVMe
on 72-core system from ~25% to ~5% by the cost of additional 28KB RAM.

While there, align struct mtx_pool fields to cache lines.

FreeBSD/src 343328stable 12, stable/12/sys/dev/nvme nvme_sim.c

MFC r342399: Remove CAM SIM lock from NVMe SIM.

CAM does not require SIM lock since FreeBSD 10.4, and NVMe code never
required it at all, using per-queue locks instead.  This formally allows
parallel request submission in CAM mode as much as single per-device and
per-queue locks of CAM allow.

FreeBSD/src 343327head/sys/dev/sound/pci/hda hdaa_patches.c hdac.h

Add quirk to enable mic and headphones redirection on HP Spectre laptops.

Tested on HP AF006UR.

MFC after:      2 weeks

FreeBSD/src 343326stable/10/lib/libc/string strcat.3 strcpy.3, stable/11/lib/libc/string strcpy.3 strcat.3

MFC: 325765 (imp) Add notes about overlapping copies.

Add notes to each of these that specifically state that results are
undefined if the strings overlap. In the case of memcpy, we document
the overlapping behavior on FreeBSD (pre-existing). For str*, it is
left unspecified, however, since the default (and x86) implementations
do not handle overlapping strings properly.

PR: 223653
Approved by:    phk (mentor)

FreeBSD/src 343325stable 11, stable/11/sys/dev/amdsmn amdsmn.c

MFC r342977 (by cem): amdtemp(4): Add support for Family 15h, Model >=60h

Family 15h is a bit of an oddball.  Early models used the same temperature
register and spec (mostly[1]) as earlier CPU families.

Model 60h-6Fh and 70-7Fh use something more like Family 17h's Service
Management Network, communicating with it in a similar fashion.  To support
them, add support for their version of SMU indirection to amdsmn(4) and use
it in amdtemp(4) on these models.

While here, clarify some of the deviceid macros in amdtemp(4) that were
added with arbitrary, incorrect family numbers, and remove ones that were
not used.  Additionally, clarify intent and condition of heterogenous
multi-socket system detection.

[1]: 15h adds the "adjust range by -49°C if a certain condition is met,"
which previous families did not have.

Reported by:    D. C. <tjoard AT gmail.com>
PR:             234657
Tested by:      D. C. <tjoard AT gmail.com>

FreeBSD/src 343324stable 11, stable/11/sys/dev/amdtemp amdtemp.c

MFC r340426 (by cem): amdtemp(4): Fix temperature reporting on AMD 2990WX

Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255
OSRR, section 4.2.1.

For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the
range -49..206; i.e., subtract 49°C.

Submitted by:   gallatin@
Reported by:    bcran@

FreeBSD/src 343323stable 11, stable/11/sys/dev/amdsmn amdsmn.c

MFC r340425 (by cem): amdsmn(4)/amdtemp(4): Attach to Ryzen 2 hostbridges

As reported, tested, and patch supplied by Johannes.

There may be future work to do to support multiple sensors, but for now, any
sensor at all is a strict improvement for Ryzen 2 systems.

PR:             228480
Submitted by:   Johannes Lundberg <johalun0 AT gmail.com> (earlier version)
Reported by:    deischen@, Johannes, and numerous others

FreeBSD/src 343322stable 12, stable/12/sys/dev/amdsmn amdsmn.c

MFC r342977 (by cem): amdtemp(4): Add support for Family 15h, Model >=60h

Family 15h is a bit of an oddball.  Early models used the same temperature
register and spec (mostly[1]) as earlier CPU families.

Model 60h-6Fh and 70-7Fh use something more like Family 17h's Service
Management Network, communicating with it in a similar fashion.  To support
them, add support for their version of SMU indirection to amdsmn(4) and use
it in amdtemp(4) on these models.

While here, clarify some of the deviceid macros in amdtemp(4) that were
added with arbitrary, incorrect family numbers, and remove ones that were
not used.  Additionally, clarify intent and condition of heterogenous
multi-socket system detection.

[1]: 15h adds the "adjust range by -49°C if a certain condition is met,"
which previous families did not have.

Reported by:    D. C. <tjoard AT gmail.com>
PR:             234657
Tested by:      D. C. <tjoard AT gmail.com>

FreeBSD/src 343321projects/clang800-import/contrib/llvm/lib/Target/Mips/MCTargetDesc MipsAsmBackend.cpp

Reduce diff against upstream.

FreeBSD/src 343320projects/clang800-import/sbin/ifconfig ifieee80211.c, projects/clang800-import/sbin/pfctl pfctl_altq.c

Merge ^/head r343202 through r343319.

FreeBSD/src 343319projects/clang800-import/lib/clang/include/clang/Basic Version.inc, projects/clang800-import/lib/clang/include/clang/Config config.h

Now for the release_80 branch, update version numbers for llvm, clang
and lld, and regenerate config headers.

FreeBSD/src 343318projects/clang800-import/contrib compiler-rt

Merge compiler-rt release_80 branch r351543, and resolve conflicts.

FreeBSD/src 343317projects/clang800-import/contrib libc++

Merge libc++ release_80 branch r351543, and resolve conflicts.

FreeBSD/src 343316projects/clang800-import/contrib/llvm/tools lldb, projects/clang800-import/contrib/llvm/tools/lldb/include/lldb/Host/openbsd HostInfoOpenBSD.h

Merge lldb release_80 branch r351543, and resolve conflicts.

FreeBSD/src 343315projects/clang800-import/contrib/llvm/tools/lld/ELF Thunks.cpp Options.td, projects/clang800-import/contrib/llvm/tools/lld/ELF/Arch X86_64.cpp

Merge lld release_80 branch r351543, and resolve conflicts.

FreeBSD/src 343314projects/clang800-import/contrib/llvm/tools clang, projects/clang800-import/contrib/llvm/tools/clang/include/clang/Basic DiagnosticSemaKinds.td

Merge clang release_80 branch r351543, and resolve conflicts.

FreeBSD/src 343313projects/clang800-import/contrib/llvm/lib/MC MCWin64EH.cpp, projects/clang800-import/contrib/llvm/lib/Target/AMDGPU SIISelLowering.cpp

Merge llvm release_80 branch r351543, and resolve conflicts.

FreeBSD/src 343312projects/clang800-import/lib/libclang_rt/asan Makefile, projects/clang800-import/lib/libclang_rt/asan_dynamic Makefile

Update compiler-rt build glue.

FreeBSD/src 343311projects/clang800-import/contrib/compiler-rt/lib/hwasan hwasan_report.cc, projects/clang800-import/contrib/compiler-rt/lib/sanitizer_common sanitizer_common_interceptors.inc sanitizer_platform_limits_freebsd.h

Merge compiler-rt trunk r351319, and resolve conflicts.

FreeBSD/src 343310projects/clang800-import ObsoleteFiles.inc, projects/clang800-import/lib/libc++ Makefile

Update libc++ build glue, and ObsoleteFiles.

FreeBSD/src 343309projects/clang800-import/contrib/libc++/include chrono functional, projects/clang800-import/contrib/libc++/include/experimental dynarray

Merge libc++ trunk r351319, and resolve conflicts.

FreeBSD/src 343308projects/clang800-import/contrib/llvm/tools/lld/ELF DriverUtils.cpp Driver.h, projects/clang800-import/usr.bin/clang/lld Makefile

Remove customizations in #includes of Options.inc, and adjust lld
Makefile to generate the file in the right place.

FreeBSD/src 343307projects/clang800-import/lib/clang/liblldb Makefile, projects/clang800-import/usr.bin/clang/lldb Makefile

Update lldb build glue to make MK_LLDB=yes work.

FreeBSD/src 343306projects/clang800-import/contrib/llvm/tools/lldb/source/Symbol ClangASTContext.cpp

Add #ifdef LLDB_ENABLE_ALL guards to prevent accessing the PDB AST
parser, which we have disabled in our lldb.

FreeBSD/src 343305head/sys/net if.c

Rework CASE_IOC_IFGROUPREQ() to require a case before the macro.

This is more compatible with formatting tools and looks more normal.

Reported by:    jhb (on a different review)
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D18442
DeltaFile
+6-6head/sys/net/if.c
+6-61 files

FreeBSD/src 343304stable 12, stable/12/sys/net iflib.c iflib_private.h

MFC r341095:

  Use busdma unconditionally in iflib

  - Remove the complex mechanism to choose between using busdma
  and raw pmap_kextract at runtime.   The reduced complexity makes
  the code easier to read and maintain.

  - Fix a bug in the small packet receive path where clusters were
  repeatedly mapped but never unmapped. We now store the cluster's
  bus address and avoid re-mapping the cluster each time a small
  packet is received.

  This patch fixes bugs I've seen where ixl(4) will not even
  respond to ping without seeing DMAR faults.

  I see a small improvement (14%) on packet forwarding tests using
  a Haswell based Xeon E5-2697 v3.  Olivier sees a small
  regression (-3% to -6%) with lower end hardware.

Reviewed by:    mmacy
Sponsored by:   Netflix, Inc
Differential Revision:  https://reviews.freebsd.org/D17901

FreeBSD/src 343303head/usr.sbin/kbdmap kbdmap.c

Silence a CI warning regarding the use of strcpy().

While this is a false positive (a sufficiently large buffer has been
allocated in the line above), the use of strdup() simplifies and clarifies
the code.

MFC after:      2 weeks

FreeBSD/src 343302head/sys/sys rmlock.h rwlock.h

Remove unused *_sysinit_flags() declarations.

Submitted by:   Sebastian Huber <sebastian.huber at embedded-brains.de>
MFC after:      3 days

FreeBSD/src 343301head/sys/modules/vmware/vmxnet3 Makefile

Add missing dependency to vmxnet3 Makefile and clean it up a bit otherwise.

MFC after:      1 week

FreeBSD/src 343300stable 11, stable/11/sys/dev/oce oce_if.c oce_mbox.c

MFC r342856: Added support for the SIOCGI2C ioctl.

Submitted by:   Ram Kishore Vegesna <ram.vegesna at broadcom.com>
Obtained from:  Broadcom

FreeBSD/src 343299stable 12, stable/12/sys/dev/oce oce_if.c oce_mbox.c

MFC r342856: Added support for the SIOCGI2C ioctl.

Submitted by:   Ram Kishore Vegesna <ram.vegesna at broadcom.com>
Obtained from:  Broadcom

FreeBSD/src 343298head/sys/compat/ndis kern_windrv.c pe_var.h

[ndis] Fix unregistered use of FPU by NDIS in kernel on amd64

amd64 miniport drivers are allowed to use FPU which triggers "Unregistered use
of FPU in kernel" panic.

Wrap all variants of MSCALL with fpu_kern_enter/fpu_kern_leave.  To reduce
amount of allocations/deallocations done via
fpu_kern_alloc_ctx/fpu_kern_free_ctx maintain cache of fpu_kern_ctx elements.

Based on the patch by Paul B Mahol

PR:            165622
Submitted by:   Vlad Movchan <vladislav.movchan at gmail.com>
MFC after:      1 month

FreeBSD/src 343297head/tests/sys/netpfil/pf/ioctl validation.c

pf tests: Check size validation in DIOCGETSRCNODES

Ensure that invalid sizes for DIOCGETSRCNODES do not cause panics.

MFC after:       1 week

FreeBSD/src 343296head/sbin/pfctl pfctl_altq.c

Remove unused function gsc_destroy()

gsc_destroy() is no longer needed as of r343287.

MFC after:      1 week

FreeBSD/src 343295head/sys/netpfil/pf pf_ioctl.c

pf: Validate psn_len in DIOCGETSRCNODES

psn_len is controlled by user space, but we allocated memory based on it.
Check how much memory we might need at most (i.e. how many source nodes we
have) and limit the allocation to that.

Reported by:    markj
MFC after:      1 week

FreeBSD/src 343294stable 11, stable/11/sys/compat/linux linux_socket.c

MFC r342864:
Specify the correct option level when emulating SO_PEERCRED.

PR:     234722

FreeBSD/src 343293stable 12, stable/12/sys/compat/linux linux_socket.c

MFC r342864:
Specify the correct option level when emulating SO_PEERCRED.

PR:     234722

FreeBSD/src 343292head/sys/dev/iwn if_iwn.c

iwn(4): drop i_seq field initialization for A-MPDU frames.

It is done by net80211 since r319460.

MFC after:      24 days
X-MFC-With:     343094

FreeBSD/src 343291head/sys/dev/vmware/vmxnet3 if_vmx.c if_vmxvar.h, head/sys/net iflib.c iflib.h

onvert vmx(4) to being an iflib driver.

Also, expose IFLIB_MAX_RX_SEGS to iflib drivers and add
iflib_dma_alloc_align() to the iflib API.

Performance is generally better with the tunable/sysctl
dev.vmx.<index>.iflib.tx_abdicate=1.

Reviewed by:    shurd
MFC after:      1 week
Relnotes:       yes
Sponsored by:   RG Nets
Differential Revision:  https://reviews.freebsd.org/D18761

FreeBSD/src 343290stable 11, stable/11/sys/netpfil/pf pf_table.c

MFC r343041

pf: silence a runtime warning

Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion failed'.
This warning does not clarify anything for users, so silence it, just as
OpenBSD has.

PR:            234874

FreeBSD/src 343289stable 12, stable/12/sys/netpfil/pf pf_table.c

MFC r343041

pf: silence a runtime warning

Sometimes, for negated tables, pf can log 'pfr_update_stats: assertion failed'.
This warning does not clarify anything for users, so silence it, just as
OpenBSD has.

PR:            234874