aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/aarch64/setcontext.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/aarch64/setcontext.S')
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/setcontext.S27
1 files changed, 9 insertions, 18 deletions
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)