Page MenuHomeFreeBSD

arm64: Initial SVE support
Needs ReviewPublic

Authored by andrew on Jan 4 2024, 12:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 2:52 AM
Unknown Object (File)
Thu, Apr 25, 9:20 PM
Unknown Object (File)
Wed, Apr 17, 5:32 PM
Unknown Object (File)
Tue, Apr 9, 12:21 AM
Unknown Object (File)
Mar 16 2024, 12:24 PM
Unknown Object (File)
Mar 4 2024, 11:09 PM
Unknown Object (File)
Mar 4 2024, 11:09 PM
Unknown Object (File)
Mar 4 2024, 10:54 PM
Subscribers

Details

Reviewers
kib
markj
manu
Group Reviewers
arm64
Summary

Add initial kernel support for SVE. This detects if SVE is present on
all CPUs, and if so allows for the use of SVE in the future.

As the SVE registers are a superset of the VFP registers we don't need
to restore the VFP registers when SVE is enabled.

Ths interface to enable SVE is provided, but not used until SVE is
supported in signals and with ptrace.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57123
Build 54011: arc lint + arc unit

Event Timeline

This one seems reasonable, but it would be best to get others to say so too.

sys/arm64/arm64/vfp.c
111

Do you want to leave this in?

661

should you free the svesaved memory instead?

Rework to not guarentee the SVE registers are saved over a syscall other than sigreturn.
The ABI doesn't require SVE registers to be saved on a function call so extend this to a system call.
As dropping the SVE state on all system calls could get expensive only do it on context switch when in one.

Rework to not guarentee the SVE registers are saved over a syscall other than sigreturn.
The ABI doesn't require SVE registers to be saved on a function call so extend this to a system call.
As dropping the SVE state on all system calls could get expensive only do it on context switch when in one.

I read this as disallowing use of rtld for any custom ABI. Imagine that rtld bind is called to resolve a symbol which use custom calling conventions (namely, preserving SVE state). Then, if rtld ever needed to issue a syscall while working, it corrupts the SVE state of the caller.

Functions that take an SVE register as an argument, or use one for the return value are marked with STO_AARCH64_VARIANT_PCS [1]. In glibc it looks like they avoid lazy resolution for all variant pcs functions. As there are more reasons than just SVE for a function to be marked as a variant, and more reasons could be added in the future I think it's the only safe option.

[1] https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst#st_other-values