diff options
author | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2025-07-26 12:17:26 +0000 |
---|---|---|
committer | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2025-08-07 18:46:15 +0000 |
commit | c0fc0facf877d4e2ad5843d59c15d0d464432962 (patch) | |
tree | 1638970b653c7e3c4645c5834ff0814779e604de /uts/common/sys/fm/(public-mirror) | |
parent | 3c4b3bab19ca66bbb3c53275c51d4bf863059fb2 (diff) |
`kvmalloc()` was a simple wrapper around the FreeBSD native `malloc()`.
Unlike the more involved implementation of `kmalloc()`, it didn't end
and being the FPU context around the actual call to `malloc()`.
This caused the following panic in the amdgup DRM driver:
panic: malloc: called with spinlock or critical section held
... triggered by the call:
struct dc_3dlut *lut = kvzalloc(sizeof(*lut), GFP_KERNEL);
(for the record, GFP_KERNEL is defined as M_WAITOK)
Replicating the same behaviour as `kmalloc()`, in other words, ending
the FPU context before the call to the underlying `malloc()`, and
beginning it again afterwards solves the problem.
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51557
Diffstat (limited to 'uts/common/sys/fm/(public-mirror)')
0 files changed, 0 insertions, 0 deletions