With the changes introduced to the syscall table for Morello & PCuABI:
commit ("arm64/syscalls: Allow syscalls to return capabilities")
the generic implementation for arch_syscall_addr is no longer valid, so provide a dedicated one, reinstating the syscall tracing when targeting PCuABI.
Signed-off-by: Beata Michalska beata.michalska@arm.com --- arch/arm64/include/asm/ftrace.h | 4 ++++ arch/arm64/kernel/syscall.c | 12 ++++++++++++ 2 files changed, 16 insertions(+)
diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h index 665373f441e1..89ff574a4a91 100644 --- a/arch/arm64/include/asm/ftrace.h +++ b/arch/arm64/include/asm/ftrace.h @@ -102,6 +102,10 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs) return is_32bit_compat_task(); }
+#if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_CHERI_PURECAP_UABI) +#define ARCH_HAS_SYSCALL_ADDR +#endif + #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
static inline bool arch_syscall_match_sym_name(const char *sym, diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c index a0e91ea7b74b..6c45110431c8 100644 --- a/arch/arm64/kernel/syscall.c +++ b/arch/arm64/kernel/syscall.c @@ -105,6 +105,18 @@ static inline bool has_syscall_work(unsigned long flags) return unlikely(flags & _TIF_SYSCALL_WORK); }
+#if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_CHERI_PURECAP_UABI) +unsigned long __init arch_syscall_addr(int nr) +{ + /* + * In this particular case, it makes no difference, + * which member of the syscall_entry_t instance is being + * provided - the address is all that matters here + */ + return (unsigned long)sys_call_table[nr].syscall_fn; +} +#endif + int syscall_trace_enter(struct pt_regs *regs); void syscall_trace_exit(struct pt_regs *regs);