Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Dominic Sweetman <dom@mips.com>
Cc: Nigel Stephens <nigel@mips.com>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	linux-mips@linux-mips.org
Subject: Re: c-r4k.c cleanup
Date: Fri, 4 Feb 2005 16:45:32 +0100	[thread overview]
Message-ID: <20050204154532.GA22217@linux-mips.org> (raw)
In-Reply-To: <16899.37525.412441.558873@gargle.gargle.HOWL>

On Fri, Feb 04, 2005 at 03:19:49PM +0000, Dominic Sweetman wrote:

> Only some CPUs suffer from aliases.  A 4Kbyte direct-mapped cache must
> be alias free, because all the virtual index bits are the same (being
> in-page) as the physical address bits.  That's true but irrelvant,
> since there aren't any 4Kbyte caches: but what's slightly less obvious
> is that a 16Kbyte 4-way set-associative cache is also alias free.

I had dark memory of some el cheapo CPU having 4k caches.

> 24K's "AR" bit trick applies *only* to the D-cache, and only to a
> 32Kbyte cache.  (But then most alias problems are D-cache aliases, and
> 32Kbyte happens to be the most popular size for a 24K cache - so this
> is a trick worth doing).
> 
> Note that I-cache aliases are not completely harmless; sometimes you
> want to invalidate any I-cache copies of some data, and if it's
> aliased you may miss some of them.  Shared libraries are generally
> aligned to some large page-size multiple - so multiple text images are
> usually the same colour, and don't matter.  You can get problems with
> trampolines and stuff.

Linux computes the necessary alignment on the fly.  The method used is
not strictly correct because as you say it should account for possible
I-cache aliases also.

Seems it's cache day again today ;-)

  Ralf

  reply	other threads:[~2005-02-04 15:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-04 14:12 c-r4k.c cleanup Atsushi Nemoto
2005-02-04 14:39 ` Nigel Stephens
2005-02-04 14:58   ` Ralf Baechle
2005-02-04 15:19     ` Dominic Sweetman
2005-02-04 15:45       ` Ralf Baechle [this message]
2005-02-04 15:53         ` Ralf Baechle
2005-02-04 17:51           ` David Daney
2005-02-04 17:49         ` Jun Sun
2005-02-07 10:24     ` Atsushi Nemoto
2005-02-07 12:32       ` Yoichi Yuasa
2005-02-07 14:04         ` Yoichi Yuasa
2005-02-07 12:36       ` Dominic Sweetman
2005-02-07 13:52         ` Dominic Sweetman
2005-02-07 21:49           ` Ralf Baechle
2005-02-07 21:36       ` 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=20050204154532.GA22217@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=dom@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=nigel@mips.com \
    /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