public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
	Tom Rini <trini@kernel.crashing.org>
Subject: Re: problem with cache flush routine for G5?
Date: Fri, 05 Mar 2004 12:21:36 -0500	[thread overview]
Message-ID: <4048B720.4010403@nortelnetworks.com> (raw)
In-Reply-To: 1078465612.5704.52.camel@gaston

Benjamin Herrenschmidt wrote:
>>Assuming that I really did want to flush the whole cache, how would I go 
>>about doing that from userspace? 
>>
> 
> I don't think you can do it reliably, but again, that do not make
> sense, so please check with those folks what's exactly going on.

I've gotten some more information on what's going on.

We have a proprietary OS (originally written for custom hardware) that 
is running on a thin emulation layer on top of linux.

This OS allows runtime patching of code.  After changing the 
instruction(s), it then has to make sure that the icache doesn't contain 
stale instructions.

The original code was written for ppc hardware that had the ability to 
flush the whole dcache and invalidate the whole icache, all at once, so 
that's what they used.  The code doesn't track the address/size of what 
was changed.  For our existing products, we are using the 74xx series, 
and they've got hardware cache flush/invalidate as well, so we just kept 
using that.  For the 970 however, that hardware mechanisms seem to be 
absent, which started me on this whole path.

After doing some digging in the 970fx specs, it seems that we may not 
need to explicitly force a store of the L1 dcache at all.  According to 
the docs, the L1 dcache is unconditionally store-through. Thus, for a 
brute-force implementation we should be able to just invalidate the 
whole icache, do the appropriate sync/isync, and it should pick up the 
changed instructions from the L2 cache.  Do you see any problems with 
this?  Do I actually still need the store?

Of course, the proper fix is to change the code in the OS running on the 
emulator to track the addresses that got changed and just do the minimal 
work required.

Chris

-- 
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com


  reply	other threads:[~2004-03-05 17:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-04 21:06 problem with cache flush routine for G5? Chris Friesen
2004-03-04 23:51 ` Benjamin Herrenschmidt
2004-03-04 23:57   ` Tom Rini
2004-03-05  0:04     ` Benjamin Herrenschmidt
2004-03-05  0:44       ` Chris Friesen
2004-03-05 15:15       ` Tom Rini
2004-03-05 23:51         ` Benjamin Herrenschmidt
2004-03-05  0:37   ` Chris Friesen
2004-03-05  2:10     ` Benjamin Herrenschmidt
2004-03-05  5:39       ` Chris Friesen
2004-03-05  5:46         ` Benjamin Herrenschmidt
2004-03-05 17:21           ` Chris Friesen [this message]
2004-03-05 23:53             ` Benjamin Herrenschmidt
2004-03-06  1:34             ` Segher Boessenkool
2004-03-06  2:31             ` Anton Blanchard

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=4048B720.4010403@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trini@kernel.crashing.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox