[PATCH] [RFC PATCH] ARM: kprobes: Make breakpoint setting/clearing SMP safe

Rabin Vincent rabin at rab.in
Wed Oct 12 12:33:34 EDT 2011


On Tue, Jul 12, 2011 at 18:10, Tixy <tixy at yxit.co.uk> wrote:
> Both these issues are known and the kprobe implementation uses
> stop_machine() to avoid them, however, this is not sufficient.
> stop_machine() does not perform any kind on synchronisation between CPUs
> so it it still possible for one CPU to call the breakpoint changing
> function before another CPU has been interrupted to do likewise.
>
> To fix this problem, this patch creates a new function
> sync_stop_machine() which ensures that all online CPUs execute the
> specified function at the same time.

AFAICS stop_machine() already does what you want.  When you use
stop_machine(), the actual call to your function is done (on each
CPU's stopper thread) using the stop_machine_cpu_stop() function,
which already has the synchronization between CPUs which you're
trying to do here.



More information about the linux-arm-kernel mailing list