FreeBSD/src a7b222dsys/compat/linuxkpi/common/include/linux rwlock.h

linuxkpi: rwlock: Fix rwlock_init

Some linux code re-init some spinlock so add MTX_NEW to mtx_init.

Reported by:    rlibby
Fixes:          5c0a1923486e ("linuxkpi: rwlock: Simplify code")
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/rwlock.h
+1-11 files

FreeBSD/src cff79fdsys/compat/linuxkpi/common/include/linux spinlock.h

linuxkpi: Fix spin_lock_init

Some linux code re-init some spinlock so add MTX_NEW to mtx_init.

Reported by:    David Wolfskill <david at catwhisker.org>
Fixes:          ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code")
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/spinlock.h
+1-11 files

FreeBSD/src 1652c9esys/kern kern_boottrace.c

boottrace: Use NULL for SYSINIT's last arg, which is a pointer type

MFC after:      3 days

(cherry picked from commit d9f1f0a901831ff960380fe82a2abe99a3721f87)
DeltaFile
+1-1sys/kern/kern_boottrace.c
+1-11 files

FreeBSD/src 6b2af2dsbin/newfs newfs.8 newfs.c

Enable soft updates by default for UFS2 filesystems.

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

(cherry picked from commit 61dece6d27fb2436928ca93d65667b358e05aa7b)
(cherry picked from commit 7465f9fc06467e57d3bbf2430031fe51d8182c30)

Approved by: re (Colin Percival)
DeltaFile
+5-1sbin/newfs/newfs.8
+3-0sbin/newfs/newfs.c
+8-12 files

FreeBSD/src 7552991share/man/man4 Makefile

Trim a spurious trailing backslash

Reported by:    dim
Fixes:          1687d77197c0 man filesystems: move driver pages to section four
DeltaFile
+1-1share/man/man4/Makefile
+1-11 files

FreeBSD/src fcfb2d6contrib/llvm-project/llvm/lib/TargetParser Host.cpp

Merge commit 87f3407856e6 from llvm-project (by Phoebe Wang):

  [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with
CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors
like:

  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512'
    197 |         const vec_t ones = VSET1_8(1);
        |                            ^
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8'
    116 | #  define VSET1_8(a)            _mm512_set1_epi8(a)
        |                                 ^
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
  /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8'
    116 | #  define VSET1_8(a)            _mm512_set1_epi8(a)
        |                                 ^


    [9 lines not shown]
DeltaFile
+2-1contrib/llvm-project/llvm/lib/TargetParser/Host.cpp
+2-11 files

FreeBSD/src 3cb6c6clib/libcapsicum capsicum_helpers.3

libcapsicum: document return values

Reviewed by:    emaste
Requested by:   des
Differential Revision:  https://reviews.freebsd.org/D45222
DeltaFile
+26-1lib/libcapsicum/capsicum_helpers.3
+26-11 files

FreeBSD/src 5372516sys/kern sysv_shm.c, sys/sys shm.h

SysV SHM: move SHMSEG constants to sys/shm.h

There are planned consumers in linprocfs.

Tested by:      Ricardo Branco <rbranco at suse.de>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D45175
DeltaFile
+0-4sys/kern/sysv_shm.c
+4-0sys/sys/shm.h
+4-42 files

FreeBSD/src 87a1565sys/kern sysv_shm.c sysv_msg.c, sys/sys msg.h sem.h

SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information

PR:     278949
Reviewed by:    markj
Tested by:      Ricardo Branco <rbranco at suse.de>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D45175
DeltaFile
+36-0sys/kern/sysv_shm.c
+34-0sys/kern/sysv_msg.c
+33-0sys/kern/sysv_sem.c
+3-0sys/sys/msg.h
+3-0sys/sys/sem.h
+2-0sys/sys/shm.h
+111-06 files

FreeBSD/src 28a5910sys/compat/linuxkpi/common/include/linux module.h, sys/kern kern_linker.c

linuxkpi: Provide a non-NULL value for THIS_MODULE

THIS_MODULE is used to differentiate modules on Linux. We currently
completely stub out any Linux struct module usage, but THIS_MODULE
is still used to populate the "owner" fields of various drivers.
Even though we don't actually dereference these "owner" fields they
are still used by drivers to check if devices/dmabufs/etc come
from different modules. For example, during DRM GEM import some
drivers check if the dmabuf's owner matches the dev's owner. If
they match because they are both NULL drivers may incorrectly think
two resources come from the same module.

This adds a general purpose __this_linker_file which will point to
the linker file of the module that uses it. We can then use that
pointer to have a valid value for THIS_MODULE.

Reviewed by:    bz, jhb
Differential Revision:  https://reviews.freebsd.org/D44306
DeltaFile
+21-0sys/compat/linuxkpi/common/include/linux/module.h
+14-0sys/kern/kern_linker.c
+6-0sys/sys/linker.h
+41-03 files

FreeBSD/src 65fd76btools/build/options makeman

makeman: extend duplicate option warning to OPT_ options

In a local tree I accidentally had OPT_INIT_ALL defaulting to zero in
userland and none in kernel.  This resulted in the INIT_ALL text
appearing twice in src.conf.5.

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45184
DeltaFile
+6-0tools/build/options/makeman
+6-01 files

FreeBSD/src 8930e7dlibexec/save-entropy save-entropy.8 Makefile

save-entropy: Add manual page

Succinct manual page for save-entropy(8).

PR:                     223998
Reported by:            AJ Jordan <alex+freebsd at strugee.net>
Reviewed by:            carlavilla@, delphij@, lwhsu@, pauamma_gundo.com
Approved by:            delphi, lwhsu (src)
Differential Revision:  https://reviews.freebsd.org/D41768

(cherry picked from commit 8dc9b10e388da19d63b3dd718a8243e8e969091d)
(cherry picked from commit 227f81c8bd0f60176519276839b24b468afce0bc)

Approved by:    re (cperciva)
DeltaFile
+97-0libexec/save-entropy/save-entropy.8
+1-0libexec/save-entropy/Makefile
+98-02 files

FreeBSD/src f381173usr.sbin/ctladm ctladm.c

ctladm: fix resource leak

The str variable in cctl_nvlist_end_element() does not get free()'d when
converted to an integer value. (name is "trtype")

Reported by:    Coverity Scan
Coverity ID:    1545039
Sponsored by:   The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1237
DeltaFile
+0-1usr.sbin/ctladm/ctladm.c
+0-11 files

FreeBSD/src 1787871usr.sbin/bhyve bhyverun.c

bhyve: avoid resource leak

In bhyve_parse_config_option(), a string is allocated and passed to
nvlist_add_string() but not free'd afterwards.

Reported by:    Coverity
CID:            1544049
Sponsored by:   The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1234
DeltaFile
+1-0usr.sbin/bhyve/bhyverun.c
+1-01 files

FreeBSD/src 304a032sys/modules Makefile

sys/modules/dpdk_lpm4: do not build without INET

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1236
DeltaFile
+1-1sys/modules/Makefile
+1-11 files

FreeBSD/src d33b87eusr.bin/netstat nhops.c route.c

netstat(1): increase width of Netif column

The previous width of Netif (10 or 8) was too short for modern interface
names; make it 12, which is long enough to display "epair0a.1000".

This came up in practice with genet(4) interfaces, since the base
interface name is long enough that with the previous limit, VLAN
identifiers would be truncated at 1 character in the IPv6 output:
"genet0.100" becomes "genet0.1".

The width is now fixed, and doesn't depend on the address family,
because there's no reason that length of the interface name would vary
based on the AF.

Reviewed by: imp,zlei,Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/1223
DeltaFile
+2-3usr.bin/netstat/nhops.c
+2-3usr.bin/netstat/route.c
+4-62 files

FreeBSD/src ae9c0bausr.bin/netstat nhops.c route.c

netstat(8): for -W, use IFNAMSIZ

If -W is specified, use IFNAMSIZ as the width of the Netif column,
instead of the default 12.

Reviewed by: imp,zlei,Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/1223
DeltaFile
+1-1usr.bin/netstat/nhops.c
+1-1usr.bin/netstat/route.c
+2-22 files

FreeBSD/src 1a720cbsbin/mdmfs mdmfs.8, sbin/mount mount.8

man filesystems: fix xrefs after move to section 4

Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
DeltaFile
+10-10share/man/man4/linux.4
+8-8usr.sbin/jail/jail.8
+7-7sbin/mdmfs/mdmfs.8
+6-6sbin/mount/mount.8
+5-5share/man/man9/pseudofs.9
+5-5share/man/man4/fd.4
+41-4156 files not shown
+137-13762 files

FreeBSD/src a03e8a4. ObsoleteFiles.inc, tools/build/mk OptionalObsoleteFiles.inc

man filesystems: ObsoleteFiles after move to sec 4

Reported by: imp
Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
DeltaFile
+22-0ObsoleteFiles.inc
+1-1tools/build/mk/OptionalObsoleteFiles.inc
+23-12 files

FreeBSD/src 1687d77share/man/man4 ffs.4 procfs.4, share/man/man5 procfs.5 tmpfs.5

man filesystems: move driver pages to section four

Filesystem manual pages describe drivers, not formats;
except for fs, which describes the structures of ffs/ufs,
not how to use it in the system.

Reported by: emaste
Reviewed by: des, imp, meena (previous version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
DeltaFile
+328-0share/man/man4/ffs.4
+0-328share/man/man7/ffs.7
+0-308share/man/man5/procfs.5
+308-0share/man/man4/procfs.4
+0-229share/man/man5/tmpfs.5
+229-0share/man/man4/tmpfs.4
+865-86534 files not shown
+2,583-2,58640 files

FreeBSD/src a6d8be4contrib/bsddialog/lib lib_util.c barbox.c, contrib/bsddialog/utility bsddialog.1 util_builders.c

contrib/bsddialog: Import version 1.0.2

Implicitly import also 1.0.1, both versions are for fixing and
feature requests.

Fixing:
Change --mixedform behavior to fix a bsdinstall fault avoiding
to change the command line in wlanconfig.

Feature requests:
 * Add keys to navigate menus.
 * Add key to redraw dialogs.
 * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY.

See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in
/usr/src/contrib/bsddialog/CHANGELOG for more detailed information.

PR:                     274472
Differential Revision:  D42380

    [2 lines not shown]
DeltaFile
+61-50contrib/bsddialog/lib/lib_util.c
+68-18contrib/bsddialog/lib/barbox.c
+57-28contrib/bsddialog/utility/bsddialog.1
+55-17contrib/bsddialog/utility/util_builders.c
+42-11contrib/bsddialog/lib/datebox.c
+22-21contrib/bsddialog/lib/formbox.c
+305-14516 files not shown
+470-22522 files

FreeBSD/src be8846blib lib_util.c barbox.c, utility bsddialog.1 util_builders.c

contrib/bsddialog: Import version 1.0.2

Implicitly import also 1.0.1, both versions are for fixing and
feature requests.

Fixing:
Change --mixedform behavior to fix a bsdinstall fault avoiding
to change the command line in wlanconfig.

Feature requests:
 * Add keys to navigate menus.
 * Add key to redraw dialogs.
 * Avoid to handle env NCURSES_NO_UTF8_ACS in PuTTY.

See '2024-04-11 Version 1.0.2' and '2023-11-16 Version 1.0.1' in
/usr/src/contrib/bsddialog/CHANGELOG for more detailed information.

PR:                     274472
Differential Revision:  D42380
DeltaFile
+61-50lib/lib_util.c
+68-18lib/barbox.c
+57-28utility/bsddialog.1
+55-17utility/util_builders.c
+42-11lib/datebox.c
+22-21lib/formbox.c
+305-14516 files not shown
+470-22522 files

FreeBSD/src 147c7e4sys/x86/include apicvar.h

Increase IOAPIC_MAX_ID to 255 (from 254)

A test system provided by AMD panicked with "madt_parse_apics:
I/O APIC ID 255 too high".  I/O APIC ID 255 is acceptable, so increase
the limit.

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

(cherry picked from commit 4e3286818327453efd8e4c133928ba26a169567a)
(cherry picked from commit 18119e711f1c844bd6eacf5afc8d4cdec3ac8085)

Approved by:    re (cperciva)
DeltaFile
+6-1sys/x86/include/apicvar.h
+6-11 files

FreeBSD/src b45d038usr.bin/expand expand.1

expand: Fix markup for the `-t` option.

PR:             274897
Fixes:          8993d785a261
MFC after:      3 days
Reviewed by:    gbe
Differential Revision:  https://reviews.freebsd.org/D45167

(cherry picked from commit f3eeeb959c9b00c89a2e1ff009c78162eb398656)
(cherry picked from commit 0d230c89f5b39b06730bb43aa6e0cd0482dbd64a)

Approved by:    re (cperciva)
DeltaFile
+7-1usr.bin/expand/expand.1
+7-11 files

FreeBSD/src e73147fsys/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")

    [3 lines not shown]
DeltaFile
+4-0sys/netpfil/pf/pf.c
+4-01 files

FreeBSD/src abb1a13sys/compat/linuxkpi/common/include/linux refcount.h kref.h

linuxkpi: refcount: Use atomic_t directly

Simply use a typedef for refcount_t on atomic_t, this allow us
to use a nativ type and also changing struct kref to directly use
a refcount_t like Linux.

Reviewed by:            bz
Sponsored by:           Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D45207
DeltaFile
+8-15sys/compat/linuxkpi/common/include/linux/refcount.h
+1-2sys/compat/linuxkpi/common/include/linux/kref.h
+9-172 files

FreeBSD/src b9f6b66sys/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")

    [3 lines not shown]
DeltaFile
+4-0sys/netpfil/pf/pf.c
+4-01 files

FreeBSD/src 5c0a192sys/compat/linuxkpi/common/include/linux rwlock.h

linuxkpi: rwlock: Simplify code

Just use a typedef for rwlock_t, no need to create a useless
structure.

Reviewed by:            bz
Sponsored by:           Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D45206
DeltaFile
+6-15sys/compat/linuxkpi/common/include/linux/rwlock.h
+6-151 files

FreeBSD/src ae38a1asys/compat/linuxkpi/common/include/linux spinlock.h wait.h, sys/compat/linuxkpi/common/src linux_compat.c linux_idr.c

linuxkpi: spinlock: Simplify code

Just use a typedef for spinlock_t, no need to create a useless
structure.

Reviewed by:            bz, emaste
Sponsored by:           Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D45205
DeltaFile
+10-24sys/compat/linuxkpi/common/include/linux/spinlock.h
+4-4sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
+4-4sys/compat/linuxkpi/common/src/linux_compat.c
+1-1sys/compat/linuxkpi/common/include/linux/wait.h
+1-1sys/compat/linuxkpi/common/src/linux_idr.c
+20-345 files

FreeBSD/src 7465f9fsbin/newfs newfs.8 newfs.c

Enable soft updates by default for UFS2 filesystems.

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

(cherry picked from commit 61dece6d27fb2436928ca93d65667b358e05aa7b)
DeltaFile
+5-1sbin/newfs/newfs.8
+3-0sbin/newfs/newfs.c
+8-12 files