Page MenuHomeFreeBSD

arm: Fix initialization of VFP context
ClosedPublic

Authored by kd on Feb 20 2023, 5:40 PM.
Tags
None
Referenced Files
F81959057: D38698.id.diff
Tue, Apr 23, 6:43 PM
Unknown Object (File)
Sat, Apr 20, 2:30 PM
Unknown Object (File)
Sat, Apr 20, 7:35 AM
Unknown Object (File)
Fri, Apr 19, 5:03 PM
Unknown Object (File)
Mon, Apr 15, 5:22 PM
Unknown Object (File)
Feb 8 2024, 7:07 PM
Unknown Object (File)
Dec 23 2023, 12:08 AM
Unknown Object (File)
Dec 12 2023, 7:24 AM

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

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

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.