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)
Fri, Mar 29, 12:51 PM
Unknown Object (File)
Jan 2 2024, 1:43 AM
Unknown Object (File)
Dec 24 2023, 3:46 AM
Unknown Object (File)
Dec 20 2023, 3:29 AM
Unknown Object (File)
Dec 14 2023, 12:44 PM
Unknown Object (File)
Oct 30 2023, 4:36 PM
Unknown Object (File)
Oct 19 2023, 6:22 PM
Unknown Object (File)
Oct 14 2023, 9:42 PM

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 Skipped
Unit
Tests Skipped

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.