aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
...
* acpi_spmc: Register SPMC suspend/resume routinesAymeric Wibo3 days1-14/+31
| | | | | | | | | | | SPMC suspend runs after the device tree is suspended using the acpi_post_dev_suspend eventhandler, and SPMC resume runs before the device tree is resumed using the acpi_pre_dev_suspend eventhandler. Reviewed by: olce Approved by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48735
* acpi: Post/pre device suspend/resume eventhandlersAymeric Wibo3 days2-1/+5
| | | | | | | | | | | These eventhandlers are called after suspending the device tree and before resuming it. This is useful for PMC (power management controller) drivers. Reviewed by: olce Approved by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48735
* sym(4): Map HCB memory as uncacheable also on x86Marius Strobl3 days1-27/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of making the chip-specific mix and match of different accesses (DMA/bus space) work as desired, the intent is to map the HCB memory as uncacheable. Prior to VM_MEMATTR_*, the !x86 way of indicating this to bus_dmamem_alloc(9) was BUS_DMA_COHERENT. Then later on in 2db99100a4, BUS_DMA_NOCACHE was hooked up to VM_MEMATTR_UNCACHEABLE for x86. As it turns out, still as of today bus_dmamem_alloc(9) differs in this regard across architectures. On arm, it still supports BUS_DMA_COHERENT only for requesting uncacheable DMA and x86 still uses BUS_DMA_NOCACHE only. On arm64 and riscv, BUS_DMA_COHERENT seems to effectively be an alias for BUS_DMA_NOCACHE. Thus, allocate the HCB memory with BUS_DMA_COHERENT | BUS_DMA_NOCACHE, so we get uncacheable memory on all architectures including x86 and so loads and stores from/to HCB won't get reordered. However, even on x86 we still need to use at least compiler barriers to achieve the desired program order. This change should also fix panics due to out-of-sync data seen with FreeBSD VMs on top of OpenStack and HBAs of type lsiLogic as a result of loads and stores getting reordered. [1] While at it: - Nuke the unused SYM_DRIVER_NAME macro. - Remove unused/redundant HCB members and correct a comment typo. PR: 270816 [1] MFC after: 3 days
* Revert "sym(4): Employ memory barriers also on x86"Marius Strobl3 days1-15/+27
| | | | | | The problem will be avoided in a different way. This reverts commit e769bc77184312b6137a9b180c97b87c0760b849.
* devfs: unlock the directory vnode around the call to dev_clone handlerKonstantin Belousov4 days1-0/+20
| | | | | | | | | | | | | | | | The lock around dev_clone is unfortunate because cloner might need to take its own locks that establish the order with devfs vnodes, and then transiently participates in further VFS locks order. For instance, this way the proctree_lock or allproc_lock become involved. Unlock dvp, we can unwind if the vnode become doomed while cloner was called. Reported and tested by: pho Reviewed by: kevans, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55028
* i386: Fix build and remove empty unused macroJessica Clarke4 days1-3/+1
| | | | | | | | | | When inlining the macro, reg was not substituted with the %ecx argument previously passed in. One of the definitions was also left behind as an empty macro. PR: 292883 Fixes: 377c053a43f3 ("cpu_switch(): unconditionally wait on the blocked mutex transient") MFC after: 1 week
* sdt: Use the "cc" operand modifier for the address of probes for GCC 15+John Baldwin4 days1-0/+4
| | | | | | | | | | | This is required for GCC on RISC-V. The GCC 15 docs claim that "cc" is similar to "c" except that it "tries harder". NB: I have not yet found a way to make the DTrace probes compile on RISC-V with older versions of GCC. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54964
* smartpqi: Update to vendor version 14.4690.0.2008 - 15.2.0.2008John Hall4 days16-19/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update to versions: FreeBSD14 14.4690.2008 FreeBSD15 15.2.0.2008 Included in this update are: - Support for new controllers - Add code that utilizes the new BIG_IOCTL_Command_struct and allows the I/O buffer size for a single passthrough ioctl to be stored as a 32 bit integer instead of the original 16 bit integer. - Update occurrences of Microsemi to Microchip - Some format changes including converting comments from C++ to C style, remove instances of /* $FreeBSD$ */, and updating copyright dates. Update to versions: FreeBSD14 14.4690.2008 FreeBSD15 15.2.0.2008 Included in this update are: - Support for new controllers _ Add code that utilizes the new BIG_IOCTL_Command_struct and allows the I/O buffer size for a single passthrough ioctl to be stored as a 32 bit integer instead of the original 16 bit integer. - Update occurrences of Microsemi to Microchip - Some format changes including converting comments from C++ to C style, remove instances of /* $FreeBSD$ */, and updating copyright dates. Reviewed by: imp Approved by: imp MFC after: 1 week Sponsored by: Microchip Technology Inc. Differential Revision: https://reviews.freebsd.org/D54787
* ip6_mroute: Remove an unhelpful commentMark Johnston4 days1-4/+0
| | | | | | | | | | ifnets already track if_allmulti() calls in the if_amcount field. That field is older than the comment, so I'm not exactly sure what the intent was; let's just remove it. MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc.
* ip6_mroute: Remove an unused constantMark Johnston4 days1-2/+0
| | | | | | | | No functional change intended. MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc.
* ip6_mroute: Fix the UPCALL_TIMING buildMark Johnston4 days1-1/+1
| | | | | | MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc.
* ip6_mroute: Make MF6CFIND a regular functionMark Johnston4 days1-25/+20
| | | | | | | | | | | This is more natural and corresponds more closely to the v4 multicast routing code. No functional change intended. Reviewed by: glebius MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54983
* ip_mroute: Make privilege checking more consistentMark Johnston4 days3-11/+15
| | | | | | | | | | | | | | | | | | | | | - The v6 socket option and ioctl handlers had no privilege checks at all. The socket options, I believe, can only be reached via a raw socket, but a jailed root user with a raw socket shouldn't be able to configure multicast routing in a non-VNET jail. The ioctls can only be used to fetch stats. - Delete a bogus comment in X_mrt_ioctl(), one can issue multicast routing ioctls against any socket. Note that the call path is soo_ioctl()->rtioctl_fib()->mrt_ioctl(). I think all of the mroute privilege checks should be done within the ip(6)_mroute code, but let's first make the v4 and v6 modules consistent. Reviewed by: glebius MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54982
* e1000: Fix setting the promiscuous modeZhenlei Huang4 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | The variable reg_rctl stores the value read from reg E1000_RCTL. It may contain bits E1000_RCTL_VFE and E1000_RCTL_CFIEN which control VLAN hardware filter feature. The promiscuous mode implies all tagged or untagged packets should be accepted, so the VLAN hardware filter feature should be disabled when enabling the promiscuous mode. Calling em_if_vlan_filter_disable() did the task, but later writing the value of reg_rctl back to the reg E1000_RCTL may restore the feature. Move the calling of em_if_vlan_filter_disable() after writing the reg to fix that. PR: 292759 Reviewed by: kbowling Tested by: vova@zote.me Fixes: 2796f7cab107 e1000: Fix up HW vlan ops MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54973
* hwpmc_amd: Add support for additional counters.Ali Mashtizadeh4 days2-106/+137
| | | | | | | | | | | Rather than provide a static table of counters, this change computes the number of counters that are available by checking several CPUID leafs and falling back to defaults on older processors. The limits are set to support the maximum number of counters of each type. Sponsored by: Netflix Reviewed by: imp, mhorne Pull Request: https://github.com/freebsd/freebsd-src/pull/1983
* ig4: Add support for Lunar Lake-M I2CDefenso-EBO4 days1-0/+8
| | | | | | | | | | | | | | | | | this patch adds PCI IDs to the ig4(4) driver: - Lunar Lake-M (0xa878, 0xa879, 0xa87a, 0xa87b) These controllers use the Tiger Lake hardware revision of the I2C IP. Adding these IDs enables support for peripherals connected to the I2C Bus. Tested on: Intel Lunar Lake (LENOVO_MT_21QX_BU_Think_FM_ThinkPad T14s Gen 6) Signed-off-by: Defenso-EBO <etienne.bonnand@defenso.fr> MFC after: 2 weeks Sponsored by: Defenso Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1995
* ice(4): Handle allmulti flag in ice_if_promisc_set functionYogesh Bhosale5 days1-5/+20
| | | | | | | | | | | | | In the ice_if_promisc_set function, the driver currently disables the IFF_ALLMULTI flag, thereby preventing the activation of multicast mode. To address this issue, implement appropriate handling to ensure the flag is managed correctly. Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com> Tested by: Gowthamkumar K S <gowtham.kumar.ks@intel.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54186
* OpenSSL: commit sys/crypto changes for 3.5.5Enji Cooper5 days5-3889/+2850
| | | | | | | | | | These files were changed as part of the 3.5.4 -> 3.5.5 upgrade. Please see the upstream release notes linked in 1731fc70f7344af08db49b06c63c963fa12ee354, et al, for more details. MFC after: 6 days MFC with: 1731fc70f7344af08db49b06c63c963fa12ee354 Fixes: 1731fc70f7344af08d ("OpenSSL: update vendor sources to match 3.5.5 content")
* arm: Implement kernel ifuncMichal Meloun5 days6-11/+34
| | | | | | | | Add kernel ifunc support on arm. MFC after : 3 weeks Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D54970
* sctp: fix socket type created by sctp_peeloff()Michael Tuexen6 days1-2/+4
| | | | | | | | | When calling sctp_peeloff() on a SOCK_SEQPACKET socket, the created and returned socket has the type SOCK_STREAM. This is specified in section 9.2 of RFC 6458. Reported by: Xin Long MFC after: 3 days
* riscv: Add ffs.c and ffsdi2.cJohn Baldwin6 days1-0/+2
| | | | | | | | These are only needed for GCC, but it doesn't hurt to include these always. Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D54968
* libkern: Add libcalls for ffs and __ffsdi2John Baldwin6 days3-0/+95
| | | | | | | | | | | | These are needed when compiling a RISC-V kernel with GCC which does not inline __builtin_ffs*. The __ffsdi2 is adapated from the previous ffsl.c. This partially reverts commit f4db342d44198973c1c7b9005d0c5683a582707e. Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D54967
* riscv: Enable the zifencei extension explicitly in -marchJohn Baldwin6 days1-1/+1
| | | | | | | | clang is more tolerant and implies this extension whereas GCC is stricter and requires it to be included. Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D54965
* cpufreq(4): Fix a typo in a source code commentGordon Bergling6 days1-1/+1
| | | | | | - s/transcation/transaction/ MFC after: 5 days
* ath_hal(4): Fix a typo in a source code commentGordon Bergling6 days1-1/+1
| | | | | | - s/arithmatic/arithmetic/ MFC after: 5 days
* ure: improve checksum offloadingMichael Tuexen6 days1-0/+3
| | | | | | | | | | | | | | | | | | This patch fixes three issues: (1) Initially, set the hwassist flags correctly when enabling transmit checksum offload for TCP/IPv6 and UDP/IPv6. (2) Keep the hwassist flags in sync with the capabilities when changing txcsum. (3) Keep the hwasssit flags in sync with the capabilities when changing txcsum6. Without this patch, transmit checksum offloading for TCP/IPv6 and UDP/IPv6 is never used and transmit checksum offloading for IPv4, TCP/IPv4 and UDP/IPv4 is always used, even if disabled via ifconfig ue? -txcsum. Reviewed by: Timo Völker MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54974
* ip6_mroute: Remove unnecessary castsMark Johnston6 days1-4/+3
| | | | | | | | No functional change intended. MFC after: 1 week Sponsored by: Stormshield Sponsored by: Klara, Inc.
* ktrcsw(): should not be called when the thread is owning interlock or on sleepqKonstantin Belousov7 days3-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is that for ktrcsw() we lock the ktrace_mtx mutex while owning the interlock from a subsystem that called msleep(). In particular, the VM subsystem might call msleep() if page allocation failed. This establishes order VM locks (e.g. domain free queue lock) -> ktrace_mtx. Calling free() while owning ktrace_mtx gives the reverse order. Worse, msleep_spin_sbt() call s ktrcsw() while the thread is put on sleep queue. Then, since the mutex might be contested, the thread needs to be put on turnstil, which cannot work. Move the ktrcsw() call for switch-out after the wakeup, when the thread does not yet re-obtained any locks. From there, we call a special version of ktrcsw(), which is passed the actual time when the context switch occured. The drawback is that the switch-out record is only written in the ktrace.out file after the switch-in occurred, but this is probably not too serious. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* arm64: Fix kernel panic in get_arm64_sve during core dumpAndy Carrel7 days1-3/+3
| | | | | | | | | | | | | | | | The coredump logic calls get_arm64_sve twice: once to get the note size, and once to get the data. The note size calculation depended on the volatile `PCB_FP_SVEVALID` flag. If this flag was cleared between the two calls (e.g., due to a context switch clearing the flag to comply with the ABI), the second call would expect a smaller buffer size than the first, triggering a KASSERT panic ("invalid size"). Fix this by ensuring the SVE state is saved to the PCB before we decide whether to use SVE or VFP. PR: 292195 Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D54532
* ip6_mroute: Mark functions as staticMark Johnston7 days1-10/+10
| | | | | | | | No functional change intended. MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc.
* epair: add VLAN_HWTAGGINGTimo Völker7 days1-12/+16
| | | | | | | | | | | | | | | | | | | | | | Add capability VLAN_HWTAGGING to the epair interface and enable it by default. When sending a packet over a VLAN interface that uses an epair interface, the flag M_VLANTAG and the ether_vtag (which contains the VLAN ID and/or PCP) are set in the mbuf to inform the hardware that the VLAN header has to be added. The sending epair end does not need to actually add a VLAN header. It can just pass the mbuf with this setting to the other epair end, which receives the packet. The receiving epair end can just pass the mbuf with this setting to the upper layer. Due to this setting, the upper layer believes that there was a VLAN header that has been removed by the interface. If the packet later leaves the host, the outgoing physical interface can add the VLAN header in hardware if it supports VLAN_HWTAGGING. If not, the implementation of Ethernet or bridge adds the VLAN header in software. Reviewed by: zlei, tuexen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52465
* dpaa2: add support for several interface countersMichael Tuexen7 days1-0/+14
| | | | | | | | | | | | Add support for IFCOUNTER_IPACKETS, IFCOUNTER_OPACKETS, IFCOUNTER_OBYTES, IFCOUNTER_OMCASTS, IFCOUNTER_OERRORS, and IFCOUNTER_OQDROPS. This allows tools like systat to report the incoming and outgoing bandwidth. Reviewed by: dsl, Timo Völker MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54893
* powerpc: explicitly cast the timebase printfsAdrian Chadd7 days1-8/+8
| | | | This is causing compilation issues on powerpc:powerpc GENERIC.
* firmware: Fix inverted FIRMWARE_GET_NOWARN logicAbdelkader Boudih7 days1-1/+1
| | | | | | | | | | | | The try_binary_file() function has inverted logic for the FIRMWARE_GET_NOWARN flag. When the flag is set (meaning "don't warn"), the code sets warn=true and makes noise anyway. Invert the assignment to warn to correctly suppress warnings when FIRMWARE_GET_NOWARN is set. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D54955
* SCHED_4BSD: maybe_resched() cannot schedule ast() for curthreadKonstantin Belousov7 days4-3/+23
| | | | | | | | | | | | | | | | | | | | | maybe_resched() needs to schedule TDA_SCHED for curthread, but this requires taking curthread lock while owning some other thread lock. To avoid introducing the order: - Use a scheduler-private TDP flag. - Register an unconditional TDA_SCHED_PRIV for 4BSD. When an AST needs to be scheduled, i.e. the current thread must do context switch in the return to userspace path, set the flag. Then the ast handler calls ast_scheduler(), which gives the same effect as scheduling TDA_AST. The overhead is a single function call on each userspace return, for 4BSD case. Reported and tested by: pho (previous version) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54945
* lindebugfs: check that name is set as otherwise pfs_alloc_node_flags() panicsBjoern A. Zeeb8 days1-0/+3
| | | | | | | | | | | | | | | | | | | | | | I have hit the case multiple times that some LinuxKPI field may not be set during driver bringup and lindebugfs would cause a panic. The backtrace goes like: strlen() at strlen+0x54 pfs_create_dir() at pfs_create_dir+0x41 debugfs_create_dir() at debugfs_create_dir+0xa1 ... While the problem is clearly in LinuxKPI or the driver, we likely should at least add an assert to pfs_create_dir() if name is NULL like we have for pfs_add_node() but for lindebugfs at least make this a graceful error and continue without creating the dir instead of panicing. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D54944
* kern/sched: deduplicate dtrace hook varsKonstantin Belousov8 days4-12/+12
| | | | | | | Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* kern/sched: deduplicate sdt probesKonstantin Belousov8 days4-36/+29
| | | | | | | Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* kern/sched: move duplicate preemption stat vars into sched_shim.cKonstantin Belousov8 days4-8/+8
| | | | | | | Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* sys: enable both SCHED_ULE and SCHED_4BSD for some configsKonstantin Belousov8 days2-1/+2
| | | | | | | | | | | Globally enable both schedulers for LINT. Enable both schedulers for GENERIC on amd64. Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* sched_shim: restore kern.ccpu sysctlKonstantin Belousov8 days2-4/+10
| | | | | | | | | | | | | It is apparently should be considered part of the ABI, and is used by the base top(1). But do not declare the ccpu variable in headers, it is needed only by 4bsd. So put the variable definition into sched_shim.c to make the kernel buildable without SCHED_4BSD. Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* sysctl kern.sched.ule.topology_spec: allow to run if ULE is not initializedKonstantin Belousov8 days1-1/+2
| | | | | | | | Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* net/iflib.c: move out scheduler-depended code into the hookKonstantin Belousov8 days5-79/+87
| | | | | | | | | | | | Add sched_find_l2_neighbor(). This really should be not scheduler-depended, in does not have anything to do with scheduler at all. But for now keep the same code structure. Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* x86/cpu_machdep.c: unconditionally fenceKonstantin Belousov8 days1-3/+0
| | | | | | | | | | For !SCHED_ULE, even if the fence is not needed, it is harmless. Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* x86/local_apic.c: remove direct SCHED_ULE useKonstantin Belousov8 days5-14/+34
| | | | | | | | | | | | Move the code to decide on the timer accounting into the scheduler hook. Since there were no inclusion of opt_sched.h, it is probably done unconditionally anyway. Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* cpu_switch(): unconditionally wait on the blocked mutex transientKonstantin Belousov8 days7-37/+18
| | | | | | | | | | It is nop for 4BSD. Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* kern/sched_shim.c: Add sysctl kern.sched.availableKonstantin Belousov8 days1-0/+31
| | | | | | | | | | Reports all compiled-in schedulers. Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* sys: Move 4BSD sysctls under kern.sched.4bsdKonstantin Belousov8 days1-13/+17
| | | | | | | | Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* sys: Make sched_4bsd a sched instanceKonstantin Belousov8 days1-101/+144
| | | | | | | | Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* sys: Move ULE sysctls under kern.sched.uleKonstantin Belousov8 days1-28/+32
| | | | | | | | Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831