aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* /dev/pci: clarify meaning of writeable file descriptorHEADmainKonstantin Belousov3 hours1-1/+6
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31317
* vlan: deduplicate bpf_setpcp() and pf_ieee8021q_setpcp()Kristof Provost15 hours4-46/+30
| | | | | | | | | | These two fuctions were identical, so move them into the common vlan_set_pcp() function, exposed in the if_vlan_var.h header. Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31275
* bpf: Add an ioctl to set the VLAN Priority on packets sent by bpfLuiz Otavio O Souza15 hours3-0/+45
| | | | | | | | | | This allows the use of VLAN PCP in dhclient, which is required for certain ISPs (such as Orange.fr). Reviewed by: bcr (man page) MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31263
* m_dup: Handle unmapped mbufs as an input mbuf.John Baldwin15 hours1-1/+1
| | | | | | | | | | Use m_copydata() instead of a direct bcopy() when copying data out of a source mbuf into a newly-allocated mbuf. PR: 256610 Reported by: Niels Bakker <niels=freebsd@bakker.net> Reviewed by: markj MFC after: 2 weeks
* crypto: Constify all transform descriptorsMark Johnston16 hours33-131/+132
| | | | | | | | | No functional change intended. Reviewed by: ae, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31196
* rip: Add missing minimum length validation in rip_output()Mark Johnston16 hours1-1/+8
| | | | | | | | | | | If the socket is configured such that the sender is expected to supply the IP header, then we need to verify that it actually did so. Reported by: syzkaller+KMSAN Reviewed by: donner MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31302
* linux(4): Fix amd64 gcc build.Dmitry Chagin17 hours2-4/+6
| | | | | | | | Do not specify memory model and mregparm for amd64, it's only available on IA-32 architecture. Reported by: jhb, jrtc27 MFC after: 2 weeks
* linux(4): Fix i386 gcc build.Dmitry Chagin18 hours1-3/+3
| | | | | | | | Do not specify memory model for i386. Seems that clang silencly ignores -mcmodel unlike gcc. Reported by: jhb MFC after: 2 weeks
* hwpmc: fix powerpc/powerpcspe buildsLeandro Lupori20 hours1-1/+1
| | | | Fix 32-bit PowerPC build errors introduced by b48a2770d48b.
* powerpc64: add Power8 and Power9 PMCsLeandro Lupori23 hours3-4/+59
| | | | | | | | | Add support to allocate Power8 and 9 PMCs. Submitted by: Leonardo Bianconi <leonardo.bianconi@eldorado.org.br> Reviewed by: mhorne Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D31109
* pf: remove duplicate ERROUT_FUNCTION definitionKristof Provost26 hours1-8/+0
| | | | Sponsored by: Modirum MDPay
* linux: fix sigaltstack on amd64Edward Tomasz Napierala25 hours1-3/+3
| | | | | | | | | | | | | To determine whether to use alternate signal stack or not, we need to use the native signal number, not the one translated with bsd_to_linux_signal(). In practical terms, this fixes golang. Reviewed By: dchagin Fixes: 135dd0cab51 Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D31298
* linux: implement signal delivery on arm64Edward Tomasz Napierala2 days3-6/+106
| | | | | | | | | Note that this still uses FreeBSD-style sigframe; this will be addressed later. Reviewed By: dchagin Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D31258
* arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries.Peter Grehan2 days5-0/+471
| | | | | | | | | | | | This fixes build/run of golang under COMPAT32 emulation. PR: 256897 Reviewed by: andrew, mmel, manu, jhb, cognet, Robert Clausecker Tested by: brd, andrew, Robert Clausecker MFC after: 3 weeks Relnotes: yes Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31175
* pf: batch critical section for several countersMateusz Guzik2 days3-31/+47
| | | | | Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: switch rule counters to pf_counter_u64Mateusz Guzik2 days7-81/+185
| | | | | Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: switch kif counters to pf_counter_u64Mateusz Guzik2 days4-21/+126
| | | | | Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: switch pf_status.fcounters to pf_counter_u64Mateusz Guzik2 days3-10/+26
| | | | | Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: add hybrid 32- an 64- bit countersMateusz Guzik2 days2-1/+245
| | | | | | | | | | | Numerous counters got migrated from straight uint64_t to the counter(9) API. Unfortunately the implementation comes with a significiant performance hit on some platforms and cannot be easily fixed. Work around the problem by implementing a pf-specific variant. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: drop redundant 'else' in pf_normalize_*Mateusz Guzik2 days1-12/+9
| | | | | Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* arm64: allwinner: dtbo: Add dtb overlays to disable mmc nodeEmmanuel Vadot3 days4-1/+34
| | | | | This is useful for development. Sponsored by: Diablotin Systems
* FFS: remove ffs_fsfail_taskJason A. Harmening3 days2-45/+7
| | | | | | | | | | | Now that dounmount() supports a dedicated taskqueue, we can simply call it with MNT_DEFERRED directly from the failing context. This also avoids blocking taskqueue_thread with a potentially-expensive unmount operation. Reviewed by: kib, mckusick Tested by: pho Differential Revision: https://reviews.freebsd.org/D31016
* VFS: remove MNTK_MARKERJason A. Harmening3 days2-33/+2
| | | | | | | | | | | | | We no longer allow upper filesystems to be unregistered from the base mount while vfs_notify_upper() or any other upper operation is pending. New upper mounts can still be registered during this period, but they will be added at the end of the upper mount tailq. We therefore no longer need to allocate marker nodes during vfs_notify_upper() to keep our place in the iteration. Reviewed by: kib, mckusick Tested by: pho Differential Revision: https://reviews.freebsd.org/D31016
* Allow stacked filesystems to be recursively unmountedJason A. Harmening3 days8-88/+348
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In certain emergency cases such as media failure or removal, UFS will initiate a forced unmount in order to prevent dirty buffers from accumulating against the no-longer-usable filesystem. The presence of a stacked filesystem such as nullfs or unionfs above the UFS mount will prevent this forced unmount from succeeding. This change addreses the situation by allowing stacked filesystems to be recursively unmounted on a taskqueue thread when the MNT_RECURSE flag is specified to dounmount(). This call will block until all upper mounts have been removed unless the caller specifies the MNT_DEFERRED flag to indicate the base filesystem should also be unmounted from the taskqueue. To achieve this, the recently-added vfs_pin_from_vp()/vfs_unpin() KPIs have been combined with the existing 'mnt_uppers' list used by nullfs and renamed to vfs_register_upper_from_vp()/vfs_unregister_upper(). The format of the mnt_uppers list has also been changed to accommodate filesystems such as unionfs in which a given mount may be stacked atop more than one lower mount. Additionally, management of lower FS reclaim/unlink notifications has been split into a separate list managed by a separate set of KPIs, as registration of an upper FS no longer implies interest in these notifications. Reviewed by: kib, mckusick Tested by: pho Differential Revision: https://reviews.freebsd.org/D31016
* amd64: Don't repeat unnecessary tests when cmpset failsAlan Cox3 days1-4/+4
| | | | | | | | | When a cmpset for removing the PG_RW bit in pmap_promote_pde() fails, there is no need to repeat the alignment, PG_A, and PG_V tests just to reload the PTE's value. The only bit that we need be concerned with at this point is PG_M. Use fcmpset instead. MFC after: 1 week
* arm64: allwinner: Remove sun50i-a64-oppEmmanuel Vadot3 days2-79/+1
| | | | | | This is unneeded now that the DTS have the opp. MFC after: 1 week Sponsored by: Diablotin Systems
* amd64: do not touch low memory in AP startup unless we used legacy bootKonstantin Belousov3 days1-3/+6
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121
* amd64: make efi_boot globalKonstantin Belousov3 days2-1/+4
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121
* amd64: add pmap_alloc_page_below_4g()Konstantin Belousov3 days2-30/+20
| | | | | | | Suggested and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121
* amd64 pti init: fix calculation of the kernel text startKonstantin Belousov3 days1-1/+1
| | | | | | | | | | | | Old expression happens to provide the correct answer, but assumes that kernel is loaded at physical address zero, with 2M gap. Do not use kernphys to calculate KVA of kernel text start, just explicitly write out KERNBASE and the hole size. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121
* allwinner: rsb: Set the PMIC to RSB modeEmmanuel Vadot3 days1-0/+11
| | | | | | | | | | With recent ATF (v2.5) the PMIC is reset to I2C mode. Without a PMIC no regulators can be changed/enabled/disabled This fixes cpufreq on A64 (at least) and anything else that needs regulators handled by the PMIC. MFC after: 3 days Sponsored by: Diablotin Systems
* devctl: don't publish the mount optionsWarner Losh3 days1-24/+7
| | | | | | | | | | | | Mount options aren't solely ASCII strings. In addition, experience to date suggests that the mount options are much less useful than was originally supposed and the mount flags suffice to make decisions. Drop the reporting of options for the mount/remount/unmount events. Reviewed by: markj Reported by: KASAN Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31287
* linux: implement rt_sigsuspend(2) on arm64Edward Tomasz Napierala4 days5-67/+18
| | | | | | | | ... by making it architecture-independent. Reviewed By: dchagin Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D31259
* amd64: Eliminate a redundant test from pmap_enter_object()Alan Cox3 days1-1/+0
| | | | | | | | | | | | The call to pmap_allow_2m_x_page() in pmap_enter_object() is redundant. Specifically, even without the call to pmap_allow_2m_x_page() in pmap_enter_object(), pmap_allow_2m_x_page() is eventually called by pmap_enter_pde(), so the outcome will be the same. Essentially, calling pmap_allow_2m_x_page() in pmap_enter_object() amounts to "optimizing" for the unexpected case. Reviewed by: kib MFC after: 1 week
* geom_disk: use a preallocated geom_event for disk destruction.Warner Losh4 days2-1/+5
| | | | | | | | | | | | | | | | | Preallocate a geom_event (using the new geom_alloc_event) when we create a disk. When we create the disk, we're going to be in a sleepable context, so we can always allocate this extra bit of memory. Then use this preallocated memory to free the disk. CAM can try to free the disk from an unsleepable context if there was I/O outstanding when the disk was destroyted (say because the SIM said it had gone away). The I/O context isn't sleepable. Rather than trying to invent a retry mechanism and making sure all the other geom_disk consumers did it properly, preallocating the event ensure that the geom_disk will be properly torn down, even when there's memory pressure when the disk departs. Reviewd by: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30544
* geom: create an API to allocate events, and use that storage to send themWarner Losh4 days2-12/+43
| | | | | | | | | | | | | g_alloc_event will allocate storage for an opaque event. g_post_event_ep can use memory returned by g_alloc_event to send an event from a context that might not be able to allocate the event. Occasionally, we can alloate memory when we create an object, but not while we're destroy it. This allows one to allocate at creation time memory to use when destorying the object. Reviewed by: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30544
* ena: Remove redundant declaration of ena_log_level.John Baldwin4 days1-2/+0
| | | | | | | GCC6 raises a -Wredundant-decl error due to duplicate declarations in ena_fbsd_log.h and ena_plat.h. Sponsored by: Chelsio Communications
* Use an ANSI C function declaration for journal_check_space.John Baldwin4 days1-2/+1
| | | | | | GCC6 fails to compile this due to a -Wstrict-prototypes error. Sponsored by: Chelsio Communications
* imgact_elf: Avoid redefining suword()Mark Johnston4 days1-2/+2
| | | | | | | | Otherwise this interferes with the definition for sanitizer interceptors. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* pf: consistently malloc rules with M_ZEROMateusz Guzik4 days1-2/+2
| | | | | Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: hide struct pf_kstatus behind ifdef _KERNELMateusz Guzik4 days1-0/+2
| | | | | Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
* vfs: Initialize "lastfail" in vfs_mountroot_wait()Mark Johnston4 days1-0/+1
| | | | | | | | | This variable is only used to rate-limit "Root mount waiting for: ..." messages using ppsratecheck(). Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation
* KASAN: Disable checking before triggering a panicMark Johnston4 days1-0/+1
| | | | | | | | | KASAN hooks will not generate reports if panicstr != NULL, but then there is a window after the initial panic() call where another report may be raised. This can happen if a false positive occurs; to simplify debugging of such problems, avoid recursing. Sponsored by: The FreeBSD Foundation
* Add required sysctl name length checks to various handlersMark Johnston4 days3-2/+39
| | | | | | Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation
* select: Define select_flags[] as constMark Johnston4 days1-1/+1
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* redzone: Raise a compile error if KASAN is configuredMark Johnston4 days1-0/+4
| | | | | | | | | | | redzone(9) does some munging of the allocation to insert redzones before and after a valid memory buffer, but KASAN does not know about this and will raise false positives if both are configured. Until this is fixed, do not allow both to be configured. Note that KASAN provides similar checking on its own but currently does not force the creation of redzones for all UMA allocations; this should be addressed as well. Sponsored by: The FreeBSD Foundation
* Annotate amd64 stack unwinders with __nomemorysanitizeMark Johnston4 days3-3/+3
| | | | Sponsored by: The FreeBSD Foundation
* cdefs: Add a default definition for __nosanitizememoryMark Johnston4 days1-0/+1
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* acct: Zero pad bytes in accounting recordsMark Johnston4 days1-0/+2
| | | | | | Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation
* ktrace: Zero request structures when populating the poolMark Johnston4 days1-2/+3
| | | | | | | | | Otherwise uninitialized pad bytes may be copied into the ktrace log file. Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation