Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f7932b0 authored by Guo Ren's avatar Guo Ren
Browse files

csky: Update syscall_trace_enter/exit implementation



Previous syscall_trace implementation couldn't support AUDITSYSCALL and
SYSCALL_TRACEPOINTS. Now we redesign it to support audit_syscall
and syscall_tracepoints just like other archs'.

Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
Cc: Dmitry V. Levin <ldv@altlinux.org>
Cc: Arnd Bergmann <arnd@arndb.de>
parent cfa4d93b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ config CSKY
	select GENERIC_SCHED_CLOCK
	select GENERIC_SMP_IDLE_THREAD
	select HAVE_ARCH_TRACEHOOK
	select HAVE_ARCH_AUDITSYSCALL
	select HAVE_DYNAMIC_FTRACE
	select HAVE_FUNCTION_TRACER
	select HAVE_FUNCTION_GRAPH_TRACER
@@ -39,6 +40,7 @@ config CSKY
	select HAVE_PERF_EVENTS
	select HAVE_DMA_API_DEBUG
	select HAVE_DMA_CONTIGUOUS
	select HAVE_SYSCALL_TRACEPOINTS
	select MAY_HAVE_SPARSE_IRQ
	select MODULES_USE_ELF_RELA if MODULES
	select OF
+4 −0
Original line number Diff line number Diff line
@@ -157,4 +157,8 @@
	cpwcr	\rx, cpcr31
.endm

.macro ANDI_R3 rx, imm
	lsri	\rx, 3
	andi	\rx, (\imm >> 3)
.endm
#endif /* __ASM_CSKY_ENTRY_H */
+5 −0
Original line number Diff line number Diff line
@@ -175,4 +175,9 @@
	lrw	\rx, (PHYS_OFFSET + 0x20000000) | 0xe
	mtcr	\rx, cr<31, 15>
.endm

.macro ANDI_R3 rx, imm
	lsri	\rx, 3
	andi	\rx, (\imm >> 3)
.endm
#endif /* __ASM_CSKY_ENTRY_H */
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
#include <abi/regdef.h>
#include <uapi/linux/audit.h>

extern void *sys_call_table[];

static inline int
syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
{
+12 −15
Original line number Diff line number Diff line
@@ -51,17 +51,14 @@ static inline struct thread_info *current_thread_info(void)

#endif /* !__ASSEMBLY__ */

/* entry.S relies on these definitions!
 * bits 0-5 are tested at every exception exit
 */
#define TIF_SIGPENDING		0	/* signal pending */
#define TIF_NOTIFY_RESUME	1       /* callback before returning to user */
#define TIF_NEED_RESCHED	2	/* rescheduling necessary */
#define TIF_SYSCALL_TRACE	5	/* syscall trace active */
#define TIF_DELAYED_TRACE	14	/* single step a syscall */
#define TIF_SYSCALL_TRACE	3	/* syscall trace active */
#define TIF_SYSCALL_TRACEPOINT	4       /* syscall tracepoint instrumentation */
#define TIF_SYSCALL_AUDIT	5	/* syscall auditing */
#define TIF_POLLING_NRFLAG	16	/* poll_idle() is TIF_NEED_RESCHED */
#define TIF_MEMDIE		18      /* is terminating due to OOM killer */
#define TIF_FREEZE		19	/* thread is freezing for suspend */
#define TIF_RESTORE_SIGMASK	20	/* restore signal mask in do_signal() */
#define TIF_SECCOMP		21	/* secure computing */

@@ -69,10 +66,10 @@ static inline struct thread_info *current_thread_info(void)
#define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
#define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
#define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
#define _TIF_DELAYED_TRACE	(1 << TIF_DELAYED_TRACE)
#define _TIF_SYSCALL_TRACEPOINT	(1 << TIF_SYSCALL_TRACEPOINT)
#define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
#define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
#define _TIF_MEMDIE		(1 << TIF_MEMDIE)
#define _TIF_FREEZE             (1 << TIF_FREEZE)
#define _TIF_RESTORE_SIGMASK	(1 << TIF_RESTORE_SIGMASK)
#define _TIF_SECCOMP		(1 << TIF_SECCOMP)

Loading