How clear and invalidate ARM v7 processor cache from User Mode on Linux 2.6.35

前端 未结 1 2076
清酒与你
清酒与你 2020-12-01 13:16

I tried clear and invalidate ARM v7 processor cache for instruction line, because instruction codes can change in execution.

For reaching the effect, I tried 2 varia

相关标签:
1条回答
  • 2020-12-01 13:50

    I had a similar problem myself. __clear_cache() works, but only if the memory area in question was allocated using mmap() with PROT_EXEC set. Linux will not flush the instruction cache if you provide it with a memory range that comes from regular malloc()ed memory, even if the processor seems to be happy to execute code from malloc()ed memory.

    See https://community.arm.com/groups/processors/blog/2010/02/17/caches-and-self-modifying-code for example code on how to do this.

    0 讨论(0)
提交回复
热议问题