FreeBSD/src 2ae0f5asys/compat/linuxkpi/common/include/linux io.h

linuxkpi: Make arch_io_*_memtype_wc amd64-only

Linux only implements these functions on x86.  They return 0 on other
architectures.  The FreeBSD implementation calls PHYS_TO_DMAP but this
panics on i386 because it does not have a direct map so return 0 on i386
as well for now.  These functions are only used by graphics/drm-*-kmod
to mark the VRAM aperture write-combining but this is also accomplished
by a call to vm_phys_fictitious_reg_range so this change is sufficient
to fix drm-*-kmod on i386 for FreeBSD 14.1.

Reviewed by:    kib
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D45125
DeltaFile
+4-5sys/compat/linuxkpi/common/include/linux/io.h
+4-51 files

FreeBSD/src 22b3e78contrib/llvm-project/openmp/runtime/src kmp_settings.cpp

Merge commit 73bb8d9d92f6 from llvm-project (by Jonathan Peyton):

  [OpenMP] Fix child processes to use affinity_none (#91391)

  When a child process is forked with OpenMP already initialized, the
  child process resets its affinity mask and sets proc-bind-var to false
  so that the entire original affinity mask is used. This patch corrects
  an issue with the affinity initialization code setting affinity to
  compact instead of none for this special case of forked children.

  The test trying to catch this only testing explicit setting of
  KMP_AFFINITY=none. Add test run for no KMP_AFFINITY setting.

  Fixes: #91098

This should fix OpenMP processes sometimes getting stuck on a single CPU
core.

PR:             278845

    [2 lines not shown]
DeltaFile
+2-0contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp
+2-01 files

FreeBSD/src da15ed2contrib/llvm-project/openmp/runtime/src z_Linux_util.cpp

Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton):

  [OpenMP] Fix re-locking hang found in issue 86684 (#88539)

  This was initially reported here (including stacktraces):
  https://stackoverflow.com/questions/78183545/does-compiling-imagick-with-openmp-enabled-in-freebsd-13-2-cause-sched-yield

  If `__kmp_register_library_startup()` detects that another instance of
  the library is present, `__kmp_is_address_mapped()` is eventually
  called. which uses `kmpc_alloc()` to allocate memory. This function
  calls `__kmp_entry_thread()` to access the thread-local memory pool,
  which is a bad idea during initialization. This macro internally calls
  `__kmp_get_global_thread_id_reg()` which sets the bootstrap lock at the
  beginning (before calling `__kmp_register_library_startup()`).

  The fix is to use `KMP_INTERNAL_MALLOC()`/`KMP_INTERNAL_FREE()` instead
  of `kmpc_malloc()`/`kmpc_free()`. `KMP_INTERNAL_MALLOC` and
  `KMP_INTERNAL_FREE` do not use any bootstrap locks. They just translate
  to `malloc()`/`free()` and are meant to be used during library

    [11 lines not shown]
DeltaFile
+3-3contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp
+3-31 files

FreeBSD/src 7ef6ce5share/man/man4 smsc.4, sys/dev/usb/net if_smsc.c

smsc(4): update to mention Microchip

Microchip Technology acquired SMSC in 2012, and all current products
and datasheets refer to the devices supported by this driver as
Microchip parts.  Mention SMSC in a parenthetical comment to explain
the driver's name.

Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45115
DeltaFile
+6-6share/man/man4/smsc.4
+2-2sys/dev/usb/net/if_smsc.c
+8-82 files

FreeBSD/src 5d62025usr.sbin/bhyve gdb.c

bhyve: Do not define GDB_LOG

This had been added for debugging and shouldn't have been committed.

Fixes:          f81cdf24ba54 ("bhyve: Add support for XML register definitions")
MFC after:      3 days
DeltaFile
+0-1usr.sbin/bhyve/gdb.c
+0-11 files

FreeBSD/src e333364sys/amd64/vmm vmm_dev.c, sys/arm64/vmm vmm_dev.c

vmm: Start reconciling amd64 and arm64 copies of vmm_dev.c

Most of the code in vmm_dev.c and vmm.c can and should be shared between
amd64 and arm64 (and eventually riscv) rather than being duplicated.  To
the end of adding a shared implementation in sys/dev/vmm, this patch
eliminates most of the differences between the two copies of vmm_dev.c.

- Remove an unneeded cdefs.h include.
- Simplify the amd64 implementation of vcpu_unlock_one().
- Simplify the arm64 implementation of vcpu_lock_one().
- Pass buffer sizes to alloc_memseg() and get_memseg() on arm64.  On
  amd64 this is needed for compat ioctls, but these functions should be
  merged.
- Make devmem_mmap_single() stricter on arm64.

Reviewed by:    corvink, jhb
Differential Revision:  https://reviews.freebsd.org/D44995
DeltaFile
+15-14sys/arm64/vmm/vmm_dev.c
+7-8sys/amd64/vmm/vmm_dev.c
+22-222 files

FreeBSD/src ffbaa45usr.sbin/bsdinstall/scripts config

bsdinstall: Stop loading cryptodev for ZFS installations

- zfs depends on the crypto module, not cryptodev, and most arm64 kernel
  configs include std.dev, which includes "device crypto" anyway.
- This config works around a problem with kldxref lacking cross-target
  support, but that has since been fixed.
- Loading cryptodev creates /dev/crypto, which gives unprivileged users
  access to the kernel's opencrypto framework.  Very few applications
  need it, so we're needlessly increasing the kernel's surface area.

Thus, stop auto-loading cryptodev.

Reviewed by:    kevans, allanjude, des
Differential Revision:  https://reviews.freebsd.org/D45127
DeltaFile
+0-3usr.sbin/bsdinstall/scripts/config
+0-31 files

FreeBSD/src 74b67dbsys/contrib/openzfs/module/icp/asm-aarch64/blake3 b3_aarch64_sse41.S b3_aarch64_sse2.S

zfs: unbreak aarch64 build with non-gcc compilers

Vendor did not backport this fix into zfs-2.2-release yet.

OpenZFS PR: #16103 35bf25848 Fix: FreeBSD Arm64 does not build currently
Approved by:    re (cperciva)

(cherry picked from commit b9dee1dca2d74e12e867fd29d2d584fc385078eb)
(cherry picked from commit 7e10c2d27a538aa3f5afcafe48801a9316e30027)
DeltaFile
+2-2sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S
+2-2sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S
+4-42 files

FreeBSD/src 78c9d8fsys/contrib/openzfs/config ax_python_devel.m4, sys/contrib/openzfs/module/os/linux/zfs vdev_disk.c

zfs: merge openzfs/zfs at 256659204 (zfs-2.2-release) into stable/14

OpenZFS release 2.2.4

Notable upstream pull request merges:
 #15076 fdd97e009 Refactor dmu_prefetch()
 #15225 5972bb856 Use ASSERT0P() to check that a pointer is NULL
 #15381 7ea833100 ZIL: Detect single-threaded workloads
 #15515 8b1a132de ZIO: Optimize zio_flush()
 #15225 d6da6cbd7 Clean up existing VERIFY*() macros
 #15225 5dda8c091 Add VERIFY0P() and ASSERT0P() macros
 #15436 61f3638a3 Add prefetch property
 #15509 6f323353d Add ashift validation when adding devices to a pool
 #15539 ea3f7c12a Extend import_progress kstat with a notes field
 #15635 25ea8ce94 ZIL: Improve next log block size prediction
 #15784 16c223eec Do no use .cfi_negate_ra_state within the assembly on
                  Arm64
 #15839 706307445 vdev probe to slow disk can stall mmp write checker
 #15879 86b39b41a zpool: Fix locale-specific time

    [34 lines not shown]
DeltaFile
+702-215sys/contrib/openzfs/module/os/linux/zfs/vdev_disk.c
+232-118sys/contrib/openzfs/module/zfs/zil.c
+229-112sys/contrib/openzfs/config/ax_python_devel.m4
+241-55sys/contrib/openzfs/module/zfs/dmu_zfetch.c
+146-60sys/contrib/openzfs/module/zfs/zap_micro.c
+205-0sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_slow_io.ksh
+1,755-560152 files not shown
+4,820-1,658158 files

FreeBSD/src 2a32b54contrib/ofed/libibverbs libibverbs.map

ofed: don't expose symbols twice

ibv_init_wq and ibv_cleanup_wq are made visible with the
default_symver which puts them in the IBVERBS_1.1 ABI.  Don't
try to expose them as IBVERBS_PRIVATE_14 symbols as GNU ld
complains with --no-undefined-symbol.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D45090
DeltaFile
+0-2contrib/ofed/libibverbs/libibverbs.map
+0-21 files

FreeBSD/src eb5fd01tests/sys/vm/soxstack soxstack.c

soxstack: slience 32-bit gcc warning

Modern GCC complains when casting pointers to integers of a different
size (even a larger one).  Switch from uint64_t to uintptr_t which will
always be the right size for a stack address instead of maybe being too
big.

Reviewed by:    dchagin, emaste
Differential Revision:  https://reviews.freebsd.org/D45087
DeltaFile
+2-2tests/sys/vm/soxstack/soxstack.c
+2-21 files

FreeBSD/src ec2b6b1lib/libthr/thread thr_syscalls.c thr_private.h

libthr: avoid varargs in fcntl and openat interposers

Align these signatures with the ones in syscalls.master (and thus
libsys.h).  There's no reason to do va_args twice and in some ABIs
(e.g,, CheriABI) you can't access fixed arguments as varargs if you
weren't called with varargs signature.

Reviewed by:    imp, kib, jhibbits
Obtained from:  CheriBSD
Differential Revision:  https://reviews.freebsd.org/D45126
DeltaFile
+5-20lib/libthr/thread/thr_syscalls.c
+2-2lib/libthr/thread/thr_private.h
+7-222 files

FreeBSD/src 7b65987sys/sys sdt.h

sdt: Add macros which expand to probe and provider structure names

No functional change intended.

MFC after:      1 week

(cherry picked from commit 4afce4473db4f51acd034333b8506294b4fb61e6)
DeltaFile
+21-16sys/sys/sdt.h
+21-161 files

FreeBSD/src f4ab464sys/netgraph ng_pipe.c

ng_pipe: Replace deprecated random() with prng32_bounded()

Signed-off-by: Martin Vahlensieck <git at academicsolutions.ch>

MFC after:      2 weeks
Reviewed by:    markj
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1181

(cherry picked from commit a3ecf8c7863683e53c77a17f96ab7012352265b9)
DeltaFile
+3-2sys/netgraph/ng_pipe.c
+3-21 files

FreeBSD/src a3ca254sys/netgraph ng_pipe.c

ng_pipe: Remove node when all hooks are disconnected

This is the behavior described in the man page.

Signed-off-by: Martin Vahlensieck <git at academicsolutions.ch>

Discussed with: glebius
Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1181

(cherry picked from commit bb2ab7a374b9d81f8368acc506c9700af20a22d6)
DeltaFile
+7-0sys/netgraph/ng_pipe.c
+7-01 files

FreeBSD/src a709ac6sys/netgraph ng_pipe.c

ng_pipe: Fix whitespace

Signed-off-by: Martin Vahlensieck <git at academicsolutions.ch>

Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1181

(cherry picked from commit 8512311fb5004444f43701eb122b6d77c76d7564)
DeltaFile
+8-8sys/netgraph/ng_pipe.c
+8-81 files

FreeBSD/src f55be6dcontrib/netbsd-tests/fs/tmpfs t_times.sh

tmpfs tests: Remove an xfail annotation

This test passes after commit 08f3d5b60cdf ("copy_file_range: Call
vn_rdwr() at least once").

PR:             274615
MFC after:      1 month

(cherry picked from commit 8eb21b4ff0082a707517f805cf14616f91d9218e)
DeltaFile
+0-2contrib/netbsd-tests/fs/tmpfs/t_times.sh
+0-21 files

FreeBSD/src 50af25esys/netgraph ng_pipe.c

ng_pipe: Do not panic when memory allocations fail

Signed-off-by: Martin Vahlensieck <git at academicsolutions.ch>

Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1181

(cherry picked from commit d44c78074d8738db67a2fa6bf07b630c61eee6ab)
DeltaFile
+30-15sys/netgraph/ng_pipe.c
+30-151 files

FreeBSD/src e3b27ccsys/kern vfs_vnops.c

copy_file_range: Call vn_rdwr() at least once

This ensures that we invoke VOP_READ on the input file even if it's
empty, which in turn helps ensure that filesystems update the atime of
the file.

PR:             274615
Reviewed by:    olce, rmacklem, kib
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D43524

(cherry picked from commit 08f3d5b60cdfff434e391d96cdffc5a90c550b07)
DeltaFile
+12-4sys/kern/vfs_vnops.c
+12-41 files

FreeBSD/src 95cb702sys/arm/include armreg.h

arm: Remove duplicate definitions in armreg.h

No functional change intended.

MFC after:      1 week

(cherry picked from commit 4a5e2ddbd8943baf7add831ab835594ac60f94d1)
DeltaFile
+0-2sys/arm/include/armreg.h
+0-21 files

FreeBSD/src 3f6515csys/dev/iicbus if_ic.c, sys/dev/wg if_wg.c

bpf: Make BPF interop consistent with if_loop

The pseudo_AF_HDRCMPLT check is already being done in if_loop and
just needed to be ported over to if_ic, if_wg, if_disc, if_gif,
if_gre, if_me, if_tuntap and ng_iface.  This is needed in order to
allow these interfaces to work properly with e.g., tcpreplay.

PR:             256587
Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/876

(cherry picked from commit 2cb0fce24d64039090dc9243cdf0715ee80c91b1)
DeltaFile
+2-2sys/dev/iicbus/if_ic.c
+2-1sys/net/if_gre.c
+2-1sys/dev/wg/if_wg.c
+2-1sys/net/if_gif.c
+2-1sys/net/if_me.c
+1-1sys/netgraph/ng_iface.c
+11-72 files not shown
+13-98 files

FreeBSD/src ebc5b3busr.bin/ctags C.c ctags.c

ctags: Use C99 bool instead of defining our own

Use stdbool.h definitions instead of defining non-standard ones.

Signed-off-by: Collin Funk <collin.funk1 at gmail.com>

Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1107

(cherry picked from commit 87b0195ace1a71a1a07244890be3aaef72e1ffcd)
DeltaFile
+38-38usr.bin/ctags/C.c
+11-11usr.bin/ctags/ctags.c
+6-6usr.bin/ctags/fortran.c
+5-6usr.bin/ctags/ctags.h
+5-5usr.bin/ctags/yacc.c
+4-4usr.bin/ctags/lisp.c
+69-701 files not shown
+70-717 files

FreeBSD/src 2a9aae9sys/netinet tcp_output.c tcp_var.h, usr.bin/netstat inet.c

tcp: add counter to track when SACK loss recovery uses TSO

Add a counter to track how frequently SACK has transmitted
more than one MSS using TSO. Instances when this will be
beneficial is the use of PRR, or when ACK thinning due to
GRO/LRO or ACK discards by the network are present.

Reviewed By:            tuexen, #transport
Sponsored by:           NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D45070
DeltaFile
+5-3usr.bin/netstat/inet.c
+3-0sys/netinet/tcp_output.c
+2-1sys/netinet/tcp_var.h
+1-0sys/netinet/in_kdtrace.c
+1-0sys/netinet/in_kdtrace.h
+12-45 files

FreeBSD/src dcdfe44sys/netinet tcp_sack.c tcp_output.c

tcp: add sysctl to allow/disallow TSO during SACK loss recovery

Introduce net.inet.tcp.sack.tso for future use when TSO is ready
to be used during loss recovery.

Reviewed By:            tuexen, #transport
Sponsored by:           NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D45068
DeltaFile
+5-0sys/netinet/tcp_sack.c
+1-1sys/netinet/tcp_output.c
+2-0sys/netinet/tcp_var.h
+8-13 files

FreeBSD/src cbf3575sys/netinet tcp_sack.c

tcp: filter small SACK blocks

While the SACK Scoreboard in the base stack limits
the number of holes by default to only 128 per connection
in order to prevent CPU load attacks by splitting SACKs,
filtering out SACK blocks of unusually small size can
further improve the actual processing of SACK loss recovery.

Reviewed By:            tuexen, #transport
Sponsored by:           NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D45075
DeltaFile
+4-1sys/netinet/tcp_sack.c
+4-11 files

FreeBSD/src 301ec2csys/netpfil/pf pf.c

pf: always mark states as unlinked before detaching them

Users have reported crashes in pf_test_state_udp() where at least one state key
is NULL.

That suggests that pf_detach_state() ran concurrently with pf_test_state_udp().
pf_test_state_udp() holds the state lock (aka the id lock), but
pf_detach_state() does not.
The intent is that detached states are not returned by STATE_LOOKUP/
pf_find_state(), as the state's timeout is set to PFTM_UNLINKED and thus
pf_find_state() does not find the state.

There are other paths to pf_detach_state() (outside of pf_unlink_state())
though, where we did not set the timeout to PFTM_UNLINKED. Fix those, and assert
that the timeout is set correctly when we enter pf_detach_state().

MFC after:      1 week
See also:       https://redmine.pfsense.org/issues/15413
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D45101
DeltaFile
+3-0sys/netpfil/pf/pf.c
+3-01 files

FreeBSD/src 601438fsys/netinet ip_carp.c

carp: refactor packet tagging for ether_output()

- Separate HMAC preparation (CARP specific) from tagging.
- In unicast mode (CARP specific) don't put tag at all.
- Don't put pointer to software context into the tag.  Putting just vhid,
  an integer value, is a safer design.

Reviewed by:    kp
Differential Revision:  https://reviews.freebsd.org/D45038
DeltaFile
+14-23sys/netinet/ip_carp.c
+14-231 files

FreeBSD/src a254d68sys/netinet ip_carp.c

carp: isolate VRRP from CARP

There is only one functional change here - we don't allow SIOCSVH (or
netlink request) to change sc->sc_version.  I'm convinced that allowing
such a change doesn't brings any practical value, but creates enless
minefields in front of both developers and end users (sysadmins).  If
you want to switch from VRRP to CARP or vice versa, you'd need to recreate
the VHID.

Oh, one tiny funtional change: carp_ioctl_set() won't modify any fields
if it returns EINVAL.  Previously you could provide valid advbase with
invalid advskew - that used to modify advbase and return EINVAL.

All other changes is a sweep around not ever using CARP fields when
we are in VRRP mode and vice versa.  Also adding assertions on sc_version
where necessary.

Do not send VRRP vars in CARP mode via NetLink and vice versa.  However
in compat ioctl SIOCGVH for VRRP mode the CARP fields would be zeroes.

    [6 lines not shown]
DeltaFile
+199-159sys/netinet/ip_carp.c
+199-1591 files

FreeBSD/src cda57d9sys/netinet ip_carp.c

carp: assert that we are calling correct input function. We are.

Reviewed by:    kp
Differential Revision:  https://reviews.freebsd.org/D45037
DeltaFile
+4-3sys/netinet/ip_carp.c
+4-31 files

FreeBSD/src 5ee92cbsys/netinet ip_carp.c

carp: don't chain call vrrp_send_ad via carp_send_ad

Provide inline send_ad_locked() that switches between protocol
specific sending function.

Rename carp_send_ad() to carp_callout() to avoid getting lost in
all these multiple foo_send_ad.

No functional change intended.

Reviewed by:    kp
Differential Revision:  https://reviews.freebsd.org/D45036
DeltaFile
+22-14sys/netinet/ip_carp.c
+22-141 files