Page MenuHomeFreeBSD

arm: Fix initialization of VFP context
ClosedPublic

Authored by kd on Feb 20 2023, 5:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 11:37 PM
Unknown Object (File)
Oct 2 2024, 2:36 PM
Unknown Object (File)
Oct 1 2024, 10:43 PM
Unknown Object (File)
Sep 28 2024, 1:31 AM
Unknown Object (File)
Sep 28 2024, 1:17 AM
Unknown Object (File)
Sep 28 2024, 1:17 AM
Unknown Object (File)
Sep 27 2024, 5:29 AM
Unknown Object (File)
Sep 26 2024, 3:32 PM

Details

Summary

Make sure that pcb_vfpsaved is always initialized.
Create a vfp_new_thread helper that is heavily based on the arm64 logic.
While here remove un unnecessary assignment and add an assertion to make sure that it's been properly initialized before we return from a VFP exception.

Reported by: Mark Millard <marklmi@yahoo.com>

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kd requested review of this revision.Feb 20 2023, 5:40 PM
kd created this revision.

With the savectx blne -> bl change, D38696.diff, and D38698.diff all applied, all
the activities with all 3 of my small example programs for the armv7 floating
point related problems look to be working just fine: no KASSERT's ( simple_dbl.c
and dbl_and_ull_via_async.cpp activities) and no odd values showing up in a
thread ( dbl_and_ull_multithread.cpp runs for minutes at a time).

sys/arm/arm/vm_machdep.c
140–142

Does this work in a kernel config without VFP

Fix kernel build when VFP is not used.

sys/arm/arm/vm_machdep.c
140–142

Good find, it does not.
I've fixed that in the latest version.

I can confirm that FreeBSD arm32 armv7 is unusable/broken since 6926e2699ae5 and this diff *fixes* it!

Because it is hard to trace down the random errors (eg. neon instructions introduced via zlib/git) it could
save a lot of other peoples headaches (and destroyed git repos) to land this as quick fix for 6926e2699ae5
and discuss the other depending change-sets in review separately.

Thank you!
Michael

@andrew Do you have any more comment w.r.t. this?
If not I'll commit this patch and D38696 soon.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 23 2023, 4:51 PM
This revision was automatically updated to reflect the committed changes.

I did the 3 tests via booting an installed FreeBSD-14.0-CURRENT-arm-armv7-GENERICSD-20230302-005cca8361a4-261233.img.xz (from today) and they all worked fine.