Page MenuHomeFreeBSD

linuxkpi: make FPU sections thread-safe and NOCTX
AcceptedPublic

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

Details

Reviewers
kib
manu
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
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

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

Comment should follow style.

43

Use ANSI C definitions.

44–45

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

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

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
43

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…??

44–45

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 ;)

sys/compat/linuxkpi/common/include/asm/fpu/api.h
43

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