MFC: fsck_msdosfs: add a test for reconnecting on volumes larger than 4 GiB
MFC after: 1 week
(cherry picked from commit 37aec55d0a7165960f686e5277f030ab3d44cf45)
MFC: fsck_msdosfs: add a test for reconnecting on volumes larger than 4 GiB
MFC after: 1 week
(cherry picked from commit 37aec55d0a7165960f686e5277f030ab3d44cf45)
libjail: fix fetching mac.label for multiple jails
When doing a basic `jls -n`, jls(8) will jailparam_get() the mac.label
for every jail on the system using the same set of jailparams, and thus
the same jp_value. We only init the mac_t the first time, so the first
jail would populate it with `?` from /etc/mac.conf and the resulting
jail_get(2) would clobber it with the empty string, then a second jail
would try to pass the empty string to the kernel and fail because it
must have a non-zero length.
Fix it by invoking jps_get() every time. Drop some comments to note
that jps_get() will be invoked with zero || garbage from previous call,
and be sure that we don't leak our previous mac_t. There aren't any
other jps_get implementations at this time, so this shouldn't cause any
unexpected problems.
Reported by: ivy
Reviewed by: jamie
Differential Revision: https://reviews.freebsd.org/D57280
linuxkpi: Define `DEFINE_CLASS()` and `CLASS()`
`DEFINE_CLASS()` is in fact named `LINUXKPI_DEFINE_CLASS()` because it
conflicts with `DEFINE_CLASS()` defined in <sys/kobj.h>.
This macro defines a type and a pair of constructor/destructor
functions.
They are to be used by `CLASS()`: this one declares a variable,
initialise it with the constructor and set the `__cleanup()` attribute
to call the destructor once the variable goes out of scope.
The DRM drivers generic code started to use `CLASS()` in Linux 6.13. It
requires the `fd` class to be defined in <linux/file.h>.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57583
linuxkpi: Add `pci_map_rom()` and `pci_unmap_rom()`
They were already defined as macros in various places in DRM drivers,
aliasing the `vga_pci_map_bios()` and `vga_pci_unmap_bios()` functions.
Let's move them to linuxkpi and avoid copies everywhere.
Because they use the `vga_pci` code internally, `pci_map_rom()` checks
whether the given device is a video card. If it is not, it logs a "TODO"
and returns NULL.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57573
linuxkpi: Add device under parent, not under class
In `device_add()`, the function used to add the given device under its
class. This is used to build a sysctl tree. We ended up with devices or
"pseudo" devices (like the output connectors of a GPU). For example with
an output connector:
sysctl sys.class.drm.card0-DP-1
This device should be added under its parent if it has one. With this
fix, the same output connector is now:
sysctl sys.device.drmn1.card0.card0-DP-1
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55175
LinuxKPI: Added jiffies64_to_msecs for amdkfd compatibility
jiffies64_to_msecs is used by kfd_process.c in the amd/amdkfd driver
from Linux kernel 6.12.
Submitted by: Sourojeet Adhikari
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58075
linuxkpi: Define `for_each_if()`
This macro was moved from <drm/drm_util.h> to <linux/util_macros.h> in
Linux 6.15.
Submitted by: Sourojeet Adhikari
Approved by: adrian, bz, emaste, seuros
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57465
LinuxKPI: Add tgid to task_struct under sched.h
The amdkfd driver requires the `tgid` to be a part of the `task_struct`.
This patch introduces the `tgid` member to `task_struct`.
Reviewed by: bz
Sponsored By: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58228
hwpmc: add MPERF/APERF MSR support for AMD/Intel CPUs
Add support for reading the MPERF (MSR 0xE7) and APERF (MSR 0xE8)
model-specific registers on AMD/Intel CPUs through hwpmc(4). These
counters track maximum and actual performance frequency respectively,
and are used to compute effective CPU frequency scaling independent
of the nominal TSC rate. The name of the class was chosen as PERF
because later support for other PERF MSRs can be added to the same
class.
Extend libpmc(3) to expose the AMD/Intel MPERF/APERF counters added
to hwpmc(4) in the companion kernel change, so userland consumers
(pmcstat(8), etc.) can allocate and read these events by name.
Document the new PERF class and its MPERF/APERF counters in a new
pmc.perf.3 manual page, describing their semantics and how to read
them via pmc(3) and pmcstat(8).
Bump PMC_VERSION_MINOR.
[6 lines not shown]