Page MenuHomeFreeBSD

Implement the fpu_kern(9) KPI on arm64
ClosedPublic

Authored by andrew on Oct 18 2016, 1:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 5 2024, 10:42 PM
Unknown Object (File)
Mar 19 2024, 11:50 PM
Unknown Object (File)
Mar 19 2024, 11:50 PM
Unknown Object (File)
Feb 24 2024, 4:55 AM
Unknown Object (File)
Feb 14 2024, 12:08 AM
Unknown Object (File)
Jan 7 2024, 6:10 PM
Unknown Object (File)
Dec 19 2023, 8:33 AM
Unknown Object (File)
Nov 27 2023, 4:45 AM
Subscribers

Details

Summary

Add support for the fpu_kern(9) KPI for arm64. It hooks into the existing
VFP code to store the old context, with lazy loading of the new context
when needed.

FPU_KERN_NOCTX is missing as this is unused in the crypto code this has
been tested with, and I am unsure on the requirements of the UEFI
Runtime Services.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

andrew retitled this revision from to Implement the fpu_kern(9) KPI on arm64.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: arm64, kib.
andrew added a subscriber: emaste.
kib edited edge metadata.
kib added inline comments.
sys/arm64/arm64/trap.c
285 ↗(On Diff #21472)

You might add an assert in do_el0_sync() that pcb_fpflags has PCB_FP_KERN cleared and that pcb->pcb_fpusaved == &pcb->pcb_fpustate. There, you probably want to assert !=.

sys/arm64/arm64/vfp.c
246 ↗(On Diff #21472)

You initialize the new kernel vfp save area with zeroes. This includes the vfp_fpcr and vfp_fpsr values loaded on vfp access. Are 0's the correct values there ?

sys/opencrypto/crypto.c
1249 ↗(On Diff #21472)

This change is not needed yet ? There is no arm64 files added to aesni module.

This revision is now accepted and ready to land.Oct 18 2016, 2:51 PM

The fpu_kern(9) man page should be updated, with a note that arm64 is included in the supported arches.

sys/arm64/arm64/trap.c
285 ↗(On Diff #21472)

I thought I did, but seem to have lost that change.

sys/arm64/arm64/vfp.c
246 ↗(On Diff #21472)

The kernel only ever initialises fpsr and fpcr to 0.

sys/opencrypto/crypto.c
1249 ↗(On Diff #21472)

There will be soon, I have the code ready, just need the last bits of clean up. I included this with this change so some of the code would be tested.

sys/arm64/arm64/trap.c
285 ↗(On Diff #21472)

I added the PCB_FP_KERN check in rS307565 as it's not in the user mask.

andrew edited edge metadata.

Update the manpage
Add a KASSERT to the end of do_el0_sync

This revision now requires review to proceed.Oct 18 2016, 3:54 PM
kib edited edge metadata.
This revision is now accepted and ready to land.Oct 19 2016, 12:26 AM
This revision was automatically updated to reflect the committed changes.