Self modifying code in ARM 11 architectures
Michael Blizek
michi1 at michaelblizek.twilightparadox.com
Wed May 25 11:18:48 EDT 2011
Hi!
On 10:55 Wed 25 May , Mulyadi Santosa wrote:
> Hi...
>
> On Tue, May 24, 2011 at 17:15, Ashok Babu <ashok3d at gmail.com> wrote:
> > So here my questions/doubts :
> > 1) Is'nt it the kernel itself is self modifying code with lots of function
> > pointers ?
>
> AFAIK, yes there are many.. however, some of them, even in the form of
> pointer assignment, are rarely changing.
>
> But if it is changing, for sure cache needs to be flushed/invalidated.
> This is especially true in SMP environment ( and don't forget memory
> barrier....)
This sounds like a very interesting arch to me. I would very much like to see
any code which does cache flushing when changing a function pointer. In the
mean time, let us assume that function pointers are data, not code. ;-) Then,
you still have to think about concurrency, but not about cache flushing.
What could cause trouble:
- http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html - This requires an
executeable stack - never tested whether kernel stacks are executable. No idea
if something makes them executable.
- Assembly code in arch/ , like the tracing framework.
- ???
-Michi
--
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com
More information about the Kernelnewbies
mailing list