HomeFreeBSD

LinuxKPI: Allow kmalloc to be called when FPU protection is enabled

Description

LinuxKPI: Allow kmalloc to be called when FPU protection is enabled

Amdgpu driver does a lot of memory allocations in FPU-protected sections
of code for certain display cores, e.g. for DCN30. This does not work
on FreeBSD as its malloc function can not be run within a critical
section. Check this condition and temporally exit from FPU-protected
context to workaround issue and reduce source code patching.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu (previous version)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42822

(cherry picked from commit c0b8047bdc13040eafb162c4b7b5dba11034ff4b)

Details

Provenance
wulfAuthored on Feb 10 2024, 10:01 PM
Reviewer
manu
Differential Revision
D42822: LinuxKPI: Add explicit software context to FPU sections
Parents
rG1a8c2dc098ad: LinuxKPI: Constify src parameter of bitmap_copy
Branches
Unknown
Tags
Unknown