Runtime code modification fails on arm

Jamie Lokier jamie at shareable.org
Tue Nov 10 08:17:30 EST 2009


Papalagi Pakeha wrote:
> Does anyone have an idea what could be wrong here? Why does it work on
> x86 but fails to pick up the decrypted instructions on ARM? FWIW we
> use Samsung S3C2410 with kernel 2.6.27 and gcc 4.2.4 with glibc 2.3.3
> toolchain.

On ARM, you have to flush the cache whenever you modify code, or even
generate code in a new area.  There is a system call for this.

Only the cache covering the modified range needs to be flushed.  It
must clean the D-cache and flush the I-cache.

You have to do this on several other architectures too.  x86 is
unusual in not needing it.

-- Jamie
 



More information about the linux-arm-kernel mailing list