From mboxrd@z Thu Jan 1 00:00:00 1970 From: michi1@michaelblizek.twilightparadox.com (Michael Blizek) Date: Wed, 25 May 2011 17:18:48 +0200 Subject: Self modifying code in ARM 11 architectures In-Reply-To: References: Message-ID: <20110525151848.GA2085@michaelblizek.twilightparadox.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi! On 10:55 Wed 25 May , Mulyadi Santosa wrote: > Hi... > > On Tue, May 24, 2011 at 17:15, Ashok Babu 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