[Top] [All Lists]

Re: using mprotect to write to .text

To: David Daney <>
Subject: Re: using mprotect to write to .text
From: Ralf Baechle <>
Date: Wed, 12 Oct 2011 00:17:35 +0100
Cc: Joe Buehler <>,
In-reply-to: <>
References: <> <> <> <> <> <>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Oct 11, 2011 at 11:43:20AM -0700, David Daney wrote:

> 1) cacheflush() clears all hazards.

More by accident than design - when I wrote the cacheflush syscall and
manpage in 1995 the term execution hazard barrier didn't yet exist in
manuals though the CPU behaviour was documented in the R4000 / R4600
manual of those days as a small number of pipeline cycles required to
handle.  The return patch of the syscall was taking care of this
implicitly.  And today the required R2 hazard barrier is provided by
the ERET instruction of the return path, so everything is fine.

But it may be worth updating the man page.  A change every 15 years or
so isn't that bad ;-)


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