Page MenuHomeFreeBSD

linuxkpi: add kernel_fpu_begin/kernel_fpu_end
ClosedPublic

Authored by greg_unrelenting.technology on Sat, Jan 9, 1:52 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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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.Sat, Jan 9, 5:09 PM

Thanks, will comit this today.