[Top] [All Lists]

Re: using mprotect to write to .text

To: David Daney <>
Subject: Re: using mprotect to write to .text
From: Joe Buehler <>
Date: Tue, 11 Oct 2011 13:31:54 -0400
Authentication-results:; none
In-reply-to: <>
References: <> <>
User-agent: Thunderbird (X11/20090114)
David Daney wrote:

> No, it does nothing of the sort.  You need cacheflush() for that.

OK, I looked at cacheflush and it can be used to flush the icache on all
CPUs, which is what I want.  My current code sequence is more than that
however.  Something like this:

        uint64_t tmp;
        asm volatile ("    la %0,10f\n"
                  "    jr.hb %0\n"
                  "    nop\n"
                  "    10:\n" : "=r" (tmp) : : "memory");

I can certainly modify cacheflush for my application so the extra hazard
clearing is done when icache is flushed.  Is there any way to avoid that
and use existing kernel functionality?

Joe Buehler

<Prev in Thread] Current Thread [Next in Thread>