From 969f6fe6fc5ecc7a2edcc34f29b7f05fcf982266 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 22 Dec 2012 00:21:12 -0500 Subject: arch/tile: Enable HAVE_ARCH_TRACEHOOK Looks like we have everything needed for that. Signed-off-by: Simon Marchi Signed-off-by: Chris Metcalf --- arch/tile/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/tile/Kconfig') diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index 25877aebc685..e911ef638b77 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig @@ -22,6 +22,7 @@ config TILE select ARCH_HAVE_NMI_SAFE_CMPXCHG select GENERIC_CLOCKEVENTS select MODULES_USE_ELF_RELA + select HAVE_ARCH_TRACEHOOK # FIXME: investigate whether we need/want these options. # select HAVE_IOREMAP_PROT -- cgit From ef567f25d5d9d803b89bc2aec6bb71fe8b4bebd9 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 21 Jan 2013 19:54:57 -0500 Subject: tile: support TIF_SYSCALL_TRACEPOINT; select HAVE_SYSCALL_TRACEPOINTS This patch adds support for the TIF_SYSCALL_TRACEPOINT on the tile architecture. Basically, it calls the appropriate tracepoints on syscall entry and exit. Signed-off-by: Simon Marchi Signed-off-by: Chris Metcalf --- arch/tile/Kconfig | 1 + arch/tile/include/asm/thread_info.h | 8 ++++++++ arch/tile/kernel/intvec_64.S | 14 ++++++++++---- arch/tile/kernel/ptrace.c | 17 ++++++++++++++--- 4 files changed, 33 insertions(+), 7 deletions(-) (limited to 'arch/tile/Kconfig') diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index e911ef638b77..0e500d90c2a0 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig @@ -23,6 +23,7 @@ config TILE select GENERIC_CLOCKEVENTS select MODULES_USE_ELF_RELA select HAVE_ARCH_TRACEHOOK + select HAVE_SYSCALL_TRACEPOINTS # FIXME: investigate whether we need/want these options. # select HAVE_IOREMAP_PROT diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h index e9c670d7a7fe..c96331eb5771 100644 --- a/arch/tile/include/asm/thread_info.h +++ b/arch/tile/include/asm/thread_info.h @@ -124,6 +124,7 @@ extern void _cpu_idle(void); #define TIF_SECCOMP 6 /* secure computing */ #define TIF_MEMDIE 7 /* OOM killer at work */ #define TIF_NOTIFY_RESUME 8 /* callback before returning to user */ +#define TIF_SYSCALL_TRACEPOINT 9 /* syscall tracepoint instrumentation */ #define _TIF_SIGPENDING (1< #include +#define CREATE_TRACE_POINTS +#include + void user_enable_single_step(struct task_struct *child) { set_tsk_thread_flag(child, TIF_SINGLESTEP); @@ -249,16 +252,24 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, int do_syscall_trace_enter(struct pt_regs *regs) { - if (tracehook_report_syscall_entry(regs)) { - regs->regs[TREG_SYSCALL_NR] = -1; + if (test_thread_flag(TIF_SYSCALL_TRACE)) { + if (tracehook_report_syscall_entry(regs)) + regs->regs[TREG_SYSCALL_NR] = -1; } + if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) + trace_sys_enter(regs, regs->regs[TREG_SYSCALL_NR]); + return regs->regs[TREG_SYSCALL_NR]; } void do_syscall_trace_exit(struct pt_regs *regs) { - tracehook_report_syscall_exit(regs, 0); + if (test_thread_flag(TIF_SYSCALL_TRACE)) + tracehook_report_syscall_exit(regs, 0); + + if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) + trace_sys_exit(regs, regs->regs[TREG_SYSCALL_NR]); } void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code) -- cgit From adf6d9b30f089c52e674e84ca2960581e504e5e3 Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Fri, 1 Feb 2013 12:37:48 -0500 Subject: tile: support atomic64_dec_if_positive() Use the normal cmpxchg() idiom to implement this functionality. Signed-off-by: Chris Metcalf --- arch/tile/Kconfig | 1 + arch/tile/include/asm/atomic.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'arch/tile/Kconfig') diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index 0e500d90c2a0..9a9d08637ab9 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig @@ -24,6 +24,7 @@ config TILE select MODULES_USE_ELF_RELA select HAVE_ARCH_TRACEHOOK select HAVE_SYSCALL_TRACEPOINTS + select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE # FIXME: investigate whether we need/want these options. # select HAVE_IOREMAP_PROT diff --git a/arch/tile/include/asm/atomic.h b/arch/tile/include/asm/atomic.h index f2461429a4a4..e71387ab20ca 100644 --- a/arch/tile/include/asm/atomic.h +++ b/arch/tile/include/asm/atomic.h @@ -131,4 +131,25 @@ static inline int atomic_read(const atomic_t *v) #include #endif +#ifndef __ASSEMBLY__ + +static inline long long atomic64_dec_if_positive(atomic64_t *v) +{ + long long c, old, dec; + + c = atomic64_read(v); + for (;;) { + dec = c - 1; + if (unlikely(dec < 0)) + break; + old = atomic64_cmpxchg((v), c, dec); + if (likely(old == c)) + break; + c = old; + } + return dec; +} + +#endif /* __ASSEMBLY__ */ + #endif /* _ASM_TILE_ATOMIC_H */ -- cgit From 1dda7bbe113ad9f314c382e8309928e557361222 Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Thu, 21 Mar 2013 20:12:19 +0100 Subject: tile: remove two outdated Kconfig entries Tile support got added in v2.6.36. Its main Kconfig file was added with two outdated Kconfig entries. DEFAULT_MIGRATION_COST is unused since v2.6.23, and SEMAPHORE_SLEEPERS is unused since v2.6.26. Remove these outdated entries now. Signed-off-by: Paul Bolle Signed-off-by: Chris Metcalf --- arch/tile/Kconfig | 9 --------- 1 file changed, 9 deletions(-) (limited to 'arch/tile/Kconfig') diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index 9a9d08637ab9..d8885fd87603 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig @@ -43,9 +43,6 @@ config MMU config GENERIC_CSUM def_bool y -config SEMAPHORE_SLEEPERS - def_bool y - config HAVE_ARCH_ALLOC_REMAP def_bool y @@ -70,12 +67,6 @@ config HUGETLB_SUPER_PAGES config RWSEM_GENERIC_SPINLOCK def_bool y -# We have a very flat architecture from a migration point of view, -# so save boot time by presetting this (particularly useful on tile-sim). -config DEFAULT_MIGRATION_COST - int - default "10000000" - # We only support gcc 4.4 and above, so this should work. config ARCH_SUPPORTS_OPTIMIZED_INLINING def_bool y -- cgit From d9acae6baf41c0561f8c532b20cfd955fd1edc2d Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Fri, 22 Mar 2013 01:40:51 +0100 Subject: arch: remove KCORE_ELF again [tile] The Kconfig symbol KCORE_ELF was removed in v2.6.0, but reappeared in two architectures. It is useless. Remove it again. Signed-off-by: Paul Bolle Signed-off-by: Chris Metcalf (tile only) --- arch/tile/Kconfig | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch/tile/Kconfig') diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index d8885fd87603..7b82e68c5f55 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig @@ -414,11 +414,6 @@ endmenu menu "Executable file formats" -# only elf supported -config KCORE_ELF - def_bool y - depends on PROC_FS - source "fs/Kconfig.binfmt" endmenu -- cgit