[FIX] __switch_to for ARM 29/73329/3
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 6 Jun 2016 19:01:35 +0000 (22:01 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 10 Jun 2016 18:10:40 +0000 (21:10 +0300)
Change-Id: I6e0a18d2f73d80260e02eeb5d5817ff0f953c827
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
kprobe/arch/arm/swap-asm/swap_kprobes.c

index ba7deb0..4006855 100644 (file)
@@ -369,6 +369,10 @@ static int kprobe_handler(struct pt_regs *regs)
 {
        struct kp_core *p, *cur;
        struct kp_core_ctlblk *kcb;
+       struct kctx *ctx = current_kctx;
+
+       if (regs->ARM_pc == sched_addr)
+               switch_to_bits_set(ctx, SWITCH_TO_KP);
 
        kcb = kp_core_ctlblk();
        cur = kp_core_running();
@@ -414,6 +418,8 @@ static int kprobe_handler(struct pt_regs *regs)
                goto no_kprobe;
        }
 
+       switch_to_bits_reset(ctx, SWITCH_TO_KP);
+
        return 0;
 
 no_kprobe:
@@ -569,6 +575,7 @@ void swap_arch_prepare_kretprobe(struct kretprobe_instance *ri,
                ptr_ret_addr = (unsigned long *)&tinfo->cpu_context.pc;
                ri->sp = NULL;
                ri->task = tinfo->task;
+               switch_to_bits_set(kctx_by_task(tinfo->task), SWITCH_TO_RP);
        } else {
                ptr_ret_addr = (unsigned long *)&regs->ARM_lr;
                ri->sp = (unsigned long *)regs->ARM_sp;