linux-mips
[Top] [All Lists]

Re: using mprotect to write to .text

To: David Daney <david.daney@cavium.com>
Subject: Re: using mprotect to write to .text
From: Ralf Baechle <ralf@linux-mips.org>
Date: Wed, 12 Oct 2011 00:17:35 +0100
Cc: Joe Buehler <aspam@cox.net>, linux-mips@linux-mips.org
In-reply-to: <4E948E48.60205@cavium.com>
References: <loom.20111010T215444-70@post.gmane.org> <4E9470A1.8020309@cavium.com> <4E947D8A.9090409@cox.net> <4E948593.6030604@cavium.com> <4E948C62.3000802@cox.net> <4E948E48.60205@cavium.com>
Sender: linux-mips-bounce@linux-mips.org
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 ;-)

  Ralf

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