summaryrefslogtreecommitdiff
path: root/src/thread/aarch64
AgeCommit message (Collapse)AuthorLines
2025-07-16aarch64: mask off SME and unknown/future hwcap bitsHEADmasterRich Felker-0/+22
as stated in the comment added, the ABI for SME requires libc to be aware of and support the extension to the register file. this is necessary to handle lazy saving correctly across setjmp/longjmp, and on older kernels, in order not to introduce memory corruption bugs that may be exploitable vulnerabilities when creating new threads. previously, we did not expose __getauxval, the interface libgcc uses to determine runtime availability of SME, so it was not usable when following the intended ABI. since commit ab4635fba6769e19fb411a1ab3c8aa7407e11188 has now exposed this interface, a mitigation is needed to ensure SME is not used unless/until we have proper support for it. while SME is the current hwcap feature that needs this treatment, as-yet-undefined hwcap bits are also masked in case other new cpu features have similar ABI issues. this could be re-evaluated at some point in the future. for now, the masking is only on aarch64. arguably it should be considered for all archs, but whether it's needed is really a matter of how ABI policy & stability are handled by the maintainers of the arch psABI, and aarch64 is the one that's demonstrated a necessity. if it turns out something like this is needed for more/all archs, making a generalized framework for it would make sense. for now, it's stuffed into __set_thread_area the same way atomics detection is stuffed there for 32-bit arm and sh, as it's a convenient point for "arch-specific early setup code" without invasive changes.
2025-07-12aarch64: replace asm source file for __set_thread_area with inline asmRich Felker-7/+5
this change both aligns with the intended future direction for most assembly usage, and makes it possible to add arch-specific setup logic based on hwcaps like we have for 32-bit arm.
2025-07-01fix register name usage in aarch64 clone.sRich Felker-1/+1
the alias fp is only supported on some assemblers. use the actual register name x29 instead.
2025-02-21clone: clear the frame pointer in the child process on relevant portsAlex Rønne Petersen-1/+2
This just mirrors what is done in the start code for the affected ports, as well as what is already done for the three x86 ports. Clearing the frame pointer helps protect FP-based unwinders from wrongly attempting to traverse into the parent thread's call frame stack.
2018-09-12make arch __set_thread_area backends hiddenRich Felker-0/+1
this is not a public interface, and does not even necessarily match the syscall on all archs that have a syscall by that name. on archs where it's implemented in C, no action on the source file is needed; the hidden declaration in pthread_arch.h suffices.
2018-09-12make arch __clone backends hiddenRich Felker-0/+1
these are not a public interface and are not intended to be callable from anywhere but the public clone function or other places in libc.
2015-11-02use explicit __cp_cancel label in cancellable syscall asm for all archsRich Felker-4/+3
previously, only archs that needed to do stack cleanup defined a __cp_cancel label for acting on cancellation in their syscall asm, and a default definition was provided by a weak alias to __cancel, the C function. this resulted in wrong codegen for arm on gcc versions affected by pr 68178 and possibly similar issues (like pr 66609) on other archs, and also created an inconsistency where the __cp_begin and __cp_end labels were treated as const data but __cp_cancel was treated as a function. this in turn caused incorrect code generation on archs where function pointers point to function descriptors rather than code (for now, only sh/fdpic).
2015-04-14consistently use hidden visibility for cancellable syscall internalsRich Felker-2/+8
in a few places, non-hidden symbols were referenced from asm in ways that assumed ld-time binding. while these is no semantic reason these symbols need to be hidden, fixing the references without making them hidden was going to be ugly, and hidden reduces some bloat anyway. in the asm files, .global/.hidden directives have been moved to the top to unclutter the actual code.
2015-03-11add aarch64 portSzabolcs Nagy-0/+69
This adds complete aarch64 target support including bigendian subarch. Some of the long double math functions are known to be broken otherwise interfaces should be fully functional, but at this point consider this port experimental. Initial work on this port was done by Sireesh Tripurari and Kevin Bortis.