FreeBSD/src 3023bb4sys/dev/asmc asmc.c

asmc: introduce the concept of generic models

Having to enter in each of the models for Apple hardware, recompiling,
etc, is tedious. Provide generic models so end-users can leverage some
of the capabilities provided by the driver, i.e., common features like
minimal fans and lights (if present on the generic model) support.

The generic models are as follows:
- Macmini
- MacBookAir
- MacBookPro
- MacPro

This sort of follows the pattern established by the `applesmc` driver in
Linux.

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55395
DeltaFile
+67-13sys/dev/asmc/asmc.c
+67-131 files

FreeBSD/src 94db365sys/dev/asmc asmc.c asmcvar.h

asmc: add Wake-on-LAN control via sysctl

Apple Mac systems support Wake-on-LAN from powered-off state (S5/G2) via
the AUPO SMC key.

This change adds a convenience sysctl, `dev.asmc.0.wol`. This can be
disabled if set to 0 and enabled if set to 1.

The AUPO key is volatile and resets to 0x00 on every boot, so WoL must
be manually enabled before each shutdown to work from powered-off state.
Users need to run: `sysctl dev.asmc.0.wol=1` before shutting down the
system. The sysctl is best set to persist in `/etc/sysctl.conf`.

MFC after:      1 week
Reviewed By:    markj, ngie
Differential Revision:  https://reviews.freebsd.org/D54439
DeltaFile
+45-0sys/dev/asmc/asmc.c
+5-0sys/dev/asmc/asmcvar.h
+50-02 files

FreeBSD/src 0fc6c3fsys/dev/adb adb_bus.c, sys/dev/qlnx/qlnxe qlnx_os.c

chore: replace {0, 0} with {DEV,KOBJ}METHOD_END

Both of the aforementioned macros have been present in FreeBSD
for well over a decade: 2009 for `KOBJMETHOD_END`; 2011 for
`DEVMETHOD_END`.

Adapt all hardcoded references of `{0, 0}` with `DEVMETHOD_END`
and `KOBJMETHOD_END` as appropriate. This helps ensure that
future adaptations to drivers following patterns documented
in driver(9) can be made more easily/without issue.

MFC after:      1 week
Differential Revision:   https://reviews.freebsd.org/D55414
DeltaFile
+6-6sys/dev/sound/pci/vibes.c
+6-6sys/dev/adb/adb_bus.c
+2-2sys/dev/usb/input/uep.c
+2-2sys/dev/sound/macio/i2s.c
+2-2sys/dev/siis/siis.c
+2-2sys/dev/qlnx/qlnxe/qlnx_os.c
+20-20180 files not shown
+208-207186 files

FreeBSD/src 0ac5cddtools/tools/syscall_timing Makefile.depend

syscall_timing: add Makefile.depend

This was part of review D44761. It was separated into another commit for
better clarity.

Obtained from:  Hewlett Packard Enterprise
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44761
DeltaFile
+13-0tools/tools/syscall_timing/Makefile.depend
+13-01 files

FreeBSD/src de773bctools/tools/syscall_timing Makefile

Use NO_SHARED instead of explicitly using -static flag

NO_SHARED is the proper way to declare linking a program without
shared libraries.

Obtained from:  Hewlett Packard Enterprise
MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D44761
DeltaFile
+2-1tools/tools/syscall_timing/Makefile
+2-11 files

FreeBSD/src 96a57fcsys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: adjust assoc check before key deletion

There is a discrepancy between the vif assoc state and the sta state
(see comment in lkpi_sta_run_to_init()).
Adjust the check in lkpi_iv_key_delete() and add it to
lkpi_sta_del_keys() so that we can take way the keys after whatever
comes first: the sta went away from AUTHORIZED (RUN) or if the vif is
no longer marked assoc.
This is needed as we may only take the sta down partially back to
State 2 (cf. 802.11-2024, Figure 11-23) and key material is no longer
valid before the vif gets cleaned up and the sta is removed entirely.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+21-9sys/compat/linuxkpi/common/src/linux_80211.c
+21-91 files

FreeBSD/src 48f55a4sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: fold the sta state machine again

In and around d9f59799fc3e7 we adjusted the initial sta state machine
implementation and unfolded some functions, duplicating code.
This version tries to undo some of that as it seems that we can get
away with doing it more cleanly these days.

There are 5 main functions for the path from INIT to RUN (UP1,2,3.1,3.2,4)
and 4 main functions for the path from RUN to INIT (DOWN1,2,3,4).
The reason there is one more on the patch up is that we can go directly
from AUTH to RUN without going through ASSOC first.
In addition there are further functions relying only on these 9 base
state change functions in order to implement the remaining possible
state transitions net80211 can do (without CSA and SLEEP).

Another change is that we no longer take a sta always through INIT/SCAN
first and then back up to AUTH, that is, we are no longer deleting the
sta from the firmware unless net80211 would also take us down to that
state and in a follow-up back up.

    [12 lines not shown]
DeltaFile
+667-945sys/compat/linuxkpi/common/src/linux_80211.c
+667-9451 files

FreeBSD/src acba7a6sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: improve crypto debug logging

Add a log entry to lkpi_ieee80211_iterate_keys() in order to be able
to determine if there are still keys available when a driver calls
into this (e.g., iwlwifi does before removing the sta to make sure
the keys are gone).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+8-0sys/compat/linuxkpi/common/src/linux_80211.c
+8-01 files

FreeBSD/src a2c2de8release/scripts pkg-stage.sh

pkg-stage.sh: Add ext2 and ntfs

Having these packages available on release media may help users who
need to sneakernet other packages (e.g. firmware) from systems running
Linux or Windows.

Suggested by:   vladlen, ziaee
MFC after:      3 days

(cherry picked from commit 6881fd278d80ac63b4d511fc130a79ff16d1bb48)
DeltaFile
+2-0release/scripts/pkg-stage.sh
+2-01 files

FreeBSD/src e43730esys/dev/cxgbe/tom t4_cpl_io.c

cxgbe tom: Use the same WRs as iSCSI to send PDUs for NVMe

Reviewed by:    np (earlier version)
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55470
DeltaFile
+13-99sys/dev/cxgbe/tom/t4_cpl_io.c
+13-991 files

FreeBSD/src 6513c28sys/arm/arm machdep_boot.c machdep.c, sys/arm64/arm64 machdep_boot.c

sys: Declare 'end' as an extern char[]

While here, remove an unused declaration.

Reviewed by:    jrtc27
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D53898
DeltaFile
+1-1sys/arm/arm/machdep_boot.c
+0-2sys/arm/arm/machdep.c
+1-1sys/arm64/arm64/machdep_boot.c
+1-1sys/riscv/riscv/machdep.c
+3-54 files

FreeBSD/src fba56belib/libdevctl devctl.3, sys/kern subr_bus.c

Do not fail 'devctl clear driver' if another driver is not found

Detaching the bhyve(4) ppt driver from an unsupported PCI device
should not raise a "Device not configured" error.  We do not expect
that a new driver must take over the device in this case.

Reviewed by:    imp, jhb
Differential Revision:  https://reviews.freebsd.org/D52050
DeltaFile
+13-1sys/kern/subr_bus.c
+2-1lib/libdevctl/devctl.3
+15-22 files

FreeBSD/src ef1218asys/kern sched_shim.c

kern/sched_shims.c: back to ifunc

Reported by:    kevans
Reviewed by:    kevans, mhorne
Fixes:  0d3652f67d246348e2c017205c6782caf4484449
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differrential revision: https://reviews.freebsd.org/D55490
DeltaFile
+2-3sys/kern/sched_shim.c
+2-31 files

FreeBSD/src c3ed2f3sys/arm64/conf std.nxp, sys/arm64/qoriq qoriq_dw_pci.c

qoriq / nxp: Fix spelling take II

Fix spelling of NXP, which is not NPX, in two places.

Improves:       a4e30909ec98
Reported by:    Kevin Bowling (kevin.bowling kev009.com), qoriq_dw_pci.c
MFC after:      3 days
DeltaFile
+1-1sys/arm64/qoriq/qoriq_dw_pci.c
+1-1sys/arm64/conf/std.nxp
+2-22 files

FreeBSD/src fc9369asys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: do not leak BA sessions when tearing down state

In certain cases we may tear down state of a node with 'ongoing'
BA sessions.  This can trigger a firmware crash with iwlwifi as
reported in [1] when trying to remove the sta from the firmware.

   0x2010303A | ADVANCED_SYSASSERT
   ..
   0x00000000 | umac data1 (sta id=0)
   ..
   0x0088030C | last host cmd (STA_RM)

[1] https://lists.freebsd.org/archives/freebsd-wireless/2025-November/003901.html

I hit the same problem while running regression tests after
reworking some LinuxKPI 802.11 sta state machine bits.

Add the missing calls to lkpi_sta_run_to_assoc() and lkpi_sta_run_to_init()
to make sure (through net80211) we call (*ampdu_action) with

    [10 lines not shown]
DeltaFile
+22-0sys/compat/linuxkpi/common/src/linux_80211.c
+22-01 files

FreeBSD/src 5153ca3sys/kern vfs_mount.c

vfs_mount.c: Don't call VFS_MOUNT() if only exports are being updated

PR#293198 reports a hang within ZFS when exports
are being updated concurrently with a VOP_SETEXTATTR().
The hang appears to be caused by mishandling of the
z_teardown_lock, but fixing handling of this lock appears
to be a major effort. Since the hang occurs when
VFS_MOUNT() acquires a write/exclusive z_teardown_lock,
which rarely occurs, except when exports are being updated,
this patch avoids the VFS_MOUNT() call for this case.

Avoiding a VFS_MOUNT() call fixes the hang for the case
reported by PR#293198 and is also an optimization.
As such, this patch avoids the VFS_MOUNT() call when only exports
are being updated similar to what was already being done
within vnet prisons.

PR:     293198

(cherry picked from commit 935cf3284f520c90a63baaadb762caaa30084f5c)
DeltaFile
+31-21sys/kern/vfs_mount.c
+31-211 files

FreeBSD/src a4e3090sys/arm64/qoriq qoriq_dw_pci.c

qoriq: fix spelling in device_set_desc()

The product series is called NXP QorIQ Layerscape.  Remove the extra 'e.

MFC after:      3 days
Reviewed by:    mmel, emaste
Differential Revision: https://reviews.freebsd.org/D55388
DeltaFile
+1-1sys/arm64/qoriq/qoriq_dw_pci.c
+1-11 files

FreeBSD/src 5edf24asys/ofed/include/rdma ib_verbs.h

ofed: reduce usage of struct dma_attrs *dma_attrs

ib_verbs.h still uses struct dma_attrs *dma_attrs everywhere.
It is beyond my knowledge when that struct got deprecated upstream but
it is still supported by our LinuxKPI.  The problem is that the
functions called with that argument (dma_map_single_attrs,
dma_unmap_single_attrs, dma_map_sg_attrs, dma_unmap_sg_attrs) so far
are #defines in LinuxKPI and drop the last argument (attrs) so it was
never a problem.

In preparation to pass the attrs to the actual implementation in LinuxKPI,
which has gained support for them, we now pass dma_sttrs->flags which
is the expected unsigned long bit field.

If anyone has serious interest in updating our ofed implementation they
could look into this some more and remove the usage of struct dma_attrs
entirely.

Sponsored by:   The FreeBSD Foundation

    [3 lines not shown]
DeltaFile
+4-4sys/ofed/include/rdma/ib_verbs.h
+4-41 files

FreeBSD/src aabd524sys/dev/ahci ahci_pci.c

ahci: Restrict NVMe redirection by BAR size

Attempts to access vendor-specific registers on emulator of older
Intel hardware was reported to confuse one.  Since the redirection
obviously require BAR size bigger than normal 2KB of AHCI, add
the condition, similar to what Linux is doing.

Requested by:   kib
MFC after:      2 weeks

(cherry picked from commit b9d3945831fc7a60f2065c7a0afc747dc5653c9f)
DeltaFile
+2-1sys/dev/ahci/ahci_pci.c
+2-11 files

FreeBSD/src 56a6305sys/dev/ahci ahci_pci.c

ahci: Restrict NVMe redirection by BAR size

Attempts to access vendor-specific registers on emulator of older
Intel hardware was reported to confuse one.  Since the redirection
obviously require BAR size bigger than normal 2KB of AHCI, add
the condition, similar to what Linux is doing.

Requested by:   kib
MFC after:      2 weeks

(cherry picked from commit b9d3945831fc7a60f2065c7a0afc747dc5653c9f)
DeltaFile
+2-1sys/dev/ahci/ahci_pci.c
+2-11 files

FreeBSD/src 0c075dbtools/build stddef.h

tools/build/stddef.h: fix stock clang/gcc headers

Both clang and gcc's stddef.h are designed to be included multiple times
with different combinations of __need_* macros defined (e.g
__need_size_t). Remove the #pragma once to accommodate this, ptraddr_t
is guarded by _PTRADDR_T_DECLARED anyways.

Also use __SIZE_TYPE__ instead of size_t since it's not guaranteed to be
defined.

Reviewed by:    brooks, imp, kib
Differential Revision:  https://reviews.freebsd.org/D55453
DeltaFile
+12-2tools/build/stddef.h
+12-21 files

FreeBSD/src 0fd91c4usr.sbin/bsdinstall/scripts bootconfig

bsdinstall: fix EFI boot entry creation

update_uefi_bootentry assumes that the caller sets FREEBSD_BOOTNAME and
mntpt, which isn't the case anymore. The result is that there is no
"FreeBSD" boot entry created/updated after install. Most machines manage
to boot from the removable media path (if the loader is installed there
too), but some don't.

Take the loader's path as an argument and rename the variable used in
the ZFS mirror loop so mntpt can be reused below.

Also mark nentries as a local variable so it doesn't leak out of the
function.

PR:             293385
Fixes:          494de51bc0074472d1b01604f085daea0844f240
MFC after:      2 days
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55469
DeltaFile
+14-11usr.sbin/bsdinstall/scripts/bootconfig
+14-111 files

FreeBSD/src fac9ae3usr.sbin/efibootmgr efibootmgr.8

efibootmgr.8: capitalize examples section header

MFC after:      3 days
DeltaFile
+1-1usr.sbin/efibootmgr/efibootmgr.8
+1-11 files

FreeBSD/src 591127bsys/dev/acpica acpivar.h

acpi: Use __BUS_ACCESSOR_DEFAULT and __BUS_ACCESSOR for IVARs

- Use __BUS_ACCESSOR_DEFAULT for the global handle IVAR to preserve
  existing behavior for acpi_get_handle.

- Use __BUS_ACCESSOR for the private ACPI IVARs as these are only used
  with direct children of acpi0.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55355
DeltaFile
+4-25sys/dev/acpica/acpivar.h
+4-251 files

FreeBSD/src 0bb867esys/dev/acpica acpivar.h acpi.c, sys/isa isavar.h

acpi: Split ACPI IVARs into global and private sets

ACPI_IVAR_HANDLE is the only true "global" IVAR that can be used
across multiple bus drivers.  The other IVARs are private to direct
children of acpi0.  However, they need to be numbered after ISA IVARs
as ACPI mimics an ISA bus device.  To ensure this remains true, add an
ISA_IVAR_LAST to use in assert that the private ACPI IVARs do not
overlap with ISA IVARs.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55354
DeltaFile
+3-3sys/dev/acpica/acpivar.h
+3-0sys/dev/acpica/acpi.c
+2-1sys/isa/isavar.h
+8-43 files

FreeBSD/src b937f9bsys/sys bus.h

bus: Add __BUS_ACCESSOR_DEFAULT

This macro is similar to __BUS_ACCESSOR in that it creates three
helper routines for an ivar, but the "get" wrapper returns a default
value if BUS_READ_IVAR does not return a value.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55353
DeltaFile
+32-14sys/sys/bus.h
+32-141 files

FreeBSD/src cb5a0ebsys/sys bus.h

bus: Add a new IVAR accessor to check for the existence of an IVAR

<varp>_has_<var> returns true if the given IVAR can be read.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55352
DeltaFile
+11-0sys/sys/bus.h
+11-01 files

FreeBSD/src 82b293esys/dev/sdio sdiob.h

sdiob: Forward-declare struct sdio_func

Currently this happens as a side effect of the return type of
sdio_get_function() in the expansion of __BUS_ACCESSOR, but this is
fragile and can break if __BUS_ACCESSOR changes to define other
functions first.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55351
DeltaFile
+2-0sys/dev/sdio/sdiob.h
+2-01 files

FreeBSD/src 8d3f41dsys/crypto/ccp ccp_hardware.h, sys/modules/ccp Makefile

ccp: Don't name anonymous structure and union types

Keep the dword labels as comments instead.  Anonymous structs and
unions don't have type names in C11+.

Differential Revision:  https://reviews.freebsd.org/D55144
DeltaFile
+5-5sys/crypto/ccp/ccp_hardware.h
+0-3sys/modules/ccp/Makefile
+5-82 files

FreeBSD/src 5faceb8sys/sys cdefs.h

__builtin_align_down: Cast value to __uintptr_t in the fallback

This matches the behavior of the fallbacks for __builtin_align_up
and __builtin_is_aligned.

Reviewed by:    arichardson, ngie, kib
Differential Revision:  https://reviews.freebsd.org/D55161
DeltaFile
+1-1sys/sys/cdefs.h
+1-11 files