diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/aarch64')
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/arch-syscall.h | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/cpu-features.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/libc.abilist | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/libm.abilist | 16 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/libmvec.abilist | 20 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/makecontext.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/setcontext.S | 27 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/uw-sigframe.h | 78 |
9 files changed, 137 insertions, 22 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h index 89aced0..ba4a461 100644 --- a/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h +++ b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h @@ -175,6 +175,7 @@ #define __NR_nfsservctl 42 #define __NR_open_by_handle_at 265 #define __NR_open_tree 428 +#define __NR_open_tree_attr 467 #define __NR_openat 56 #define __NR_openat2 437 #define __NR_perf_event_open 241 diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c index 6d63c8a..1acc82d 100644 --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c @@ -23,6 +23,7 @@ #include <sys/prctl.h> #include <sys/utsname.h> #include <dl-tunables-parse.h> +#include <dl-symbol-redir-ifunc.h> #define DCZID_DZP_MASK (1 << 4) #define DCZID_BS_MASK (0xf) diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index aa6bf48..a22e651 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2752,6 +2752,16 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 cfgetibaud F +GLIBC_2.42 cfgetispeed F +GLIBC_2.42 cfgetobaud F +GLIBC_2.42 cfgetospeed F +GLIBC_2.42 cfsetbaud F +GLIBC_2.42 cfsetibaud F +GLIBC_2.42 cfsetispeed F +GLIBC_2.42 cfsetobaud F +GLIBC_2.42 cfsetospeed F +GLIBC_2.42 cfsetspeed F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/aarch64/libm.abilist b/sysdeps/unix/sysv/linux/aarch64/libm.abilist index 4fdeb0d..bb8114b 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libm.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libm.abilist @@ -1245,6 +1245,14 @@ GLIBC_2.41 tanpif32x F GLIBC_2.41 tanpif64 F GLIBC_2.41 tanpif64x F GLIBC_2.41 tanpil F +GLIBC_2.42 compoundn F +GLIBC_2.42 compoundnf F +GLIBC_2.42 compoundnf128 F +GLIBC_2.42 compoundnf32 F +GLIBC_2.42 compoundnf32x F +GLIBC_2.42 compoundnf64 F +GLIBC_2.42 compoundnf64x F +GLIBC_2.42 compoundnl F GLIBC_2.42 pown F GLIBC_2.42 pownf F GLIBC_2.42 pownf128 F @@ -1261,6 +1269,14 @@ GLIBC_2.42 powrf32x F GLIBC_2.42 powrf64 F GLIBC_2.42 powrf64x F GLIBC_2.42 powrl F +GLIBC_2.42 rootn F +GLIBC_2.42 rootnf F +GLIBC_2.42 rootnf128 F +GLIBC_2.42 rootnf32 F +GLIBC_2.42 rootnf32x F +GLIBC_2.42 rootnf64 F +GLIBC_2.42 rootnf64x F +GLIBC_2.42 rootnl F GLIBC_2.42 rsqrt F GLIBC_2.42 rsqrtf F GLIBC_2.42 rsqrtf128 F diff --git a/sysdeps/unix/sysv/linux/aarch64/libmvec.abilist b/sysdeps/unix/sysv/linux/aarch64/libmvec.abilist index a56ce7f..f7f72b6 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libmvec.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libmvec.abilist @@ -148,3 +148,23 @@ GLIBC_2.41 _ZGVsMxv_sinpi F GLIBC_2.41 _ZGVsMxv_sinpif F GLIBC_2.41 _ZGVsMxv_tanpi F GLIBC_2.41 _ZGVsMxv_tanpif F +GLIBC_2.42 _ZGVnN2v_acospi F +GLIBC_2.42 _ZGVnN2v_acospif F +GLIBC_2.42 _ZGVnN2v_asinpi F +GLIBC_2.42 _ZGVnN2v_asinpif F +GLIBC_2.42 _ZGVnN2v_atanpi F +GLIBC_2.42 _ZGVnN2v_atanpif F +GLIBC_2.42 _ZGVnN2vv_atan2pi F +GLIBC_2.42 _ZGVnN2vv_atan2pif F +GLIBC_2.42 _ZGVnN4v_acospif F +GLIBC_2.42 _ZGVnN4v_asinpif F +GLIBC_2.42 _ZGVnN4v_atanpif F +GLIBC_2.42 _ZGVnN4vv_atan2pif F +GLIBC_2.42 _ZGVsMxv_acospi F +GLIBC_2.42 _ZGVsMxv_acospif F +GLIBC_2.42 _ZGVsMxv_asinpi F +GLIBC_2.42 _ZGVsMxv_asinpif F +GLIBC_2.42 _ZGVsMxv_atanpi F +GLIBC_2.42 _ZGVsMxv_atanpif F +GLIBC_2.42 _ZGVsMxvv_atan2pi F +GLIBC_2.42 _ZGVsMxvv_atan2pif F diff --git a/sysdeps/unix/sysv/linux/aarch64/makecontext.c b/sysdeps/unix/sysv/linux/aarch64/makecontext.c index a2eab9e..4485723 100644 --- a/sysdeps/unix/sysv/linux/aarch64/makecontext.c +++ b/sysdeps/unix/sysv/linux/aarch64/makecontext.c @@ -36,9 +36,7 @@ static struct _aarch64_ctx *extension (void *p) static void * alloc_makecontext_gcs (size_t stack_size) { - void *base; - size_t size; - void *gcsp = __alloc_gcs (stack_size, &base, &size); + void *gcsp = __alloc_gcs (stack_size, NULL); if (gcsp == NULL) /* ENOSYS, bad size or OOM. */ abort (); diff --git a/sysdeps/unix/sysv/linux/aarch64/setcontext.S b/sysdeps/unix/sysv/linux/aarch64/setcontext.S index 022a263..d9716f0 100644 --- a/sysdeps/unix/sysv/linux/aarch64/setcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/setcontext.S @@ -48,25 +48,16 @@ ENTRY (__setcontext) cbz x0, 1f b C_SYMBOL_NAME (__syscall_error) 1: - /* Disable ZA of SME. */ -#if HAVE_AARCH64_PAC_RET - PACIASP - cfi_window_save -#endif - stp x29, x30, [sp, -16]! - cfi_adjust_cfa_offset (16) - cfi_rel_offset (x29, 0) - cfi_rel_offset (x30, 8) - mov x29, sp + /* Clear ZA state of SME. */ + /* The calling convention of __libc_arm_za_disable allows to do + this thus allowing to avoid saving to and reading from stack. + As a result we also don't need to sign the return address and + check it after returning because it is not stored to stack. */ + mov x13, x30 + cfi_register (x30, x13) bl __libc_arm_za_disable - ldp x29, x30, [sp], 16 - cfi_adjust_cfa_offset (-16) - cfi_restore (x29) - cfi_restore (x30) -#if HAVE_AARCH64_PAC_RET - AUTIASP - cfi_window_save -#endif + mov x30, x13 + cfi_register (x13, x30) /* Restore the general purpose registers. */ mov x0, x9 cfi_def_cfa (x0, 0) diff --git a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S index cc41253..58ddb95 100644 --- a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S @@ -119,7 +119,7 @@ L(gcs_done): 2: /* The oucp context is restored here via an indirect branch, x1 must be restored too which has the real return address. */ - BTI_J + bti j mov x30, x1 RET PSEUDO_END (__swapcontext) diff --git a/sysdeps/unix/sysv/linux/aarch64/uw-sigframe.h b/sysdeps/unix/sysv/linux/aarch64/uw-sigframe.h new file mode 100644 index 0000000..9d5d345 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/uw-sigframe.h @@ -0,0 +1,78 @@ +/* Signal frame backtracing support for SFrame on AARCH64. + Copyright (C) 2025 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +/* This code is inspired from libgcc's MD_FALLBACK_FRAME_STATE_FOR + implementation. See libgcc/config/aarch64/linux-unwind.h */ + +#include <signal.h> +#include <sys/ucontext.h> +#include <kernel_rt_sigframe.h> + +#ifdef __AARCH64EL__ +#define MOVZ_X8_8B 0xd2801168 +#define SVC_0 0xd4000001 +#else +#define MOVZ_X8_8B 0x681180d2 +#define SVC_0 0x010000d4 +#endif + +#define MD_DECODE_SIGNAL_FRAME aarch64_decode_signal_frame + +static _Unwind_Reason_Code +aarch64_decode_signal_frame (frame *frame) +{ + unsigned int *pc = (unsigned int *) frame->pc; + mcontext_t *mt; + struct kernel_rt_sigframe *rt_; + + if ((frame->pc & 3) != 0) + return _URC_END_OF_STACK; + + /* A signal frame will have a return address pointing to + __kernel_rt_sigreturn. This code is hardwired as: + + 0xd2801168 movz x8, #0x8b + 0xd4000001 svc 0x0 + */ + if (pc[0] != MOVZ_X8_8B || pc[1] != SVC_0) + return _URC_END_OF_STACK; + + rt_ = (struct kernel_rt_sigframe *) frame->sp; + mt = &rt_->uc.uc_mcontext; + + /* Frame pointer register number. */ +#define FP_REGNUM 30 + + frame->pc = (_Unwind_Ptr) mt->pc; + frame->sp = (_Unwind_Ptr) mt->sp; + frame->fp = (_Unwind_Ptr) mt->regs[FP_REGNUM]; + return _URC_NO_REASON; +} + +#define MD_DETECT_OUTERMOST_FRAME aarch64_detect_outermost_frame + +static _Unwind_Reason_Code +aarch64_detect_outermost_frame (frame *frame) +{ + /* Initial frame has LR and FP set to zero. We track only FP. */ + if (frame->fp == 0) + return _URC_END_OF_STACK; + + return _URC_NO_REASON; +} |