FreeBSD/src 36afb13tests/sys/netpfil/common divapp.c, tests/sys/netpfil/ipfw divert.sh

netpfil tests: Make divapp packet loop handling opt-in

This generalizes the divapp logic and makes it usable for other test
scenarios such as diverted TCP connections.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D59067
DeltaFile
+21-21tests/sys/netpfil/pf/divert-to.sh
+20-6tests/sys/netpfil/common/divapp.c
+6-6tests/sys/netpfil/ipfw/divert.sh
+47-333 files

FreeBSD/src 2b93d98tools/test/stress2/misc 1st.sh ext2fs3.sh

stress2: Use the new version of fsx in ports instead of the older one in tools/regression

Suggested by:    asomers
DeltaFile
+4-1,205tools/test/stress2/misc/umountf2.sh
+12-18tools/test/stress2/misc/msdos10.sh
+6-10tools/test/stress2/misc/tmpfs5.sh
+4-10tools/test/stress2/misc/msdos9.sh
+3-9tools/test/stress2/misc/ext2fs3.sh
+1-0tools/test/stress2/misc/1st.sh
+30-1,2526 files

FreeBSD/src d105707sys/compat/linuxkpi/common/src linux_80211_macops.c linux_80211.c

LinuxKPI: 802.11: assert wiphy lock for lkpi_bss_info_change() and MO

Finish reviewing all callers for lkpi_80211_mo_link_info_changed() and
lkpi_80211_mo_bss_info_changed(), which are called from
lkpi_bss_info_change() only.  Add the lockdep_assert_wiphy() to
lkpi_bss_info_change() and make sure all callers are holding the
wiphy lock.

PR:             297228
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+6-1sys/compat/linuxkpi/common/src/linux_80211.c
+2-2sys/compat/linuxkpi/common/src/linux_80211_macops.c
+8-32 files

FreeBSD/src e541832src/arm64/qcom x1-asus-vivobook-s15.dtsi sm8650-ayaneo-pocket-s2.dts

Import device-tree files from Linux 7.1
DeltaFile
+7,127-0src/arm64/qcom/glymur.dtsi
+5,407-3src/arm64/qcom/kaanapali.dtsi
+1,889-0src/arm64/qcom/eliza.dtsi
+1,590-0src/arm64/qcom/purwa-iot-evk.dts
+1,551-0src/arm64/qcom/sm8650-ayaneo-pocket-s2.dts
+1,356-0src/arm64/qcom/x1-asus-vivobook-s15.dtsi
+18,920-31,298 files not shown
+96,104-10,4891,304 files

FreeBSD/src 070a687src/arm64/mediatek mt8390-tungsten-smarc.dtsi, src/arm64/qcom qcs6490-thundercomm-rubikpi3.dts monaco.dtsi

Import device-tree files from Linux 7.0
DeltaFile
+2,633-0src/arm64/qcom/milos.dtsi
+1,606-0src/arm64/qcom/kaanapali.dtsi
+1,516-0src/arm64/qcom/x1e80100-medion-sprchrgd-14-s1.dts
+1,496-6src/arm64/qcom/monaco.dtsi
+1,489-0src/arm64/mediatek/mt8390-tungsten-smarc.dtsi
+1,410-0src/arm64/qcom/qcs6490-thundercomm-rubikpi3.dts
+10,150-61,196 files not shown
+71,422-4,6501,202 files

FreeBSD/src 93922desrc/arm/nvidia tegra124-xiaomi-mocha.dts, src/arm64/nvidia tegra264.dtsi

Import device-tree files from Linux 6.19
DeltaFile
+9,629-0src/arm64/qcom/hamoa.dtsi
+7,750-0src/arm64/qcom/kodiak.dtsi
+6,230-0src/arm64/qcom/monaco.dtsi
+4,792-0src/arm64/qcom/talos.dtsi
+3,190-0src/arm64/nvidia/tegra264.dtsi
+2,790-0src/arm/nvidia/tegra124-xiaomi-mocha.dts
+34,381-01,475 files not shown
+104,084-7,1561,481 files

FreeBSD/src 8b46e95src/arm64/apple t602x-pmgr.dtsi, src/arm64/qcom x1e80100-hp-omnibook-x14.dts x1p42100-lenovo-thinkbook-16.dts

Import device-tree files from Linux 6.18
DeltaFile
+8,604-0src/arm64/qcom/lemans.dtsi
+4,466-0src/arm64/qcom/sm6150.dtsi
+2,265-0src/arm64/apple/t602x-pmgr.dtsi
+1,666-0src/arm64/qcom/x1-dell-thena.dtsi
+1,625-0src/arm64/qcom/x1p42100-lenovo-thinkbook-16.dts
+4-1,545src/arm64/qcom/x1e80100-hp-omnibook-x14.dts
+18,630-1,5451,421 files not shown
+98,443-14,9421,427 files

FreeBSD/src 80bac43sys/dev/iicbus/sensor w83793g.c

i2c/sensor/w83793g: Fix unused function warning

w83793g_writereg is unused so silence it.

Fixes:  cd3cc6e910c0f ("i2c/sensors: Add driver for W83793 hardware monitor")
DeltaFile
+2-0sys/dev/iicbus/sensor/w83793g.c
+2-01 files

FreeBSD/src 203438dusr.bin/xinstall xinstall.c, usr.bin/xinstall/tests install_test.sh

install: Fix two bugs in stdin code

* Fix case where the source is - and the target exists.

* Only call chflags() (to remove flags that might prevent us from
  replacing an existing target) in the exists case; otherwise,
  to_sb.st_flags is uninitialized.

* Rename the source file in the stdin test case.

* Extend null and stdin test cases to cover the case where the
  target already exists.

PR:             297681
MFC after:      1 week
Fixes:          d34870708db9 ("install: Allow installing stdin")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D59144

(cherry picked from commit a5ff4125cf08a83f7e67f498e423f3e354144327)
DeltaFile
+17-7usr.bin/xinstall/tests/install_test.sh
+3-3usr.bin/xinstall/xinstall.c
+20-102 files

FreeBSD/src 84bfbd6tools/build Makefile

build: Use -f when copying sources

If one of the source files we copy is non-writeable, cp will create a
non-writeable copy.  If the original is later modified, cp will fail to
overwrite the copy since it is not writeable.  Using cp -f ensures the
copy always succeeds, as long as the object directory is writeable.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.

(cherry picked from commit 336b6d11922ac3d080de50f789d40ff95b540cdf)
DeltaFile
+2-2tools/build/Makefile
+2-21 files

FreeBSD/src 9213578sys/sys sched.h

kern/sched: Hide scheduler selection from C++

The scheduler selection interface uses names that are reserved words in
C++, causing problems for downstream projects that use C++ in the
kernel.  Work around this by hiding the interface from C++ compilers
until we can come up with a better solution.

Fixes:          ce38acee8d0b ("Add kern/sched_shim.c")
MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    siderop1_netapp.com, imp, kib
Differential Revision:  https://reviews.freebsd.org/D58991

(cherry picked from commit f2366851616083f923e8101363802678a03dc0b9)
DeltaFile
+12-2sys/sys/sched.h
+12-21 files

FreeBSD/src 9f25a71tools/build Makefile

build: Use -f when copying sources

If one of the source files we copy is non-writeable, cp will create a
non-writeable copy.  If the original is later modified, cp will fail to
overwrite the copy since it is not writeable.  Using cp -f ensures the
copy always succeeds, as long as the object directory is writeable.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.

(cherry picked from commit 336b6d11922ac3d080de50f789d40ff95b540cdf)
DeltaFile
+2-2tools/build/Makefile
+2-21 files

FreeBSD/src 724c344usr.bin/xinstall xinstall.c, usr.bin/xinstall/tests install_test.sh

install: Fix two bugs in stdin code

* Fix case where the source is - and the target exists.

* Only call chflags() (to remove flags that might prevent us from
  replacing an existing target) in the exists case; otherwise,
  to_sb.st_flags is uninitialized.

* Rename the source file in the stdin test case.

* Extend null and stdin test cases to cover the case where the
  target already exists.

PR:             297681
MFC after:      1 week
Fixes:          d34870708db9 ("install: Allow installing stdin")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D59144

(cherry picked from commit a5ff4125cf08a83f7e67f498e423f3e354144327)
DeltaFile
+17-7usr.bin/xinstall/tests/install_test.sh
+3-3usr.bin/xinstall/xinstall.c
+20-102 files

FreeBSD/src 1e7d914usr.bin/yes yes.c

yes: Avoid static initialization

Our buffer is half a megabyte, but we are only initializing the first
two bytes.  Switching from static to dynamic initialization moves it
from .data to .bss, greatly reducing the size of the binary.

Fixes:          cf74b63d61b4 ("yes: Completely overengineer")
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D58890

(cherry picked from commit 557ba0c2a5138ce026c0ea9cb02f374f97378b7c)
DeltaFile
+7-3usr.bin/yes/yes.c
+7-31 files

FreeBSD/src 072f131share/man/man4 bnxt.4, sys/dev/bnxt/bnxt_en bnxt_hwrm.h bnxt.h

bnxt: Add led(4) identification support

Query the firmware for the LEDs on each physical port and expose
/dev/led/bnxt* only when alternate blinking is supported.  Configure
every LED in the advertised group for identification and restore its
default firmware state before a function reset.

This follows the DPDK and Linux bnxt HWRM identification paths.

Reviewed against: DPDK, Linux

Reviewed by:    Sumit Saxena <sumit.saxena at broadcom.com>
Sponsored by:   BBOX.io

(cherry picked from commit 98b5640786f874949e441bee7c4ad5740cd6a649)
DeltaFile
+105-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+41-0sys/dev/bnxt/bnxt_en/if_bnxt.c
+15-0sys/dev/bnxt/bnxt_en/bnxt.h
+6-1share/man/man4/bnxt.4
+2-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.h
+169-15 files

FreeBSD/src b057c92share/man/man4 bnxt.4, sys/dev/bnxt/bnxt_en bnxt_hwrm.h bnxt.h

bnxt: Add led(4) identification support

Query the firmware for the LEDs on each physical port and expose
/dev/led/bnxt* only when alternate blinking is supported.  Configure
every LED in the advertised group for identification and restore its
default firmware state before a function reset.

This follows the DPDK and Linux bnxt HWRM identification paths.

Reviewed against: DPDK, Linux

Reviewed by:    Sumit Saxena <sumit.saxena at broadcom.com>
Sponsored by:   BBOX.io

(cherry picked from commit 98b5640786f874949e441bee7c4ad5740cd6a649)
DeltaFile
+105-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+41-0sys/dev/bnxt/bnxt_en/if_bnxt.c
+15-0sys/dev/bnxt/bnxt_en/bnxt.h
+6-1share/man/man4/bnxt.4
+2-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.h
+169-15 files

FreeBSD/src e59d4ecsys/dev/ufshci ufshci_sim.c ufshci_ctrlr.c

ufshci: handle a recovery reset before the SIM attach

When the first start attempt fails early, the recovery reset
runs the start sequence again without a SIM. That pass still
looked up the WLUN, so it dereferenced a NULL SIM and panicked.

Attach the SIM whenever it does not exist yet. Also make the
WLUN lookup return NULL when there is no SIM.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58947
DeltaFile
+4-3sys/dev/ufshci/ufshci_ctrlr.c
+4-0sys/dev/ufshci/ufshci_sim.c
+8-32 files

FreeBSD/src 746278asys/dev/ufshci ufshci_req_queue.c

ufshci: build valid fake responses for manual completion

The manual completion wrote the fake response to the wrong
descriptor for task management slots. It also left the task tag
at zero, which tripped the task tag check under INVARIANTS.

Write the fake response where the completion path reads it.
Copy the task tag from the request.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58946
DeltaFile
+20-6sys/dev/ufshci/ufshci_req_queue.c
+20-61 files

FreeBSD/src 3ecee93sys/dev/ufshci ufshci_req_queue.c

ufshci: reject new requests on a failed controller

A failed controller accepted new requests, but nothing ever
completed them, so the caller waited forever. The admin retry
path could also resubmit a request to a dead queue.

Reject new submits and admin retries on a failed controller.
The submit check runs under the queue lock, so it cannot race
with the queue walk in the fail path.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58948
DeltaFile
+5-2sys/dev/ufshci/ufshci_req_queue.c
+5-21 files

FreeBSD/src 1258ae2sys/dev/ufshci ufshci_private.h ufshci_ctrlr.c

ufshci: run the controller fail path only once

Two threads could run ufshci_ctrlr_fail() at the same time.
Each one walked the queues and completed the same trackers
again, which caused a double free and a panic.

Turn is_failed into an atomic gate, so only the first caller
walks the queues. The reset task now returns early on a failed
controller instead of re-enabling it.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58944
DeltaFile
+11-1sys/dev/ufshci/ufshci_ctrlr.c
+1-1sys/dev/ufshci/ufshci_private.h
+12-22 files

FreeBSD/src 7682b8fsys/dev/ufshci ufshci_req_queue.c

ufshci: claim trackers before failing them

ufshci_req_queue_fail() drops the queue lock to complete each
tracker. In that window the completion path could complete the
same tracker again.

Claim the slot before dropping the lock, so the completion scan
skips it. Reserved slots are left to their submit thread, which
completes them itself. The manual request completion helper
lost its only caller, so drop it.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58945
DeltaFile
+20-40sys/dev/ufshci/ufshci_req_queue.c
+20-401 files

FreeBSD/src 1a2a886sys/dev/acpica acpi_pci.c

acpi_pci: Inherit PF locality for SR-IOV VFs

SR-IOV VFs are instantiated from their PF and intentionally do not
receive an ACPI handle by matching their runtime BDF.  Consequently,
ACPI locality queries for a VF fall back to the upstream bus.  This is
usually sufficient, but loses a _PXM supplied specifically for the PF.

Use the PCI core's owning-PF accessor for BUS_GET_DOMAIN and
BUS_GET_CPUS requests made for a VF.  This preserves the VF's lack of
an ACPI handle while allowing its CPU and NUMA placement to follow the
PF.

Reviewed by:    jhb
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59062
DeltaFile
+24-1sys/dev/acpica/acpi_pci.c
+24-11 files

FreeBSD/src 8b74806sys/dev/acpica acpi_pci.c

acpi_pci: Do not match SR-IOV VFs to ACPI devices

SR-IOV VFs are instantiated dynamically from their PF rather than
enumerated from ACPI.  A VF's runtime slot and function can match an
unrelated _ADR below the bridge.  acpi_pci_save_handle() stores that
handle in the VF's devinfo before acpi_pci_update_device() runs.

If the handle is already bound to another device_t whose parent is not
acpi0, acpi_pci_update_device() panics under INVARIANTS.  Without
INVARIANTS, the VF retains the unrelated handle, so subsequent ACPI
lookups, including NUMA and power-management operations, can act on the
wrong namespace node.

Skip ACPI namespace matching for VFs.

Reviewed by:    jhb
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59061
DeltaFile
+12-0sys/dev/acpica/acpi_pci.c
+12-01 files

FreeBSD/src c54fbc9bin/chflags chflags.1

chflags.1: Change dontcache to nocache

Commit 290e563166b4 changed the flag's name from dontcache
to nocache. This patch fixes the man page.

This is a content change.

Reviewed by:    kib (earlier version)
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D58181
Fixes:  4830670a3f94 ("chflags.1: Document the new UF_DONTCACHE flag")
DeltaFile
+3-3bin/chflags/chflags.1
+3-31 files

FreeBSD/src 290e563lib/libc/gen strtofflags.c, sys/fs/tmpfs tmpfs_subr.c

chflags: Add a new UF_NOCACHE flag

This internet draft (which is close to being an RFC)
specifies a new NFSv4.2 attribute which tells the NFSv4.2
client to not cache file data. (Similar to O_DIRECT, but
triggered by this attribute set on the file on the NFSv4.2
server and not by the application's open(2).)

https://datatracker.ietf.org/doc/draft-ietf-nfsv4-uncacheable-files/

This patch adds a new chflags(1) flag called UF_NOCACHE to
implement this.

Patches for NFS and ZFS will be done separately.

This is a redo of the patch, with a requested name change
and a #ifdef in strtofflags.c so that it doesn't break some
Linux cross build.  The name change was requested by fuz@.


    [3 lines not shown]
DeltaFile
+6-0lib/libc/gen/strtofflags.c
+1-1sys/ufs/ufs/ufs_vnops.c
+1-1sys/fs/tmpfs/tmpfs_subr.c
+1-0sys/sys/stat.h
+9-24 files

FreeBSD/src 0f59df8sys/dev/usb/controller xhci.h xhci.c

xhci: Only reset the data toggle value when the USB stack asks for it

The previous patch assumes that we don't want to reset toggle bit in
STOPPED_STEP. However, a device can explicitly call
usbd_clear_data_toggle if necessary. As a result, instead of not
dropping the bit unconditionally, we added a field in xhci to specify
that we want to drop it, so that usbd_clear_data_toggle can handle it
correctly.

Reported by:    oh
Reviewed by:    kevans
Tested by:      oh
Fixes:          28d85db46b48 ("xhci: Do not drop and add bits in xhci")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D59186
DeltaFile
+18-5sys/dev/usb/controller/xhci.c
+1-0sys/dev/usb/controller/xhci.h
+19-52 files

FreeBSD/src 4a20c0asys/kern sched_ule.c

sched_ule: Fix spelling of csr_cpu in comment.

Commit 08063e9f98 renamed cs_cpu to csr_cpu.
DeltaFile
+1-1sys/kern/sched_ule.c
+1-11 files

FreeBSD/src 0ffad4cusr.sbin/bhyve pci_passthru.c

bhyve: Tidy lobits handling in pci_passthru

- The lobits field in the "physical" BAR settings is never used, so
  don't bother setting it.

- Expand the comment explaining why the existing lobits are preserved
  (namely, to preserve the prefetch flag on memory BARs).

Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D58894
DeltaFile
+4-3usr.sbin/bhyve/pci_passthru.c
+4-31 files

FreeBSD/src b00bb87usr.sbin/bhyve pci_emul.c

bhyve: Refactor initial PCI BAR setup

Fully initialize BARs with an address of 0 in pci_emul_alloc_bar()
instead of deferring some of that initialization to
pci_emul_assign_bar().  Now, the latter is only used to allocate an
initial address range for PCI BARs.

Note that this means that the pci_passthru model now overrides the
initial lobits after they are set removing the need for a workaround
in pci_emul_assign_bar().

Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D58893
DeltaFile
+63-53usr.sbin/bhyve/pci_emul.c
+63-531 files

FreeBSD/src 3807c8busr.sbin/bhyve pci_emul.c

bhyve: Don't set the prefetch flag for large 64-bit memory BARs

The only device model that can create a large 64-bit memory BAR is the
passthru device model, and that device model reuses the lobits of the
existing BAR explicitly.

Fixes:          e87a6f3ef284 ("bhyve: use physical lobits for BARs of passthru devices")
DeltaFile
+1-2usr.sbin/bhyve/pci_emul.c
+1-21 files