All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Buehler <aspam@cox.net>
To: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Subject: Re: using mprotect to write to .text
Date: Tue, 11 Oct 2011 13:31:54 -0400	[thread overview]
Message-ID: <4E947D8A.9090409@cox.net> (raw)
In-Reply-To: <4E9470A1.8020309@cavium.com>

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:

	CVMX_ICACHE_INVALIDATE;
	CVMX_SYNC;
	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

  reply	other threads:[~2011-10-11 17:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 20:02 using mprotect to write to .text Joe Buehler
2011-10-11 16:36 ` David Daney
2011-10-11 17:31   ` Joe Buehler [this message]
2011-10-11 18:06     ` David Daney
2011-10-11 18:35       ` Joe Buehler
2011-10-11 18:43         ` David Daney
2011-10-11 23:17           ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E947D8A.9090409@cox.net \
    --to=aspam@cox.net \
    --cc=david.daney@cavium.com \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.