ofed/libibverbs: remove strdupa() hack from config.h
It is now provided by regular string.h. While there, remove stale
$FreeBSD$ svn tag, and add include guards.
Sponsored by: NVidia networking
MFC after: 1 week
libc/string: put source files list one item per line
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54066
vm_fault: only rely on PG_ZERO when the page was newly allocated
If the fs->m page was found invalid on the object queue, PG_ZERO flag is
stale. Track the source of the page in the new fault state variable
m_needs_zero, and ignore PG_ZERO if the page did not came from the
allocator.
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D53963
linuxkpi: gracefully handle page lookup failure in lkpi_vmf_insert_pfn_prot_locked
Currently lkpi_vmf_insert_pfn_prot_locked will check the page iter to
find a usage of the page. If no page was found, it continues on to
try using PHYS_TO_VM_PAGE() to get a page. Currently it does not check
if a valid page was found before passing it to vm_page_busy_acquire,
which can cause a kernel page fault as vm_page_busy_acquire expects
a valid page pointer.
This can easily be triggered while starting KDE6 in wayland mode, which
many users have been reporting. With this change plasma6 starts properly
in wayland mode.
Sponsored by: NVIDIA
PR: 288565
Reviewed by: markj, kbowling (mentor)
Differential Revision: https://reviews.freebsd.org/D53412
Fixed conflicts during MFC, re-reviewed by kbowling
(cherry picked from commit 03b214a35db1ebdc7575cad8d695c65daf2817bf)
bsdinstall: Mount /dev and /packages after using the shell to partition disks
Normally after partitions are created by the installer, the 'mount'
script is used to mount the target disk partitions under /mnt. The
tail end of this script also mounts a couple of additional filesystems
under /mnt so that chrooted programs can work such as devfs and
/packages.
When the "Shell" option is used to permit the user to manually mount
the destination filesystem, the "mount" script is not used as the user
is instructed to mount the target filesystems and construct
/mnt/etc/fstab, etc. However, this means that the user is responsible
for mounting devfs (which is not included in /etc/fstab) and /packages
as well. The help message for the "Shell" option doesn't mention
these requirements, so users may not know to do so. This can lead to
confusing errors as chrooted commands can fail to find needed /dev
entries. For example, running fwget to fetch wireless firmware fails
because /dev/pci doesn't exist.
[10 lines not shown]
linuxkpi: add stub implementation of pm_vt_switch_(un)register
This adds empty implementations of pm_vt_switch_(un)register which
are used by nvidia-drm. We do not need to specify anything here as
a VT switch always happens on suspend/resume.
Sponsored by: NVIDIA
Reviewed by: kbowling (mentor), emaste
Differential Revision: https://reviews.freebsd.org/D53400
(cherry picked from commit 75aa13c64aba71f6f26d05e8fcf96e3862d44cde)
locale: make install Unicode 17.0.0/CLDR 48
Unicode 17.0 adds 4803 characters, for a total of 159,801 characters.
The new additions include 4 new scripts:
- Sidetic
- Tolong Siki
- Beria Erfe
- Tai Yo
https://www.unicode.org/versions/Unicode17.0.0/
linuxkpi: gracefully handle page lookup failure in lkpi_vmf_insert_pfn_prot_locked
Currently lkpi_vmf_insert_pfn_prot_locked will check the page iter to
find a usage of the page. If no page was found, it continues on to
try using PHYS_TO_VM_PAGE() to get a page. Currently it does not check
if a valid page was found before passing it to vm_page_busy_acquire,
which can cause a kernel page fault as vm_page_busy_acquire expects
a valid page pointer.
This can easily be triggered while starting KDE6 in wayland mode, which
many users have been reporting. With this change plasma6 starts properly
in wayland mode.
Sponsored by: NVIDIA
PR: 288565
Reviewed by: markj, kbowling (mentor)
Differential Revision: https://reviews.freebsd.org/D53412
(cherry picked from commit 03b214a35db1ebdc7575cad8d695c65daf2817bf)
linuxkpi: add stub implementation of pm_vt_switch_(un)register
This adds empty implementations of pm_vt_switch_(un)register which
are used by nvidia-drm. We do not need to specify anything here as
a VT switch always happens on suspend/resume.
Sponsored by: NVIDIA
Reviewed by: kbowling (mentor), emaste
Differential Revision: https://reviews.freebsd.org/D53400
(cherry picked from commit 75aa13c64aba71f6f26d05e8fcf96e3862d44cde)
lltable: use own lock
Add struct mtx to struct lltable and stop using IF_AFDATA_LOCK, that
was created for a completely different purpose. No functional change
intended.
Reviewed by: zlei, melifaro
Differential Revision: https://reviews.freebsd.org/D54086
linux: store Linux Ethernet interface number in struct ifnet
The old approach where we go through the list of interfaces and count them
has bugs. One obvious bug with this dynamic translation is that once an
Ethernet interface in the middle of the list goes away, all interfaces
following it would change their Linux names.
A bigger problem is the ifnet arrival and departure times. For example
linsysfs has event handler for ifnet_arrival_event, and of course it wants
to resolve the name. This accidentially works, due to a bug in
if_attach() where we call if_link_ifnet() before invoking all the event
handlers. Once the bug is fixed linsysfs won't be able to resolve the old
way. The other side is ifnet_departure_event, where there is no bug, the
eventhandlers are called after the if_unlink_ifnet(). This means old
translation won't work for departure event handlers. One example is
netlink. This change gives the Netlink a chance to emit a proper Linux
interface departure message.
However, there is another problem in Netlink, that the ifnet pointer is
[7 lines not shown]
linux: separate all ifnet(9) related code into linux_ifnet.c
Remove linux_use_real_ifname(). It is no longer used outside of the
file since 3ab3c9c29cf0. There is no functional change.
Reviewed by: melifaro, dchagin
Differential Revision: https://reviews.freebsd.org/D54076
proc0_post: Clear relevant thread stats directly
rufetch() has several other effects besides clearing these per-thread
stats most of which are explicitly discarded by the subsequent calls
to ruxreset(). Just clear the relevant stats directly instead.
Reviewed by: olce, kib, markj
Differential Revision: https://reviews.freebsd.org/D54050
ruxreset: Add an inline function to reset all the stats in rusage_ext
Use it in proc0_post to reset per-process CPU usage.
Suggested by: olce
Reviewed by: olce, kib
Differential Revision: https://reviews.freebsd.org/D54049
thread0: Clear td_rux stats in proc0_post
proc0_post aims to reset the CPU usage accounting for all threads and
processes in the system to zero once the time of day is verified.
However, not all of the per-thread stats were not being cleared,
resulting in over-reported time for thread0 post-boot.
Reviewed by: olce, kib, markj
Fixes: bed4c5241663 ("Implement RUSAGE_THREAD. Add td_rux...")
Differential Revision: https://reviews.freebsd.org/D54040
ipfilter: Restrict ipfilter within a jail
Add a sysctl/tunable (net.inet.ipf.jail_allowed) to control whether a
jail can manage its own ipfilter rules, pools, and settings. A jail's
control over its own ipfilter rules and settings may not be desireable.
The default is jail access to ipfilter is denied.
The host system can stil manage a jail's rules by attaching the rules,
using the on keyword, limiting the rule to the jail's interface. Or
the sysctl/tunable can be enabled to allow a jail control over its own
ipfilter rules and settings.
Implementation note: Rather than store the jail_allowed variable,
referenced by sysctl(9), in a global area, storing the variable in the
ipfilter softc is consistent with ipfilter's use of its softc.
Discussed with: emaste, jrm
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D53623
ipfilter: Disable ipfs(8) by default
At the moment ipfs(8) is a tool that can be easily abused. Though the
concept is sound the implementation needs some work.
ipfs(8) should be considered experimental at the moment.
This commit also makes ipfs support in the kernel optional.
Reviewed by: emaste, glebius
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D53787
mt76: ieee80211_is_first_frag() operates on the seq_ctrl field not on fc.
Pass the correct field to ieee80211_is_first_frag(); otherwise the results
may vary.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit c67fd35e58c6ee1e19877a7fe5998885683abedc)
mt76: add LINUXKPI_PARAM_PREFIX for module_param*
In order to not overwrite sysctl/tunables under compat.linuxkpi
we need to prefix the module_param* names with a per-driver/file
designator to make them (more) uniq. Add the FreeBSD specific
LINUXKPI_PARAM_PREFIX defines for that where missing in mt76.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 853e0440c97a4a1797edd6d653fba4398dc885e8)