linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* self-modifying code in 2.6 kernel for ppc writes into readonly section
@ 2008-08-18 16:01 Mihaela Grigore
  2008-08-18 19:19 ` Michael Neuling
  0 siblings, 1 reply; 10+ messages in thread
From: Mihaela Grigore @ 2008-08-18 16:01 UTC (permalink / raw)
  To: linuxppc-dev

Hello,

First, I'm talkin about the 2.6.11 version. I know arch/ppc is gone in
latest versions,
but i assume the code is still the same and just moved to powerpc.

There is a piece of code in the early initialization of the 2.6 kernel
that identifies the cpu type and then tries to eliminate code that
does not apply to the current cpu. This is done by writing nop's over
sections of code that are not needed (do_cpu_ftr_fixups in
arch/ppc/kernel/misc.S)

When I try to run the kernel in a ppc emulator, I get a segmentation
fault in do_cpu_ftr_fixups. From examining the section headers of the
vmlinux, the text section is marked as readonly. The piece of code
above mentioned is trying to write a nop to memory location inside the
text section which is readonly, so that explains the sigsegv  error.

Since the kernel does run on boards with ppc cpu's, can somebody
explain how come this is actually working ? Or if/where I am mistaking
with my assumptions ?

Thank you

P.S. please add me in cc in a reply to this message

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-08-18 23:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-18 16:01 self-modifying code in 2.6 kernel for ppc writes into readonly section Mihaela Grigore
2008-08-18 19:19 ` Michael Neuling
2008-08-18 19:57   ` Mihaela Grigore
2008-08-18 20:51     ` Michael Neuling
2008-08-18 21:25       ` Becky Bruce
2008-08-18 22:07         ` Mihaela Grigore
2008-08-18 23:33           ` Michael Neuling
     [not found]       ` <78ef7ce10808181427m507434f4we84d507b090a707b@mail.gmail.com>
2008-08-18 22:09         ` Michael Neuling
2008-08-18 22:13           ` Scott Wood
2008-08-18 22:18             ` Michael Neuling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).