History log of /linux-master/arch/xtensa/include/asm/ptrace.h
Revision Date Author Comments
# 8cf543c0 19-Sep-2023 Randy Dunlap <rdunlap@infradead.org>

xtensa: ptrace: add prototypes to <asm/ptrace.h>

Add prototype for do_syscall_trace_enter() to asm/ptrace.h.
Move prototype for do_syscall_trace_leave() there to be consistent.

Fixes a build warning:

arch/xtensa/kernel/ptrace.c:545:5: warning: no previous prototype for 'do_syscall_trace_enter' [-Wmissing-prototypes]
545 | int do_syscall_trace_enter(struct pt_regs *regs)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Message-Id: <20230920052139.10570-5-rdunlap@infradead.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>


# 5b835d4c 05-Mar-2022 Max Filippov <jcmvbkbc@gmail.com>

xtensa: use XCHAL_NUM_AREGS as pt_regs::areg size

struct pt_regs is used to access both kernel and user exception frames.
User exception frames may contain up to XCHAL_NUM_AREG registers that
task creation and signal delivery code may access, but pt_regs::areg
array has only 16 entries that cover only the kernel exception frame.
This results in the following build error:

arch/xtensa/kernel/process.c: In function 'copy_thread':
arch/xtensa/kernel/process.c:262:52: error: array subscript 53 is above
array bounds of 'long unsigned int[16]' [-Werror=array-bounds]
262 | put_user(regs->areg[caller_ars+1],

Change struct pt_regs::areg size to XCHAL_NUM_AREGS so that it covers
the whole user exception frame. Adjust task_pt_regs and drop additional
register copying code from copy_thread now that the whole user exception
stack frame is copied.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>


# 8f8d5745 01-Jan-2019 Max Filippov <jcmvbkbc@gmail.com>

xtensa: replace variant/core.h with asm/core.h

Introduce the header arch/xtensa/include/asm/core.h that provides
definitions for XCHAL macros missing in older xtensa releases. Use this
header instead of variant/core.h

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>


# af5395c2 11-Nov-2018 Max Filippov <jcmvbkbc@gmail.com>

xtensa: implement syscall tracepoints

Add TIF_SYSCALL_TRACEPOINT flag definition; add _TIF_SYSCALL_TRACEPOINT
to _TIF_WORK_MASK. Call trace_sys_enter from do_syscall_trace_enter and
trace_sys_exit from do_syscall_trace_leave when TIF_SYSCALL_TRACEPOINT
flag is set.
Add declaration of sys_call_table to arch/xtensa/include/asm/syscall.h
Add definition of NR_syscalls to arch/xtensa/include/asm/unistd.h
Select HAVE_SYSCALL_TRACEPOINTS.

This change allows tracing each syscall entry and exit through the
ftrace mechanism.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>


# 6a986984 09-Nov-2018 Max Filippov <jcmvbkbc@gmail.com>

xtensa: use NO_SYSCALL instead of -1

For the sake of clarity define macro NO_SYSCALL and use it for
setting/checking struct pt_regs::syscall field.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>


# f21a79ca 15-Dec-2017 Max Filippov <jcmvbkbc@gmail.com>

xtensa: clean up exception handling structure

Instead of using flat array of longs use normal C structure and generate
EXC_TABLE_* constants in the asm-offsets.c

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>


# f4431396 04-Dec-2017 Max Filippov <jcmvbkbc@gmail.com>

xtensa: consolidate kernel stack size related definitions

Define kernel stack size in kmem_layout and use it in
current_thread_info, GET_THREAD_INFO, THREAD_SIZE and THERAD_SIZE_ORDER
definitions.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>


# 0700ed07 26-Jan-2015 Max Filippov <jcmvbkbc@gmail.com>

xtensa: move internal ptrace definitions from uapi/asm to asm

Stack frame layout diagram, kernel stack size and exception_handlers
offsets are used by the kernel and are not supposed to be accessible to
userspace. Move these definitions from uapi/asm/ptrace.h to asm/ptrace.h

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>


# f615136c 16-Oct-2013 Max Filippov <jcmvbkbc@gmail.com>

xtensa: add SMP support

This is largely based on SMP code from the xtensa-2.6.29-smp tree by
Piet Delaney, Marc Gauthier, Joe Taylor, Christian Zankel (and possibly
other Tensilica folks).

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>


# c50842df 23-Feb-2013 Chris Zankel <chris@zankel.net>

xtensa: add support for TLS

The Xtensa architecture provides a global register called THREADPTR
for the purpose of Thread Local Storage (TLS) support. This allows us
to use a fairly simple implementation, keeping the thread pointer in
the regset and simply saving and restoring it upon entering/exiting
the from user space.

Signed-off-by: Chris Zankel <chris@zankel.net>


# 5208ba24 13-Dec-2012 Al Viro <viro@zeniv.linux.org.uk>

missing user_stack_pointer() instances

for the architectures that have usp in pt_regs and do not have
user_stack_pointer() already defined.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# c4c4594b 28-Nov-2012 Chris Zankel <chris@zankel.net>

xtensa: clean up files to make them code-style compliant

Remove heading and trailing spaces, trim trailing lines, and wrap lines
that are longer than 80 characters.

Signed-off-by: Chris Zankel <chris@zankel.net>


# 733536b8 14-Nov-2012 Max Filippov <jcmvbkbc@gmail.com>

xtensa: save and restore scompare1 SR on kernel entry

Although scompare1 may be saved/restored by xchal_ncp_{load,store}
macros, explicit save/restore of registers manipulated by the kernel
itself is considered more correct.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>


# 83596729 14-Oct-2012 David Howells <dhowells@redhat.com>

UAPI: (Scripted) Disintegrate arch/xtensa/include/asm

UAPI: (Scripted) Disintegrate arch/xtensa/include/asm

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>


# 0e9a6cb5 26-Jul-2011 Mike Frysinger <vapier@gentoo.org>

ptrace: unify show_regs() prototype

[ poleg@redhat.com: no need to declare show_regs() in ptrace.h, sched.h does this ]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 4573e398 02-May-2010 Chris Zankel <chris@zankel.net>

xtensa: Shuffle include statements to fix linker script

The linker script was including assembly macros from the coprocessor
header file that is not otherwise used by the script.

Signed-off-by: Chris Zankel <chris@zankel.net>


# 6d75ca10 10-Mar-2010 Christoph Hellwig <hch@lst.de>

xtensa: use generic ptrace_resume code

Use the generic ptrace_resume code for PTRACE_SYSCALL, PTRACE_CONT,
PTRACE_KILL and PTRACE_SINGLESTEP. This implies defining
arch_has_single_step in <asm/ptrace.h> and implementing the
user_enable_single_step and user_disable_single_step functions, which also
causes the breakpoint information to be cleared on fork, which could be
considered a bug fix.

Also the TIF_SYSCALL_TRACE thread flag is now cleared on PTRACE_KILL which
it previously wasn't which is consistent with all architectures using the
modern ptrace code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 367b8112 06-Nov-2008 Chris Zankel <chris@zankel.net>

xtensa: move headers files to arch/xtensa/include

Move all header files for xtensa to arch/xtensa/include and platform and
variant header files to the appropriate arch/xtensa/platforms/ and
arch/xtensa/variants/ directories.

Moving the files gets also rid of all uses of symlinks in the Makefile.

This has been completed already for the majority of the architectures
and xtensa is one out of six missing.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Chris Zankel <chris@zankel.net>