Page MenuHomeFreeBSD

linuxkpi: add kernel_fpu_begin/kernel_fpu_end
ClosedPublic

Authored by val_packett.cool on Jan 9 2021, 1:52 PM.
Referenced Files
Unknown Object (File)
Mon, Dec 9, 5:28 PM
Unknown Object (File)
Mon, Nov 25, 7:19 PM
Unknown Object (File)
Nov 7 2024, 2:44 PM
Unknown Object (File)
Nov 1 2024, 6:29 PM
Unknown Object (File)
Oct 25 2024, 1:55 PM
Unknown Object (File)
Oct 7 2024, 11:20 PM
Unknown Object (File)
Oct 5 2024, 4:35 AM
Unknown Object (File)
Oct 5 2024, 3:19 AM

Details

Summary

With newer AMD GPUs (>=Navi,Renoir) there is FPU context usage in the amdgpu driver.
The kernel_fpu_begin/end implementations in drm did not even allow nested begin-end blocks.
This patch merges a more complete implementation into base as requested by @manu.

The counter algorithm was tested (with the variables still being static) at https://github.com/freebsd/drm-kmod/pull/45
In this version, the variables are moved into the linuxkpi module, the context is allocated with sysinit once, to avoid silly reallocations all over the place.


Adding the file into conf/files.ARCH is quite annoying, would it be better to just ifdef the whole linux_fpu.c instead of excluding it from the build for arches that don't have fpu_kern(9)?


By the way the PowerPC crowd really should implement fpu_kern(9) already ;)

Test Plan

Ideally, someone should retest base with this patch + drm at https://github.com/myfreeweb/drm-kmod/commit/5c7c900cceb9afbae9559b1054697a1d22ee704d with the new amdgpus.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

HI, I have a Navi10 card (5700XT) + AMD 5950X.
If that setup is suitable I would give it try ?

How does the test plan look like ?

cheers Daniel

How does the test plan look like ?

> - ensure you have the latest src tree from https://cgit.freebsd.org/src/ in /usr/src

Done. It booted and I used it now for about 15 min. without any in the face issue.
Do you need any logs or sth. ?

Done. It booted and I used it now for about 15 min. without any in the face issue.
Do you need any logs or sth. ?

Nah, nothing needed. The FPU stuff is used in the initialization process — if the driver loaded, it's good :)

This revision is now accepted and ready to land.Jan 9 2021, 5:09 PM

Thanks, will comit this today.

This revision was automatically updated to reflect the committed changes.