aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* ipfilter: Fix ip_pptp_pxy (PPTP proxy) length underflowCy Schubert2026-06-081-2/+6
| | | | | | | | | | | | | A PPTP client sending a specially crafted PPTP message with a length smaller than the already processed fixed header can panic the system. This resultes in a negative remaining length (a large unsigned 16-bit number). Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D57383
* pfsync: remove invalid panicKristof Provost2026-06-081-1/+5
| | | | | | | | | | | | | When we undefer a packet (when the peer acks the state) it's possible that we don't find a corresponding pfsync_deferral. We panic here, but that's actually something that can happen in normal operation: - if we have too many deferred packets already (in pfsync_defer()) - if the deferral timed out (in pfsync_defer_tmo()) Remove this panic and document the scenarios where it might occur. MFC after: 2 weeks Sponsored by: Orange Business Services
* zfs: fix sysctl_os.cMartin Matuska2026-06-071-54/+1
| | | | | | | | | | | | Correctly declare vfs.zfs.metaslab.condense_pct The following sysctls have moved to metaslab.c: vfs.zfs.metaslab.df_alloc_threshold vfs.zfs.metaslab.df_free_pct vfs.zfs.metaslab.sm_blksz_no_log vfs.zfs.metaslab.sm_blksz_with_log Reported by: dim@FreeBSD.org
* zfs: merge openzfs/zfs@a170134feMartin Matuska2026-06-06195-3847/+14558
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #18372 eaaea55b6 Consistently encode DRR_BEGIN packed nvlist payloads with NV_ENCODE_XDR #18410 891e379d0 Fix failfast default and usage #18470 a2d053329 zdb: Add some more file layout output, triggered by -v #18472 d50f5b6d0 dsl_dir: avoid dd_lock during snapshots_changed updates #18493 d65015938 Vdev allocation bias/class change #18497 8fdc86675 zfs: annotate nested dd_lock in reservation sync accounting #18494 956deba27 zdb: detect BRT and DDT leaks during block traversal #18499 c7cfe0805 zarcstat: detect attached L2ARC device with no data #18503 439b802e7 sa: fix sa_add_projid lock ordering #18508 968f4db03 zpool-attach.8: add EXAMPLES section #18513 45dddc452 zfs.4: Fix documentation of zfs_arc_dnode_reduce_percent #18516 8ff64005a zap: split implementation out into more files #18520 181e1b522 Fix double free for blocks cloned after DDT prune #18535 -multiple zstream: fix crashes when refcount tracking enabled #18536 -multiple refcount tag fixups #18541 a65ed7afd zpool/zfs: accept --help and -? after a subcommand #18544 6fb72fda0 zio_ddt_write: compute have_dvas after taking dde_io_lock #18546 -multiple zap: internal locking uplift #18550 40a87651d zap_impl: use flex array field for mzap_phys_t.mz_chunks #18551 -multiple zap: make the _by_dnode() op variants be the primary implementation #18570 112b0131b zpl_xattr: stop heap-allocating prefixed xattr names #18578 4bc8c39b6 zed: Prefer dRAID distributed spares to regular ones #18596 e30ab5fa4 FreeBSD: Make it possible to build openzfs.ko with sanitizers #18597 472ddca11 zed: Prefer spares with matching rotational and size #18599 c90dc2808 enforce exact decompressed length for lz4, gzip, and zstd #18603 -multiple zap: add zap_cursor_init_by_dnode; cursor unit tests; mock dnode refcounts #18604 59dc88602 nvpair: Check for un-terminated strings in packed nvlist #18606 ef6f26145 When reading a vdev label skip libzfs_core_init() #18613 0aa4088dc sharenfs: Check for invalid characters #18615 80fb85b80 Fix the integer type in zfs_ioc_userspace_many() #18616 e199f6d98 Fix uninitialized variable warning in vdev_prop_get() #18617 7de42602c Extend dataset zfs_ioc_set_prop() secpolicy #18622 5fea0c838 Parallelize metaslab_sync_done() calls #18623 cab50d5ad Add additional verification of size fields and strings #18630 -multiple zap: misc function removal / uplift / tests #18633 a8ef128da Fix uninitialized variable warning in zil_parse() Obtained from: OpenZFS OpenZFS commit: a170134febea405c6b6f5ed51724cdcfb6d8e726
* firewire: clean up XXX commentsAbdelkader Boudih2026-06-061-16/+9
| | | | | | | | | | | | | Remove stale and misleading XXX comments throughout firewire.c. Most were from the original 2002 codebase and either described correct behavior or noted aspirational improvements that never happended. Two actionable items retained as TODO: config ROM CRC validation and pending xfer cleanup on detach. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57466
* fix(fwe): add missing net epoch around ether_inputAbdelkader Boudih2026-06-061-0/+3
| | | | | | | | | Wrap the if_input() call in fwe_as_input() with NET_EPOCH_ENTER/EXIT. The network stack requires epoch protection when delivering packets via if_input, and fwe was missing it. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57459
* procctl(PROC_REAP_GETPIDS): re-validate reaper after relock of proctree_lockKonstantin Belousov2026-06-061-11/+32
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57487
* kern_procctl: add get_reaper_or_p() helperKonstantin Belousov2026-06-061-6/+10
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57487
* procctl(): do not allow the process to exit inside kern_procctl_single()Konstantin Belousov2026-06-061-21/+15
| | | | | | | Requested and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57491
* fork: Drop an uneeded PHOLD/PRELE pairMark Johnston2026-06-061-9/+0
| | | | | | | | | | Support for swapping out kernel stacks was removed, so the PHOLD has no purpose. (And even before that, it's not clear why a swapout here would have been problematic.) Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D57486
* ipsec: Free entire mbuf chain on failureEd Maste2026-06-061-1/+1
| | | | | | Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57475
* linuxkpi 802.11: Free entire mbuf chain on failureEd Maste2026-06-061-2/+2
| | | | | | | | Reviewed by: bz Sponsored by: The FreeBSD Foundation Fixes: 0936c648ad0ee ("LinuxKPI: 802.11: update the ni/lsta reference cycle") Fixes: c816f64e66a0d ("LinuxKPI: 802.11: plug mbuf leak") Differential Revision: https://reviews.freebsd.org/D57477
* if_stf: Free entire mbuf chain on failureEd Maste2026-06-061-2/+2
| | | | | | | Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai Reviewed by: markj, bz, kp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57476
* rename(2): do not allow to rename root vnode of the mounted filesystemKonstantin Belousov2026-06-063-1/+11
| | | | | | | | | | | | | | | | | Check for tdvp being vp_crossmp. This cannot happen for the normal rename cases, but could if the target path specified by the syscall points to the nullfs mount over the regular file. In this case namei() cannot step over crossmp, and keep it in ni_dvp. Since crossmp VOP_GETWRITEMOUNT() returns NULL mp, we retry the locking dance since the belief is that NULL return is transient. PR: 295826 Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57453
* renameat(2): when retrying, check for pending signalsKonstantin Belousov2026-06-061-2/+8
| | | | | | | | | | | | | | The vn_start_write() call there is already interruptible. Check for user signals before restarting due to ERELOOKUP, or after failed vn_start_write(). Note that vn_start_write(V_XSLEEP | V_PCATCH) does not check for signals if not sleeping. PR: 295826 Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57453
* APEI: Provide more info on fatal hardware errorsAndrew Gallatin2026-06-061-16/+37
| | | | | | | | | | | | | | | | | | This change refactors fatal error delivery via APEI and prints more info: - Makes the NMI handler call into the ge handler to establish a common code flow, no matter how the error is delivered - Adds the FRU to the panic string so as to provide more information than just "APEI Fatal Hardware Error!" such as "APEI Fatal Hardware Error: PcieError" - Prints more details about fatal pcie errors. Note that we skip acquiring Giant on fatal errors - Hexdumps the full GED data on fatal errors, so as to facilitate offline data analysis Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D57417
* audit: Replace TAILQ with STAILQDag-Erling Smørgrav2026-06-051-11/+11
| | | | | | | | | | This reduces the size of a trigger entry from 24 bytes to 16 (or from 12 bytes to 8 on 32-bit) with no additional complexity. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans, emaste Differential Revision: https://reviews.freebsd.org/D57464
* audit: Add poll / select supportDag-Erling Smørgrav2026-06-051-2/+21
| | | | | | | | | | | It was previously not possible to poll() or select() on the trigger device, which made implementing proper signal handling in auditd difficult. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans, markj Differential Revision: https://reviews.freebsd.org/D57457
* udp: Fix resource leaks in an error path in udp6_send()Mark Johnston2026-06-051-4/+2
| | | | | | | | Reported by: Andrew Griffiths <andrew@calif.io> Fixes: 069a67374ed9 ("ip6: Remove support for RFC2675 (Jumbo Payload Option)") Reviewed by: pouria, tuexen, glebius Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57341
* vt: Avoid integer overflow in CONS_HISTORY ioctlEd Maste2026-06-052-7/+8
| | | | | | Reviewed by: markj, vexeduxr Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57250
* linux: Drop unneeded PHOLDsMark Johnston2026-06-051-4/+0
| | | | | | | | | There's no point in acquiring a hold if the proc lock isn't going to be dropped. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D57468
* arm64: Expose ESR in mcontextAlex Arslan2026-06-052-1/+8
| | | | | | | | | | | | | | | | | At present, the exception syndrome register (ESR) is not accessible via the user context on FreeBSD AArch64, which makes it difficult to determine the cause of an exception. For example, a signal handler might get a `SIGSEGV` with `SEGV_ACCERR`, but it can't know whether that occurred due to a bad read or write. The change implemented here includes ESR in `struct __mcontext`, thereby allowing access via `ucontext_t` for use by signal handlers, sanitizers, debuggers, etc. Note that this addition consumes one of the seven spare 64-bit slots in `struct __mcontext`. Signed-off-by: Alex Arslan <ararslan@comcast.net> Reviewed by: andrew Pull Request: https://github.com/freebsd/freebsd-src/pull/2053
* arm64: Add exception flag for ksiginfo_t and set in trapsignalAlex Arslan2026-06-052-0/+2
| | | | | | | | | | | | | | The `ksiginfo_t` flag `KSI_TRAP` is set both for exceptions and when copying between userspace and the kernel fails. In the latter case, the exception syndrome register as captured in `struct trapframe` won't be valid. That means we can't use `KSI_TRAP` to determine whether `tf_esr` is valid. This motivates the addition of a new flag, here called `KSI_EXCEPT`, for specifically identifying signals caused by exceptions. It is added to `ksi_flags` via `trapsignal`. Signed-off-by: Alex Arslan <ararslan@comcast.net> Reported by: andrew Pull Request: https://github.com/freebsd/freebsd-src/pull/2053
* nfsd: Add per-MDS fs striping configurationRick Macklem2026-06-053-7/+33
| | | | | | | | | | | | | | | | | | | | | | Commit 72e57bc26417 added support for striping to the pNFS server when using the Flexible File layout. It is configured globally via the following sysctls: vfs.nfsd.pnfsstripeunit - Size (in bytes) of a stripe vfs.nfsd.pnfsstripecnt - # of DSs to stripe across This patch allows the above settings to be overridden on a per-MDS exported file system basis. With this patch, a stripeunit can optionally be specified for the MDS file system listed when one is listed after a '#' in the "-p" nfsd argument. This is done by appending "@NNN", where NNN is the stripeunit, in bytes. The current syntax implies that neither a '#' nor '@' can be in the MDS mount point's directory path. This patch does not affect current pNFS server configurations (of which there appears to be very few, anyhow).
* LinuxKPI: 802.11: set flag if frame should be part of an A-MPDUBjoern A. Zeeb2026-06-051-0/+12
| | | | | | | | | In the output path where we are sending a frame to the driver mark it if it should be part of an A-MPDU based on its tid, type, and whether net80211 thinks that we are in the right state for this. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: make *addba* work betterBjoern A. Zeeb2026-06-052-17/+74
| | | | | | | | | | | | | Fill in more details for lkpi_ic_addba_request(), lkpi_ic_addba_response(), and lkpi_ic_addba_response_timeout(). Migrate the ltxq flags seen_dequeue and stopped to a bitfield and add %b support to log messages. This seemed the better approach after needing an additional stop field for BA while we have to hold packets from being transmitted. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: adjust tracing for action/ampdu/addba functionsBjoern A. Zeeb2026-06-051-3/+9
| | | | | | | | | Adjust the pure debug tracing to no longer be under HT and add more to the other functions we are interested in, so we can follow the calls more easily. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: add note about rate control support under boot -vBjoern A. Zeeb2026-06-051-0/+6
| | | | | | | | | | We currently do not support rate control in LinuxKPI. As more drivers and chipsets gain suppport for higher throughput add a note under bootverbose if we hit one of these cases (currently only older iwlwifi chipsets). Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: implement ieee80211_start_tx_ba_session()Bjoern A. Zeeb2026-06-052-3/+105
| | | | | | | | Implement ieee80211_start_tx_ba_session() as a start for rtw8x (and select mt76 chipsets) to support more throughput. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11: add three more driver downcallsBjoern A. Zeeb2026-06-052-0/+64
| | | | | | | | | Add (*link_sta_rc_update), (*set_bitrate_mask), and (*sta_set_decap_offload) mac80211 driver downcalls in preparation for further work. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* nfs_commonkrpc.c: Improve handling of NFSv4.1/4.2 recoveryRick Macklem2026-06-041-5/+8
| | | | | | | | | | | | | | | Commit 4d80d4913e79 fixed a long standing bug in the recovery code. However. glebius@ reported seeing multiple recovery cycles with this patch during an NFSv4.1/4.2 server reboot. This commit should minimize the risk of multiple recovery cycles. PR: 294925 Reported by: Jov <amutu@amutu.com> MFC after: 2 weeks Fixes: 4d80d4913e79 ("nfs: Fix argument typo to avoid a crash")
* uipc_usrreq: revert addition of EMPTYPATH for bindat(2)Konstantin Belousov2026-06-041-3/+2
| | | | | | | | | | | The caller wants the parent vnode, which cannot be provided for emptypath lookups. Reported and reviewed by: markj Fixes: 12c590a9abd7 ("bindat(2)/connectat(2): allow implicit EMPTYPATH for unix domain sockets") Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57448
* linuxkpi: Add dma_unmap_page_attrsSourojeet A2026-06-041-0/+7
| | | | | | | This will be used by amdgpu as of Linux 6.13. Reviewed by: bz Sponsored by: The FreeBSD Foundation
* MAC/do: Clarify comments about flags attached per-ID or per-ID-typeOlivier Certner2026-06-041-5/+7
| | | | | | | No functional change. MFC after: 3 days Sponsored by: The FreeBSD Foundation
* kern_prot.c: Belatedly add copyrightOlivier Certner2026-06-041-0/+5
| | | | | | | See the commit log for the why. MFC after: 3 days Sponsored by: The FreeBSD Foundation
* pci: bcm2838: cleanup on attach failure to fix devmatch panicKyle Evans2026-06-041-4/+9
| | | | | | | | | | | | | | | | | | | | | | Specifically on the RPi CM4, we currently don't set the controller up right and it never moves into the ready state (we don't observe the link active bit). Failure to cleanup here actually results in a panic not long after, due to a use-after-free in the rman bits. Further down in pci_host_generic, we have some rman stashed in the softc that are initialized and placed onto the rman tailq, then the softc is later freed without an rman_fini() to pull them off of the tailq properly. Note that PCIe on this board won't come up at boot without something plugged in, so it currently can't be booted with an empty slot with the intent to hotplug a supported card. Some issues with controller startup have been observed with Broadcom NICs in the wild, but no problems have been observed with other NICs and a variety of different PCIe cards. Shout-out to Vince <git@darkain.com> for the extensive debugging and analysis to arrive at this conclusion. Reviewed by: andrew, imp Differential Revision: https://reviews.freebsd.org/D56897
* pci: pci_host_generic: provide cleanup methods outside of detachKyle Evans2026-06-044-4/+32
| | | | | | | | | | If device_attach() fails, we're expected to actually cleanup after ourselves because device_detach() will not be called. Factor out the cleanup bits that don't rely on attach having actually succeeded so that we can cleanup properly in bcm2838_pci. Reviewed by: andrew, imp Differential Revision: https://reviews.freebsd.org/D56896
* kern: ofw: provide ofw_bus_destroy_iinfo to teardown interrupt-mapKyle Evans2026-06-042-0/+13
| | | | | | | | For symmetry with ofw_bus_setup_iinfo, the next commits will use it to properly cleanup on failure in bcm2838_pci. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D56895
* nfsd: Add support for striped Flexible File layoutRick Macklem2026-06-047-314/+908
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, the NFSv4.1/4.2 pNFS server configuration did not support striping. This was mainly because the Linux client driver did not support it either. The Linux client driver for Flexible File layout does now support striping. (Linux kernel version 6.18 or newer) As such, this patch adds striping support. The configuration is currently just two new sysctls called vfs.nfsd.pnfsstripeunit - Size (in bytes) of a stripe vfs.nfsd.pnfsstripecnt - # of DSs to stripe across A setting of 0 for the first sysctl and 1 for the second disables striping. A patch that allows use of a different striping configuration for each exported MDS file system is planned for the future. The pnfsdscopymr may be broken by this patch, but since no one reported that they were actually using a pNFS server configuration, I do not believe that will be a problem at this time. Until the FreeBSD NFSv4.1/4.2 client is patched to handle striped flexible file layouts, mounts to a striped pNFS configuration must be done without the "pnfs" mount option. (Linux systems with a kernel version of 6.18 or newer should be able to handle a striped pNFS configuration.) Future patches that convert the pNFS server to a "loosely coupled" configuration (which allows the use of non-FreeBSD servers as DSs) are anticipated.
* linuxkpi: Make pm_qos.h self-containedSourojeet A2026-06-031-0/+2
| | | | | | | | | Include <linux/types.h> for `false`. This is needed by amdgpu somewhere between Linux 6.12 and 6.15. Reviewed by: Minsoo Choo <minsoo@minsoo.io>, bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57415
* nfs_clrpcops.c: Change initial layout type to flex filesRick Macklem2026-06-031-5/+5
| | | | | | | | | Since the File 4.1 layout is only supported by some large configurations of Netapp Filers, switch the client pNFS code to attempting to use Flexible File Format first. File 4.1 Layout should still work for any servers that do no support Flexible File Layout.
* thunderbolt: Fix INVARIANTS compilationOlivier Certner2026-06-034-7/+7
| | | | | | | | | | | | The problem is that THUNDERBOLT_DEBUG triggers the use of some variables, but it is independent of INVARIANTS and the variables it uses were tagged with '__diagused'. Fix this by using '__maybe_unused' in those places. Fixes: 183633079178 ("thunderbolt: make code -Wunused clean") Fixes: 886164895f3f ("amd64: complete thunderbolt KERNCONF integration") Sponsored by: The FreeBSD Foundation
* i386: Fix build (of 'genassym.o')Olivier Certner2026-06-032-1/+5
| | | | | | | | | | | | | | | | | | | | i386's genassym.c needs to define some assembly symbols holding the size of NFS structures to support NFS_ROOT while booting with a nfs_diskless structure. For this, it needs to include a few NFS headers, which require definitions from <sys/mount.h> (fhandle_t, vfs_init_t), which was removed by commit 72ab129799a2 ("x86: remove sys/mount.h from genassym.c"). Since recently, <sys/mount.h> has been including <sys/vnode.h>, so needs "vnode_if.h" to have been generated for the compilation of 'genassym.o' not to fail. Make sure this is the case (for all architectures for simplicity) by tweaking the rule for 'genassym.o' in 'sys/conf/kern.post.mk', leaving a comment there so that it can be removed when i386 is dropped (or if the above-mentioned dependency is broken). Fixes: 72ab129799a2 ("x86: remove sys/mount.h from genassym.c") Sponsored by: The FreeBSD Foundation
* netpfil: add PF netlink command decoding supportIshan Agrawal2026-06-031-52/+51
| | | | | | | | | | | | | Convert PFNL_CMD values in pf_nl.h from an enum to #define constants, add a pfnl_cmd table definition for mktable, and implement the corresponding command decoding helpers in libsysdecode. This allows mktable to generate PF netlink command lookup tables and enables symbolic decoding of PF netlink commands. Reviewed by: kp Signed-off-by: Ishan Agrawal <iagrawal9990@gmail.com> Sponsored by: Google LLC (GSoC 2026)
* cxgbe(4): Use correct FID in KTLS tx work requestsNavdeep Parhar2026-06-031-2/+2
| | | | | MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe(4): Do not read indirect INT_CAUSE registers directlyNavdeep Parhar2026-06-031-0/+8
| | | | | | | | | Some of the registers added in a172f9e5b3cf are not directly accessible and should be avoided. Fixes: a172f9e5b3cf cxgbe(4): Improvements to the slow interrupt handler MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe(4): Use backdoor access to read SGE context on T7Navdeep Parhar2026-06-031-1/+1
| | | | | | | | This avoids a firmware bug where it crashes when accessing SGE context on a secondary core. MFC after: 1 week Sponsored by: Chelsio Communications
* amd64: complete thunderbolt KERNCONF integrationEnji Cooper2026-06-034-0/+18
| | | | | | | | | This completes the work so the driver can be integrated into KERNCONFs properly on amd64. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D55573
* asmc: add MMIO backend for T2 MacsAbdelkader Boudih2026-06-036-25/+611
| | | | | | | | | | | | | | | | | | | | | | | | | | | T2 Macs (2018+) expose the SMC via memory-mapped registers instead of I/O ports. Add asmcmmio.c/asmcmmio.h implementing the MMIO transport: key read/write, getinfo, getbyindex, and a poll-based wait with exponential backoff. The driver probes for MMIO at attach time by checking the LDKN firmware version key; if MMIO is available it is used, otherwise the standard I/O port backend is used. T2 fan speeds use IEEE 754 floats instead of fpe2 fixed-point. Per-fan manual mode uses F%dMd keys instead of the FS! bitmask. Battery charge limit is exposed via dev.asmc.N.battery_charge_limit. Tested on: MacBookPro16,2 (A2251, iBridge2,10) MacBookPro15,4 (A2159, iBridge2,8) MacBookAir8,2 (A1932, iBridge2,5) Mac mini 8,1 (A1993, iBridge2,7) iMac20,2 (A2115, iBridge2,16) iMacPro1,1 (A1862, iBridge1,1) MFC after: 2 weeks Reviewed by: ngie, adrian Differential Revision: https://reviews.freebsd.org/D57086
* lacp: Simplify lacp_compose_key()Andrew Gallatin2026-06-021-133/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | lacp uses interface speed to separate lacp members into different aggregation groups. It wants to use the lower 4 bits of the key to represent the speed. This change fixes a few bugs around that: 1) Actually use the baud rate reported by the interface as the speed (and fall back to use the baudrate associated with the media if the interface somehow doesn't support if_baudrate) 2) Compressess the baud rates down to the 4 bits reserved for them. Using things like FM_400G_FR8 does not fit in 4 bits (its value is 0x1811) . In fact, interfaces faster than 1Gb/s don't fit in 4 bits using the old scheme 3) Emits a warning on the console once per boot if it encounters a NIC with an unsupported speed to make it slightly more obvious why LACP might not behave as expected. This was prompted by a 400g nic with a broken media detection reporting "unknown" as its speed, and being unable to be in the same aggregation group with a different 400g nic that was properly reporting its speed. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D57026 Reviewed by: slavash