Page MenuHomeFreeBSD

linuxkpi: make FPU sections thread-safe and NOCTX
ClosedPublic

Authored by greg_unrelenting.technology on Apr 22 2021, 11:20 AM.

Details

Summary

FPU_KERN_NOCTX should be enough to match the Linux semantics.

+ add explanation for the nesting counter.

Test Plan

Test with an AMD Navi GPU.

Diff Detail

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

Event Timeline

sys/compat/linuxkpi/common/include/asm/fpu/api.h
36–37

This is still completely melts if more than one thread does kernel_fpu_begin()

36–37

Use ANSI C definitions.

36–37

Comment should follow style.

hselasky added inline comments.
sys/compat/linuxkpi/common/include/asm/fpu/api.h
36–37

Feel free to extend the LinuxKPI's "current" with this variable.

greg_unrelenting.technology retitled this revision from linuxkpi: use NOCTX FPU sections to linuxkpi: make FPU sections thread-safe and NOCTX.
sys/compat/linuxkpi/common/include/asm/fpu/api.h
36–37

Feel free to extend the LinuxKPI's "current" with this variable.

OH! Thanks, that makes sense now. Where was this comment when I posted the original patch ;)

36–37

Huh? The only non-ANSI thing I know of is "K&R style" local variables being declared before the opening { bracket. But these functions do not declare any locals at all…??

sys/compat/linuxkpi/common/include/asm/fpu/api.h
36–37

Oh.. you mean the whole "blank () args doesn't mean no args" thing I guess

This revision is now accepted and ready to land.Apr 22 2021, 5:00 PM

No one is stepping up to test on affected hardware, so I guess this can just be committed already

Make sure you bump the __FreeBSD_version when you commit this.

--HPS

well, I can't exactly commit anything myself ;)

I'll try to help you. Just be patient :-)

This broke at least i915kms from drm-kmod despite building successfully. I've reported there as well, since I'm not sure where any fixes need to go.