[PATCH -tip v6 24/27] bpf: error-inject: kprobes: Clear current_kprobe and enable preempt in kprobe

2018-06-19 Thread Masami Hiramatsu
Clear current_kprobe and enable preemption in kprobe even if pre_handler returns !0. This simplifies function override using kprobes. Jprobe used to require to keep the preemption disabled and keep current_kprobe until it returned to original function entry. For this reason kprobe_int3_handler()

[PATCH -tip v6 15/27] ARC: kprobes: Don't call the ->break_handler() in ARC kprobes code

2018-06-19 Thread Masami Hiramatsu
Don't call the ->break_handler() from the ARC kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- arch/arc/kernel/kprobes.c |7 --- 1 file changed, 7 deletions(-) diff --git a/a

[PATCH -tip v6 04/27] ARC: kprobes: Remove jprobe implementation

2018-06-19 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/arc. Signed-off-by: Masami Hiramatsu Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- arch/arc/include/asm/kprobes.h |2 -- arch/arc/kernel/kprobes.c | 38 ++--

[PATCH v2] ARC: Improve cmpxchg syscall implementation

2018-06-19 Thread Alexey Brodkin
From: Peter Zijlstra arc_usr_cmpxchg syscall is supposed to be used on platforms that lack support of Load-Locked/Store-Conditional instructions in hardware. And in that case we mimic missing hardware features with help of kernel's sycall that "atomically" checks current value in memory and then

Re: [PATCH] ARC: Improve cmpxchng syscall implementation

2018-06-19 Thread Peter Zijlstra
On Mon, Mar 19, 2018 at 02:00:02PM +0300, Alexey Brodkin wrote: > diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c > index 5ac3b547453f..d7d3e16133d6 100644 > --- a/arch/arc/kernel/process.c > +++ b/arch/arc/kernel/process.c > @@ -47,7 +47,9 @@ SYSCALL_DEFINE0(arc_gettls) > SYSCA

Re: [PATCH] ARC: Improve cmpxchng syscall implementation

2018-06-19 Thread Alexey Brodkin
Hi Vineet, On Wed, 2018-04-18 at 11:16 -0700, Vineet Gupta wrote: > On 03/21/2018 04:54 AM, Alexey Brodkin wrote: > > /* > > > > * This is only for old cores lacking LLOCK/SCOND, which by > > > > defintion > > > > @@ -60,23 +62,48 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, >