From f7067f1c208556526a1a6f4eeeac200bebb2955a Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Wed, 13 Nov 2024 07:48:40 +1300 Subject: [PATCH] Update Aarch64 sigframe size Resolves #3877 --- src/RecordSession.cc | 3 +-- src/kernel_abi.h | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/RecordSession.cc b/src/RecordSession.cc index 9dee7197fab..4990247913d 100644 --- a/src/RecordSession.cc +++ b/src/RecordSession.cc @@ -1729,8 +1729,7 @@ bool RecordSession::signal_state_changed(RecordTask* t, StepState* step_state) { /* this returns 512 when XSAVE unsupported */ xsave_area_size(); } else if (t->arch() == aarch64) { - sigframe_size = sizeof(ARM64Arch::rt_sigframe) + - sizeof(ARM64Arch::user_fpsimd_state); + sigframe_size = sizeof(ARM64Arch::rt_sigframe); } else { DEBUG_ASSERT(0 && "Add sigframe size for your architecture here"); } diff --git a/src/kernel_abi.h b/src/kernel_abi.h index c80d328f444..24470693367 100644 --- a/src/kernel_abi.h +++ b/src/kernel_abi.h @@ -2520,17 +2520,21 @@ struct ARM64Arch : public GenericArch { struct hw_bp dbg_regs[16]; }; + // Also defined as mcontext_t in some headers struct __attribute((aligned(16))) sigcontext { __u64 fault_addr; user_pt_regs regs; // ISA extension state follows here + unsigned char __reserved[4096] __attribute((aligned(16))); }; + // Also defined as ucontext_t in some headers struct ucontext { unsigned long uc_flags; ptr uc_link; stack_t uc_stack; kernel_sigset_t uc_sigmask; + /* 128 bytes are reserved for the sigmask so reflect that here */ uint8_t __unused1[1024 / 8 - sizeof(kernel_sigset_t)]; struct sigcontext uc_mcontext; };