Deprecate uses_fp: always enable FPU state save on all threads#3900
Deprecate uses_fp: always enable FPU state save on all threads#3900grandixximo wants to merge 3 commits intoLinuxCNC:2.9from
Conversation
GCC on x86-64 may emit SSE instructions (e.g. for struct zeroing) even in functions that don't explicitly use floating point. On RTAI, threads created with uses_fp=0 skip FPU/SSE state save/restore, silently corrupting XMM registers of other Linux processes and causing heap corruption and system crashes. Fix by always enabling FPU state save regardless of the uses_fp parameter: - rtai_rtapi.c: always pass 1 to rt_task_init_cpuid - hal_lib.c: override uses_fp=0 to 1 in hal_create_thread - hal_lib.c: remove addf FP compatibility check (now meaningless) Emit deprecation warnings when uses_fp=0 is requested. Ref: LinuxCNC#3895
Minimal doc update for 2.9. Full refactor of component docs, halcompile, and API removal planned for 2.10. Ref: LinuxCNC#3895
|
@andypugh I was thinking to have minimal docs and code changes for 2.9 just to address the issue directly, minimal impact, small hack but gets 2.9 working on RTAI again. |
|
I think this should also include the following (patch is against master; currently cannot easily build 2.9): This patch changes halcompile to add a warning when you use |
|
A small typo in the warn function. It should always return 1: def optfp_warn(state):
s = "nofp" if 0 == state else "fp"
Warn("'{}' is not longer supported. Threads are always floating point threads.".format(s))
return 1The change in the parser rule def optfp_warn(state):
return 1 |
Add optfp_warn() in halcompile that silently forces fp to 1 when fp or nofp keywords are used in function declarations. Out-of-tree .comp files will still parse without error. Remove fp/nofp from all in-tree .comp files, conv.comp.in template, and mkconv.sh generator. Based on patch by BsAtHome. Ref: LinuxCNC#3895
|
Done with your patch as reference, you are doing 2.10 then? @BsAtHome |
|
The man-pages are wrong. You are changing the generated files and not the adoc man-page source in docs/src/man/... |
It is all your pleasure :-) |
Hm, yes, for master branch it is wrong... 2.9 is still of groff life support. |
But this is 2.9, I was searching docs/src/man/ |
That is indeed what I said :-) |
So we are good, I did it right for 2.9 😌 |
|
I did not rebuild the .po |
GCC on x86-64 may emit SSE instructions (e.g. for struct zeroing) even in functions that don't explicitly use floating point. On RTAI, threads created with uses_fp=0 skip FPU/SSE state save/restore, silently corrupting XMM registers of other Linux processes and causing heap corruption and system crashes.
Fix by always enabling FPU state save regardless of the uses_fp parameter:
Emit deprecation warnings when uses_fp=0 is requested.
Ref: #3895