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)
Sun, Nov 10, 11:19 AM
Unknown Object (File)
Sep 30 2024, 6:27 PM
Unknown Object (File)
Sep 29 2024, 9:20 PM
Unknown Object (File)
Sep 23 2024, 2:44 PM
Unknown Object (File)
Sep 20 2024, 5:32 PM
Unknown Object (File)
Sep 18 2024, 9:19 PM
Unknown Object (File)
Sep 11 2024, 1:27 AM
Unknown Object (File)
Sep 9 2024, 10:38 PM
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.