FreeBSD/src 3ae14e8lib/libuvmem Makefile Symbol.map, share/mk src.libnames.mk

libuvmem: usermode port of vmem(9)

(cherry picked from commit 1ecf01065b45018de3901c8bf89d703af737feeb)
DeltaFile
+137-14sys/kern/subr_vmem.c
+15-8sys/sys/vmem.h
+17-0lib/libuvmem/Makefile
+15-0lib/libuvmem/Symbol.map
+5-0share/mk/src.libnames.mk
+1-1usr.sbin/bhyve/Makefile
+190-233 files not shown
+194-239 files

FreeBSD/src c4b0e25sys/kern subr_vmem.c

kern/subr_vmem.c: remove unused VMEM_TRYLOCK() macro

(cherry picked from commit 305e33d4c6edd735590909161ff0847e73e68b66)
DeltaFile
+0-1sys/kern/subr_vmem.c
+0-11 files

FreeBSD/src ccb0a24sys/kern subr_vmem.c

kern/subr_vmem.c: convert explicit vmem_list_lock use to macros

(cherry picked from commit 202292ef107834bfdbec357a9d1a88b9fcf9ceaa)
DeltaFile
+9-6sys/kern/subr_vmem.c
+9-61 files

FreeBSD/src 7be0919lib/libuvmem libuvmem.3 Makefile

libuvmem: provide man page mostly as a pointer to vmem(9)

(cherry picked from commit 7295aeaf5f5cbbbb16d4992b13b08bce09f03609)
DeltaFile
+71-0lib/libuvmem/libuvmem.3
+2-0lib/libuvmem/Makefile
+73-02 files

FreeBSD/src 70edd3ccontrib/ofed/libibverbs alloca.h cmd.c

ofed/libibverbs: remove no longer needed local alloca.h

Sponsored by:   NVidia networking
MFC after:      1 week
DeltaFile
+0-18contrib/ofed/libibverbs/alloca.h
+0-1contrib/ofed/libibverbs/cmd.c
+0-1contrib/ofed/libibverbs/compat-1_0.c
+0-1contrib/ofed/libibverbs/device.c
+0-214 files

FreeBSD/src 6a75e39contrib/ofed/libibverbs config.h

ofed/libibverbs: remove strdupa() hack from config.h

It is now provided by regular string.h.  While there, remove stale
$FreeBSD$ svn tag, and add include guards.

Sponsored by:   NVidia networking
MFC after:      1 week
DeltaFile
+3-3contrib/ofed/libibverbs/config.h
+3-31 files

FreeBSD/src a98e5d7include string.h, lib/libc/string strdup.3 Makefile.inc

libc/string: add strdupa(3) and strndupa(3)

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54066
DeltaFile
+33-1lib/libc/string/strdup.3
+28-0include/string.h
+3-1lib/libc/string/Makefile.inc
+64-23 files

FreeBSD/src 98b7ccalib/libc/string Makefile.inc

libc/string: put source files list one item per line

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54066
DeltaFile
+121-23lib/libc/string/Makefile.inc
+121-231 files

FreeBSD/src cff67bcsys/vm vm_fault.c

vm_fault: only rely on PG_ZERO when the page was newly allocated

If the fs->m page was found invalid on the object queue, PG_ZERO flag is
stale.  Track the source of the page in the new fault state variable
m_needs_zero, and ignore PG_ZERO if the page did not came from the
allocator.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D53963
DeltaFile
+5-1sys/vm/vm_fault.c
+5-11 files

FreeBSD/src 636ee02sys/vm vm_page.h

vm_page.h: remove no longer defined (P) locking annotation

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D53963
DeltaFile
+2-2sys/vm/vm_page.h
+2-21 files

FreeBSD/src 5f9b7cdsys/compat/linuxkpi/common/src linux_page.c

linuxkpi: gracefully handle page lookup failure in lkpi_vmf_insert_pfn_prot_locked

Currently lkpi_vmf_insert_pfn_prot_locked will check the page iter to
find a usage of the page. If no page was found, it continues on to
try using PHYS_TO_VM_PAGE() to get a page. Currently it does not check
if a valid page was found before passing it to vm_page_busy_acquire,
which can cause a kernel page fault as vm_page_busy_acquire expects
a valid page pointer.

This can easily be triggered while starting KDE6 in wayland mode, which
many users have been reporting. With this change plasma6 starts properly
in wayland mode.

Sponsored by:   NVIDIA
PR:             288565
Reviewed by:    markj, kbowling (mentor)
Differential Revision:  https://reviews.freebsd.org/D53412
Fixed conflicts during MFC, re-reviewed by kbowling

(cherry picked from commit 03b214a35db1ebdc7575cad8d695c65daf2817bf)
DeltaFile
+2-0sys/compat/linuxkpi/common/src/linux_page.c
+2-01 files

FreeBSD/src f63a8c0tools/build/mk OptionalObsoleteFiles.inc, usr.sbin/bsdinstall/scripts mount_aux mount

bsdinstall: Mount /dev and /packages after using the shell to partition disks

Normally after partitions are created by the installer, the 'mount'
script is used to mount the target disk partitions under /mnt.  The
tail end of this script also mounts a couple of additional filesystems
under /mnt so that chrooted programs can work such as devfs and
/packages.

When the "Shell" option is used to permit the user to manually mount
the destination filesystem, the "mount" script is not used as the user
is instructed to mount the target filesystems and construct
/mnt/etc/fstab, etc.  However, this means that the user is responsible
for mounting devfs (which is not included in /etc/fstab) and /packages
as well.  The help message for the "Shell" option doesn't mention
these requirements, so users may not know to do so.  This can lead to
confusing errors as chrooted commands can fail to find needed /dev
entries.  For example, running fwget to fetch wireless firmware fails
because /dev/pci doesn't exist.


    [10 lines not shown]
DeltaFile
+39-0usr.sbin/bsdinstall/scripts/mount_aux
+1-9usr.sbin/bsdinstall/scripts/mount
+1-0tools/build/mk/OptionalObsoleteFiles.inc
+1-0usr.sbin/bsdinstall/scripts/Makefile
+1-0usr.sbin/bsdinstall/scripts/auto
+43-95 files

FreeBSD/src 5287dd4sys/compat/linuxkpi/common/include/linux pm.h

linuxkpi: add stub implementation of pm_vt_switch_(un)register

This adds empty implementations of pm_vt_switch_(un)register which
are used by nvidia-drm. We do not need to specify anything here as
a VT switch always happens on suspend/resume.

Sponsored by:   NVIDIA
Reviewed by:    kbowling (mentor), emaste
Differential Revision:  https://reviews.freebsd.org/D53400

(cherry picked from commit 75aa13c64aba71f6f26d05e8fcf96e3862d44cde)
DeltaFile
+14-0sys/compat/linuxkpi/common/include/linux/pm.h
+14-01 files

FreeBSD/src 2cfd9feshare/colldef_unicode zh_CN.UTF-8.src ko_KR.UTF-8.src, share/ctypedef C.UTF-8.src

locale: make install Unicode 17.0.0/CLDR 48

Unicode 17.0 adds 4803 characters, for a total of 159,801 characters.
The new additions include 4 new scripts:

- Sidetic
- Tolong Siki
- Beria Erfe
- Tai Yo

https://www.unicode.org/versions/Unicode17.0.0/
DeltaFile
+42,569-43,804share/colldef_unicode/zh_CN.UTF-8.src
+20,031-20,027share/colldef_unicode/ko_KR.UTF-8.src
+8,521-8,521share/colldef_unicode/ja_JP.UTF-8.src
+9,988-0tools/tools/locale/etc/final-maps/map.UTF-8
+5,765-6share/ctypedef/C.UTF-8.src
+2,842-2,827share/colldef_unicode/hu_HU.UTF-8.src
+89,716-75,18545 files not shown
+152,537-137,46151 files

FreeBSD/src 452b92fsys/compat/linuxkpi/common/src linux_page.c

linuxkpi: gracefully handle page lookup failure in lkpi_vmf_insert_pfn_prot_locked

Currently lkpi_vmf_insert_pfn_prot_locked will check the page iter to
find a usage of the page. If no page was found, it continues on to
try using PHYS_TO_VM_PAGE() to get a page. Currently it does not check
if a valid page was found before passing it to vm_page_busy_acquire,
which can cause a kernel page fault as vm_page_busy_acquire expects
a valid page pointer.

This can easily be triggered while starting KDE6 in wayland mode, which
many users have been reporting. With this change plasma6 starts properly
in wayland mode.

Sponsored by:   NVIDIA
PR:             288565
Reviewed by:    markj, kbowling (mentor)
Differential Revision:  https://reviews.freebsd.org/D53412

(cherry picked from commit 03b214a35db1ebdc7575cad8d695c65daf2817bf)
DeltaFile
+4-0sys/compat/linuxkpi/common/src/linux_page.c
+4-01 files

FreeBSD/src 3bb9800sys/compat/linuxkpi/common/include/linux pm.h

linuxkpi: add stub implementation of pm_vt_switch_(un)register

This adds empty implementations of pm_vt_switch_(un)register which
are used by nvidia-drm. We do not need to specify anything here as
a VT switch always happens on suspend/resume.

Sponsored by:   NVIDIA
Reviewed by:    kbowling (mentor), emaste
Differential Revision:  https://reviews.freebsd.org/D53400

(cherry picked from commit 75aa13c64aba71f6f26d05e8fcf96e3862d44cde)
DeltaFile
+14-0sys/compat/linuxkpi/common/include/linux/pm.h
+14-01 files

FreeBSD/src 0140dc4lib/libsys jail.2, share/man/man5 pf.conf.5

man typos: Fix pf.conf.5 and jail.2 typos

MFC after:      3 days
Signed-off-by:  Seth Hoffert <seth.hoffert at gmail.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/1919
DeltaFile
+1-1lib/libsys/jail.2
+1-1share/man/man5/pf.conf.5
+2-22 files

FreeBSD/src ebe7b24share/examples/sound oss.h simple.c

sound examples: Check if setting property was successful

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D54038
DeltaFile
+18-4share/examples/sound/oss.h
+4-0share/examples/sound/simple.c
+22-42 files

FreeBSD/src b986aa0sys/net if_llatbl.c if_llatbl.h, sys/netinet if_ether.c

lltable: use own lock

Add struct mtx to struct lltable and stop using IF_AFDATA_LOCK, that
was created for a completely different purpose.  No functional change
intended.

Reviewed by:            zlei, melifaro
Differential Revision:  https://reviews.freebsd.org/D54086
DeltaFile
+24-26sys/net/if_llatbl.c
+12-13sys/netinet6/nd6.c
+8-8sys/netinet/if_ether.c
+5-7sys/netinet6/in6.c
+8-1sys/net/if_llatbl.h
+4-4sys/netinet6/mld6.c
+61-592 files not shown
+65-648 files

FreeBSD/src 607f110sys/compat/linsysfs linsysfs_net.c, sys/compat/linux linux_if.c linux_netlink.c

linux: store Linux Ethernet interface number in struct ifnet

The old approach where we go through the list of interfaces and count them
has bugs.  One obvious bug with this dynamic translation is that once an
Ethernet interface in the middle of the list goes away, all interfaces
following it would change their Linux names.

A bigger problem is the ifnet arrival and departure times.  For example
linsysfs has event handler for ifnet_arrival_event, and of course it wants
to resolve the name.  This accidentially works, due to a bug in
if_attach() where we call if_link_ifnet() before invoking all the event
handlers.  Once the bug is fixed linsysfs won't be able to resolve the old
way.  The other side is ifnet_departure_event, where there is no bug, the
eventhandlers are called after the if_unlink_ifnet().  This means old
translation won't work for departure event handlers.  One example is
netlink.  This change gives the Netlink a chance to emit a proper Linux
interface departure message.

However, there is another problem in Netlink, that the ifnet pointer is

    [7 lines not shown]
DeltaFile
+71-64sys/compat/linux/linux_if.c
+6-6sys/compat/linsysfs/linsysfs_net.c
+4-3sys/compat/linux/linux_netlink.c
+2-3sys/compat/linux/linux_common.h
+2-1sys/netlink/netlink_linux.h
+1-1sys/netlink/netlink_io.c
+86-785 files not shown
+95-7811 files

FreeBSD/src fbf05d2sys/compat/linux linux_if.c linux.c, sys/modules/linux_common Makefile

linux: separate all ifnet(9) related code into linux_ifnet.c

Remove linux_use_real_ifname().  It is no longer used outside of the
file since 3ab3c9c29cf0.  There is no functional change.

Reviewed by:            melifaro, dchagin
Differential Revision:  https://reviews.freebsd.org/D54076
DeltaFile
+310-0sys/compat/linux/linux_if.c
+1-277sys/compat/linux/linux.c
+0-10sys/compat/linux/linux.h
+1-2sys/modules/linux_common/Makefile
+312-2894 files

FreeBSD/src acd0244sys/kern init_main.c

proc0_post: Clear relevant thread stats directly

rufetch() has several other effects besides clearing these per-thread
stats most of which are explicitly discarded by the subsequent calls
to ruxreset().  Just clear the relevant stats directly instead.

Reviewed by:    olce, kib, markj
Differential Revision:  https://reviews.freebsd.org/D54050
DeltaFile
+6-3sys/kern/init_main.c
+6-31 files

FreeBSD/src 3f8ed60sys/kern init_main.c, sys/sys proc.h

ruxreset: Add an inline function to reset all the stats in rusage_ext

Use it in proc0_post to reset per-process CPU usage.

Suggested by:   olce
Reviewed by:    olce, kib
Differential Revision:  https://reviews.freebsd.org/D54049
DeltaFile
+12-0sys/sys/proc.h
+1-4sys/kern/init_main.c
+13-42 files

FreeBSD/src dafe50esys/kern init_main.c

thread0: Clear td_rux stats in proc0_post

proc0_post aims to reset the CPU usage accounting for all threads and
processes in the system to zero once the time of day is verified.
However, not all of the per-thread stats were not being cleared,
resulting in over-reported time for thread0 post-boot.

Reviewed by:    olce, kib, markj
Fixes:          bed4c5241663 ("Implement RUSAGE_THREAD. Add td_rux...")
Differential Revision:  https://reviews.freebsd.org/D54040
DeltaFile
+6-2sys/kern/init_main.c
+6-21 files

FreeBSD/src d9788easbin/ipf/libipf interror.c, sys/netpfil/ipfilter/netinet ip_fil_freebsd.c fil.c

ipfilter: Restrict ipfilter within a jail

Add a sysctl/tunable (net.inet.ipf.jail_allowed) to control whether a
jail can manage its own ipfilter rules, pools, and settings. A jail's
control over its own ipfilter rules and settings may not be desireable.
The default is jail access to ipfilter is denied.

The host system can stil manage a jail's rules by attaching the rules,
using the on keyword, limiting the rule to the jail's interface. Or
the sysctl/tunable can be enabled to allow a jail control over its own
ipfilter rules and settings.

Implementation note: Rather than store the jail_allowed variable,
referenced by sysctl(9), in a global area, storing the variable in the
ipfilter softc is consistent with ipfilter's use of its softc.

Discussed with:         emaste, jrm
MFC after:              1 week
Differential revision:  https://reviews.freebsd.org/D53623
DeltaFile
+15-0sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
+1-0sys/netpfil/ipfilter/netinet/fil.c
+1-0sbin/ipf/libipf/interror.c
+1-0sys/netpfil/ipfilter/netinet/ip_fil.h
+1-0sys/netpfil/ipfilter/netinet/mlfk_ipl.c
+19-05 files

FreeBSD/src 0ff0c19sbin/ipf Makefile, sys/conf options

ipfilter: Disable ipfs(8) by default

At the moment ipfs(8) is a tool that can be easily abused. Though the
concept is sound the implementation needs some work.

ipfs(8) should be considered experimental at the moment.

This commit also makes ipfs support in the kernel optional.

Reviewed by:            emaste, glebius
MFC after:              1 week
Differential revision:  https://reviews.freebsd.org/D53787
DeltaFile
+7-0sys/modules/ipfilter/Makefile
+6-1sbin/ipf/Makefile
+4-1sys/netpfil/ipfilter/netinet/ip_nat.c
+4-0sys/netpfil/ipfilter/netinet/ip_state.c
+4-0tools/build/mk/OptionalObsoleteFiles.inc
+1-0sys/conf/options
+26-22 files not shown
+28-28 files

FreeBSD/src 4b61bd7sys/contrib/dev/mediatek/mt76 mac80211.c

mt76: ieee80211_is_first_frag() operates on the seq_ctrl field not on fc.

Pass the correct field to ieee80211_is_first_frag(); otherwise the results
may vary.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit c67fd35e58c6ee1e19877a7fe5998885683abedc)
DeltaFile
+1-1sys/contrib/dev/mediatek/mt76/mac80211.c
+1-11 files

FreeBSD/src 8f7cbd2sys/contrib/dev/mediatek/mt76/mt7915 coredump.c eeprom.c, sys/contrib/dev/mediatek/mt76/mt7921 mcu.c

mt76: add LINUXKPI_PARAM_PREFIX for module_param*

In order to not overwrite sysctl/tunables under compat.linuxkpi
we need to prefix the module_param* names with a per-driver/file
designator to make them (more) uniq.  Add the FreeBSD specific
LINUXKPI_PARAM_PREFIX defines for that where missing in mt76.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 853e0440c97a4a1797edd6d653fba4398dc885e8)
DeltaFile
+4-0sys/contrib/dev/mediatek/mt76/mt7915/coredump.c
+4-0sys/contrib/dev/mediatek/mt76/mt7915/eeprom.c
+4-0sys/contrib/dev/mediatek/mt76/mt7915/mcu.c
+4-0sys/contrib/dev/mediatek/mt76/mt7915/mmio.c
+4-0sys/contrib/dev/mediatek/mt76/mt7921/mcu.c
+4-0sys/contrib/dev/mediatek/mt76/mt7925/mcu.c
+24-05 files not shown
+44-011 files

FreeBSD/src e65e9bcsys/contrib/dev/rtw88 led.c sdio.c

rtw88: update Realtek's rtw88 driver

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
7d0a66e4bb9081d75c82ec4957c50034cb0ea449 ( tag: v6.18 ).

Merge commit 'e543442afe3ad5b27616575be2d2402b988656eb' into rtw88

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 8b4477f6b8e1b82acfef558a11facbb2797cb690)
DeltaFile
+7-6sys/contrib/dev/rtw88/led.c
+4-0sys/contrib/dev/rtw88/sdio.c
+11-62 files

FreeBSD/src c22fa08sys/contrib/dev/mediatek/mt76 util.h

mt76: util.h: extend worker name

In mt76_worker_setup() add the "name" argument to the description
for the worker thread.  That way we have a chance to keep them apart.

While here, rename a variable and shorten the the (c)/SPDX section
according to new style.

(cherry picked from commit 9492230fd3d1e58696e9fd99cb9680b27bf1d424)
DeltaFile
+8-31sys/contrib/dev/mediatek/mt76/util.h
+8-311 files