aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
...
* sys: Retire le(4)Ed Maste2026-03-0211-4337/+0
| | | | | | | | | | | | | | | | We retired most obsolete 10 and 10/100 Ethernet NIC drivers in 2019 -- see commits following ebcf740a32ae ("FCP-101: remove obsolete 10 and 10/100 Ethernet drivers.). le(4) was retained with with the note "Emulated by QEMU, alternatives don't yet work for mips64." MIPS has since been removed from the tree and emulators and virtual machines offer many other, more suitable devices. Reviewed by: brooks Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55516
* virtio: add loader tunables to sysctlTimo Völker2026-03-023-2/+16
| | | | | | | | | | virtio_pci uses two loader tunables that should be more visible. This patch adds these loader tunables to sysctl and describes them in the virtio(4) man page. Reviewed by: imp (erlier version), tuexen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55533
* asmc: output the SMC firmware revision on attachEnji Cooper2026-03-012-2/+12
| | | | | | | | | | | | | | | | The SMC firmware revision can prove helpful when determining why the behavior of a given controller varies from the maintainers' expected behavior. This should be a sysctl (eventually), but for now dumping out the information via `device_printf(..)` suffices, given that only one asmc(4) compatible device can exist in an Apple platform at any given point in time. This will become a sysctl in the future after additional improvements are incorporated from OpenBSD and NetBSD. MFC after: 1 week Obtained from: https://github.com/openbsd/src/ (sys/dev/acpi/asmc.c @ 142d064) Differential Revision: https://reviews.freebsd.org/D55577
* hwpmc: Initial support for AMD IBSAli Mashtizadeh2026-02-275-17/+907
| | | | | | | | | | | | | | | This patch adds support for AMD IBS. It adds a new class of performance counter that cotains two events: ibs-fetch and ibs-op events. Unlike most existing sampled events, IBS events provide a number of values containing extra information regarding the sample. To support this we use the existing callchain event, and introduce a new flag for multipart payloads. The first 8 bytes of the pc_sample contains a header that defines up to four payloads. Sponsored by: Netflix Reviewed by: imp,mhorne Pull Request: https://github.com/freebsd/freebsd-src/pull/2022
* hwpmc: Fix PMC flags for AMD Zen coresAli Mashtizadeh2026-02-272-28/+84
| | | | | | | | | | | | | | | | | The PMC flags available for DF and L3 counters were not all implemented. More importantly, the field encodings for the L3 counters changed in an incompatible way between Family 17h and Family 19h. Similarly, the field encodings for the DF coutners changed between Family 19h and 1Ah. I also added the precise retire flag for the 3rd core counter. Lastly, I added a warning in the jevent parser because ignoring the unknown fields results in counters incorrectly programmed. We should not just ignore that. Sponsored by: Netflix Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2040
* dpaa2: improve error messages and log requested cluster sizeBjoern A. Zeeb2026-02-271-1/+2
| | | | | | | | | If m_getjcl() fails we want to know the size we requested in order to have a chance to evaluate the problem better. MFC after: 3 days Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D55555
* xen/acpi: implement hook to notify Xen about entering sleep stateRoger Pau Monné2026-02-273-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | This is required so that ACPI power-off (entering S5) works as expected, as the ACPI PM1a and PM1b blocks might not be accessible by dom0 directly. Additionally, Xen also needs to do cleanup before entering a sleep state, so it needs to be notified about it. With this patch FreeBSD dom0 now powers off the host correctly: acpi0: Powering system off... (XEN) [ 85.686598] arch/x86/hvm/emulate.c:415:d0v0 fixup p2m mapping for page fedc6 added (XEN) [ 85.687606] arch/x86/hvm/emulate.c:415:d0v0 fixup p2m mapping for page fbc10 added (XEN) [ 85.692357] Preparing system for ACPI S5 state. (XEN) [ 85.692702] Disabling non-boot CPUs ... (XEN) [ 85.694471] Broke affinity for IRQ9, new: {0-7} [...] (XEN) [ 85.903118] Entering ACPI S5 state. Should be a non-functional change when not running as a Xen dom0. Reviewed by: kib Sponsored by: Citrix Systems R&D MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D55504
* mwl: migrate to new net80211 encryption key APIAdrian Chadd2026-02-261-8/+18
| | | | | | | | | | | Migrate to the new encryption key API rather than poking at the key struct directly. Notably this driver was very clear about its expectation the net80211 key layout w/ key, TX MIC and RX MIC matches the firmware layout and just memcpy()'ed it. That has been refactored. Differential Revision: https://reviews.freebsd.org/D54484
* wpi: migrate to new net80211 encryption key APIAdrian Chadd2026-02-261-3/+6
| | | | | | | Migrate to the new encryption key API rather than poking at the key struct directly. Differential Revision: https://reviews.freebsd.org/D54482
* iwi: migrate to new net80211 encryption key APIAdrian Chadd2026-02-261-2/+3
| | | | | | | Migrate to the new encryption key API rather than poking at the key struct directly. Differential Revision: https://reviews.freebsd.org/D54481
* ipw: migrate to new net80211 encryption key APIAdrian Chadd2026-02-261-2/+3
| | | | | | | Migrate to the new encryption key API rather than poking at the key struct directly. Differential Revision: https://reviews.freebsd.org/D54480
* ath: migrate to new net80211 encryption key APIAdrian Chadd2026-02-261-9/+25
| | | | | | | Migrate to the new encryption key API rather than poking at the key struct directly. Differential Revision: https://reviews.freebsd.org/D54479
* mlx5: convert GET_TRUNK_IF() to functionKonstantin Belousov2026-02-251-15/+18
| | | | | | | Reviewed by: slavash Tested by: Wafa Hamzah <wafah@nvidia.com> Sponsored by: Nvidia networking MFC after: 1 week
* mlx5: report IPSEC offload capabilities whenever IPSEC_OFFLOAD is configuredKonstantin Belousov2026-02-253-5/+18
| | | | | | | | | | | | Do it always for bootverbose if offload was enabled in the kernel config, not only if the device actually supports all required capabilities to do the offload. Otherwise, having the code to print the caps is pointless. Reviewed by: slavash Tested by: Wafa Hamzah <wafah@nvidia.com> Sponsored by: NVidia networking MFC after: 1 week
* asmc: introduce the concept of generic modelsEnji Cooper2026-02-251-13/+67
| | | | | | | | | | | | | | | | | | | 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
* asmc: add Wake-on-LAN control via sysctlAbdelkader Boudih2026-02-252-0/+50
| | | | | | | | | | | | | | | | | 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
* chore: replace {0, 0} with {DEV,KOBJ}METHOD_ENDEnji Cooper2026-02-25186-207/+208
| | | | | | | | | | | | | | 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
* cxgbe tom: Use the same WRs as iSCSI to send PDUs for NVMeJohn Baldwin2026-02-251-99/+13
| | | | | | Reviewed by: np (earlier version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D55470
* acpi: Use __BUS_ACCESSOR_DEFAULT and __BUS_ACCESSOR for IVARsJohn Baldwin2026-02-241-25/+4
| | | | | | | | | | | - 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
* acpi: Split ACPI IVARs into global and private setsJohn Baldwin2026-02-242-3/+6
| | | | | | | | | | | | 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
* sdiob: Forward-declare struct sdio_funcJohn Baldwin2026-02-241-0/+2
| | | | | | | | | | 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
* acpi_panasonic: Clear wireless RF_KILL on boot and resumeAbdelkader Boudih2026-02-231-0/+36
| | | | | | | | | | | | | | On Panasonic FZ-Y1 and similar models, the EC latches RF_KILL on shutdown and suspend when battery is at certain level, causing wireless to boot with hard block. Call WLSW.SHRF during attach and resume to clear the block. Tested on Panasonic FZ-Y1 with Intel Wireless 7265. Reviewed by: adrian, obiwac Approved by: adrian, obiwac Differential Revision: https://reviews.freebsd.org/D55265
* arm: Add EARLY_PRINTF for ns8250 on arm/aarch64 platforms.Michal Meloun2026-02-221-3/+39
| | | | | Reviewed by: adrian (previous version) MFC after: 3 weeks
* rge: log silicon revision during attachChristos Longros2026-02-221-7/+7
| | | | | | | | | | | | | | | | | The initial import from OpenBSD contained chip revision printf() calls commented out, as OpenBSD's bare printf() style does not translate to FreeBSD's device_printf() idiom. The result is that users cannot distinguish RTL8125 from RTL8125B, RTL8125D_1, RTL8125D_2 etc. via dmesg alone, even though all variants show as '<RTL8125>' from the PCI probe string. Add proper device_printf() calls including the raw hwrev value, consistent with how re(4) reports chip revisions. Signed-off-by: Christos Longros <chris.longros@gmail.com> Reviewed by: zlei, imp, adrian Differential Revision: https://reviews.freebsd.org/D55402
* rge: correctly free busdma memory / zero things out only if allocatedJohn2026-02-221-15/+18
| | | | | | | | | | * Only free busdma memory that was allocated * Don't free tx/rx rings until their buffers have also been freed PR: kern/293307 Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D55420
* rge: fix callout setup/teardown; handle invalid ethernet addressJohn2026-02-221-5/+14
| | | | | | | | | | | | * Do the callout init early; since some of the teardown path expects the callout to be valid * Handle an invalid ethernet address by generating a local one. PR: kern/293307 Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D55419
* regulator_fixed: add support for 'gpios' propertyMichal Meloun2026-02-221-5/+12
| | | | | | This is a newer version of the "gpio" property. MFC after: 3 weeks
* pci_dw: improve pci_dwMichal Meloun2026-02-222-18/+63
| | | | | | | | Add support for 64-bit ranges. Process 'bus-range' property. Add some debug prints. MFC after: 3 weeks
* fdt,simple_mfd: Map memory as shareable.Michal Meloun2026-02-221-1/+1
| | | | | | It may be submapped in child drivers. MFC after: 3 weeks
* TCA64xx: Convert mutex to SX lock.Michal Meloun2026-02-221-13/+14
| | | | | | I2C devices are permitted to sleep during transfers. MFC after: 3 weeks
* OFW: Improve OFW_CPU.Michal Meloun2026-02-221-1/+10
| | | | | | | | Accept the assigned clock on the CPU node. Don't report a missing "clock-frequency" property if the CPU node has a "clocks" property. MFC after: 3 weeks
* HYM8563: Add support for clock output.Michal Meloun2026-02-221-25/+213
| | | | | | The RTC contains a configurable clock output. MFC after: 3 weeks
* rsu: migrate to new net80211 encryption key APIAdrian Chadd2026-02-221-7/+12
| | | | | | | Migrate to the new encryption key API rather than poking at the key struct directly. Differential Revision: https://reviews.freebsd.org/D54483
* asmc: resource cleanup simplificationsEnji Cooper2026-02-221-14/+19
| | | | | | | | | | This change makes `asmc_detach(..)` reentrant by setting freed resources to known invalid values when done, and makes `asmc_attach(..)` call `asmc_detach(..)` instead of attempting to the semi-equivalent way of cleaning up the driver resources allocated in `asmc_detach(..)`. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55413
* sound: Detect unsupported formatsChristos Margiolis2026-02-211-1/+15
| | | | | | | | | | | This way we can avoid edge-cases like 8af6aee96ed609456900c6dd92dafabac5e89c0a ("virtual_oss(8): Remove floating point formats from preference list"). Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D55403
* asmc: code style modernization and minor cleanupsEnji Cooper2026-02-211-59/+47
| | | | | | | | | | | | | - Allow `ASMC_DEBUG` to be treated as a variadic macro. - Add ellipses around `sizeof(..)` calls. - Reindent some of the lines to better follow style(9) with line wrapping. A number of other clang-format changes were not taken as they are not compatible with style(9). MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55394
* nvmf: Limit the default I/O queue size to 128 entriesJohn Baldwin2026-02-201-1/+2
| | | | | | | | Previously the size defaulted to the maximum supported size reported by the remote host. The value of 128 matches the default on Linux and avoids excessive resource usage for I/O queues. Sponsored by: Chelsio Communications
* chore: asmc: use designated initializers in macrosEnji Cooper2026-02-201-18/+33
| | | | | | | | | | | This code cleanup makes it easier for human readers to understand what each of the fields actually represents, as well as makes it easier to modify what the macros actually do under the covers, without introducing potential human errors. No functional change intended. MFC after: 1 week
* asmc: use symbolic names with the MacPro3,1 modelEnji Cooper2026-02-201-2/+2
| | | | | | | | | | | | Use `ASMC_LIGHT_FUNCS_DISABLED` and `ASMC_SMS_FUNCS_DISABLED` instead of the unrolled versions of the macros. This makes it easier to adjust the underlying macros/fields for `struct asmc_model`. No functional change intended. MFC after: 1 week
* asmc: use `ASMC_FAN_FUNCS2` with the Macmini4,1Enji Cooper2026-02-201-1/+1
| | | | | | | | | | | | | | | | | The Macmini4,1 model does not have "fansafespeed" support. This issue typically manifests with messages like so: ``` asmc0: asmc_key_read for key F0Sf failed 10 times, giving up ``` Swap out `ASMC_FAN_FUNCS` with `ASMC_FAN_FUNCS2` to explicitly drop "fansafespeed" checks in the driver for the model as it doesn't support that hardware feature. MFC after: 1 week Reported by: @probonopd Closes: https://github.com/helloSystem/ISO/issues/357
* vmm: Start using exterrorMark Johnston2026-02-191-1/+4
| | | | | | | | | | | For now, just describe the error where an unprivileged user attempts to run a VM without DESTROY_ON_CLOSE semantics, i.e., monitor mode. Reviewed by: bnovkov MFC after: 2 months Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54743
* vmm: Enable unprivileged bhyveMark Johnston2026-02-191-5/+5
| | | | | | | | | | | | | | - Add the vmm group. - Let /dev/vmmctl belong to the vmm group by default, and give group write permissions. - When creating a VM's device files, make them owned by the creating process' effective UID. Reviewed by: bnovkov MFC after: 2 months Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54741
* vmm: Add privilege checks to vmmctl operationsMark Johnston2026-02-191-0/+21
| | | | | | | | | | | | | | | | In preparation for supporting creation of VMs by unprivileged users, add some restrictions: - Disallow creation of non-transient VMs by unprivileged users. That is, if an unprivileged user creates a VM, the VM must be destroyed automatically once the last fd referencing it is gone. - Disallow destroying VMs created by a different user, unless the caller has the PRIV_VMM_DESTROY privilege. Reviewed by: bnovkov MFC after: 2 months Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54740
* iommu_gas: Fix assertion.Ruslan Bukin2026-02-191-1/+1
| | | | | | | | placeholder entry end changed to 0 in f591287756368 ("iommu_gas: make placeholder entry at the start of the GAS zero size") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D55326
* acpi: Factor out the power off code into acpi_poweroff()Olivier Certner2026-02-191-19/+28
| | | | | | | | | | | | | | While here, make it print that we are trying to power off upfront, not really treating differently power off preparation via acpi_EnterSleepStatePrep() and actual power off via AcpiEnterSleepState(), which the user does not care about. While here, capitalize the messages. Reviewed by: obiwac MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55226
* acpi: Factor out message printing on failure of AcpiEnterSleepStatePrep()Olivier Certner2026-02-191-7/+21
| | | | | | | | | | | | | | To this end, create a small wrapper, acpi_EnterSleepStatePrep(), which itself prints the failure message. While here, when trying to power down (acpi_shutdown_final()), and AcpiEnterSleepStatePrep() failed, print an additional message more explicit about the power down request having failed. Reviewed by: obiwac MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55225
* nvme: Fix sim unit number to match nvme deviceWarner Losh2026-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The CAM sim unit numbner should match the nvme device number. We need this to match unit numbers in some wiring scenarios. For example: hint.nvme.0.at="UEFI:PciRoot(0x3)/Pci(0x1,0x1)/Pci(0x0,0x0)" hint.nvme.1.at="UEFI:PciRoot(0x3)/Pci(0x1,0x2)/Pci(0x0,0x0)" hint.nvme.2.at="UEFI:PciRoot(0x3)/Pci(0x1,0x3)/Pci(0x0,0x0)" hint.nvme.3.at="UEFI:PciRoot(0x3)/Pci(0x1,0x4)/Pci(0x0,0x0)" hint.scbus.33.at="nvme0" hint.nda.0.at="scbus33" hint.scbus.34.at="nvme1" hint.nda.1.at="scbus34" hint.scbus.35.at="nvme2" hint.nda.2.at="scbus35" hint.scbus.36.at="nvme3" hint.nda.3.at="scbus36" If the devices that are nvme0 and nvme3 are the only ones populated, you still want them associated with nda0 and nda3. The nvme_sim device changes meant we were passing the wrong device's unit number to cam_sim_alloc. This fixes the problem. Sponsored by: Netflix
* nvme: fix panic if we boot w/o a namespaceWarner Losh2026-02-181-0/+10
| | | | | | | | | | | | If we format a drive, and then crash, we'll come back up. nvme_sim_ns device won't attach because we don't have a namespace. Some drives (all? I couldn't find it in the standard) send an AER with a namespace change, which causes a NULL dereference because s_sim wasn't initialized because we didn't attach. So, if we get into the ns_changed routine, bail early if we didn't attach. We'll attach later, and deal with the ns correctly if it's really there, or not attach one if it's not. Sponsored by: Netflix
* pcib: Assume a window where both the base and limit are 0 is uninitializedJohn Baldwin2026-02-181-0/+18
| | | | | | | | | | | | | | Since the low bits of a window's limit are hardwired to 1, this configuration looks like a minimally sized window at address 0. However, PCI resources are not generally at address 0 (see the __PCI_BAR_ZERO_VALID macro that was only defined on sparc64), and some PCI-PCI bridges report these register values after a reset. The result today is a lot of spam in dmesg as the minimally-sized windows fail to allocate. By ignoring these windows and treating them as closed the end result is the same, but there is less spam during boot. Reported by: jrtc27 Differential Revision: https://reviews.freebsd.org/D43922
* bus: Drop a couple of unused IVAR indicesJohn Baldwin2026-02-171-1/+0
| | | | | | | This changes the in-kernel ABI, but that is permitted across major versions and is cleaner than leaving these around forever. Differential Revision: https://reviews.freebsd.org/D54160