Re: [PATCH] Add a text_poke syscall

From: Steven Rostedt
Date: Thu Nov 21 2013 - 08:07:30 EST


On Tue, Nov 19, 2013 at 08:10:34PM +0100, Andi Kleen wrote:
>
> Self modifying code is by definition x86 specific.

How so? Ftrace works on several archs, and does so with self modifying code.

>
> Very likely any other method to do this would be Linux specific
> in some form or another, as there doesn't seem to be any
> existing art.

Seems you need to solve a catch-22 on this. You need to show that there's a
need (application), that requires this new feature and also show that all the
existing kernel features are inefficient for what is needed.

The catch-22 may be that a application wont be created without the feature,
but that's the problem you need to solve.

Personally, I rather see the userspace patching be completele separate from
the kernel space patching, as the kernel space patching must not be
complicated by any requirement of userspace patching.

I don't see how userspace doesn't need anything but a CPU sync call to do
the required sync. Add a breakpoint, sync, change the code, sync, remove
breakpoint, done!

And as a bonus, doing this in userspace could easily extend it. Say you want
to do special things with that breakpoint handler.

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/