[PATCH] ARM: kprobes: only patch instructions on one CPU
Rabin Vincent
rabin at rab.in
Tue Oct 25 11:36:52 EDT 2011
On Thu, Oct 13, 2011 at 10:07:32AM +0100, Tixy wrote:
> As I said in my reply to the other mail, I had missed the fact that it
> is stop_machine_cpu_stop() which is used to call our function, and this
> synchronises all cores. Therefore, this patch is correct, assuming that
> a flush_icache_range executed on one core also flushes I-caches on other
> cores. (I'm a bit doubtfull of this as I beleive that at least
> ARM11MPCore requires this to be managed in software and I can't find any
> code that handles this.)
If we want kprobes to work correctly on ARM11MPCore, shouldn't we need
to broadcast the invalidate in arch_prepare_kprobe() and the
non-stop-machine-using parts of arch_arm_kprobe() too?
Also, it seems odd to perform the instruction write and
flush_icache_range() on every CPU from stop_machine(). Perhaps it would
be better if there were a way in stop_machine() to call an I-cache
invalidation function on all CPUs, after the arm/disarm function is
called on only one of them.
More information about the linux-arm-kernel
mailing list