Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "William J. Earl" <wje@fir.engr.sgi.com>
To: ralf@uni-koblenz.de
Cc: linux@cthulhu.engr.sgi.com, linux-mips@vger.rutgers.edu,
	linux-mips@fnet.fr
Subject: Re: VCE question
Date: Mon, 18 May 1998 09:26:25 -0700	[thread overview]
Message-ID: <199805181626.JAA20630@fir.engr.sgi.com> (raw)
In-Reply-To: <19980518133553.34099@uni-koblenz.de>

ralf@uni-koblenz.de writes:
 > I don't have a machine with a SC CPU, so I hopbe somebody of you can
 > help me -- the manuals of the R4000 / R4400 documents that the L2 cache
 > is tagged with bits 12-14 of the virtual address.  This is somewhat
 > strange because only cache-size / 4kb bits are required to avoid virtual
 > aliases.  That would be 1 bit for the R4000SC and 2 bits for the R4400SC.
 > 
 > Question: will the R4000SC/R4400SC actually verify 3 bits or only the
 > one rsp. two bits which need to be checked?

     Yes, they verify all 3 bits.  You can have a VCE handler, even for
kernel stacks, if you are very careful in the general exception handler.
(The VCE handler does writeback invalidate on the primary data cache and
an invalidate on the primary instruction cache for the offending address,
and then does a hit-set-virtual on the secondary cache; alternately, somewhat
more slowly, but more simply, the handler does a writeback invalidate on the
secondary cache.)  Of course, you still have to arrange to have only
one virtual color valid at a time for a given physical page to make
the R4000PC, R4600, and R5000 work correctly.  On the other hand, if you
can arrange that, including flushing the cache appropriately when changing
the current virtual color of a physical page, you will never get a VCE
(assuming you treat the R4000SC and R4400SC has having 8 colors, not 2 or
4).  

     On the other processors, where VCE is not detected, you can
further optimize the code by allowing for multiple virtual colors for
read-only pages, invalidating all conflicting mappings when a
read-write mapping is required.  IRIX does this in 6.3 and 6.5.  We
don't break the mappings; we just turn off pg_vr in the PTEs.  When we
get a fault on one of the software-valid, hardware-invalid mappings,
we do an ownership switch, turning off the mappings for the current
color and changing the current color to the desired one.  This of
course requires appropriate cache cleaning for the whole page.
By comparison, the R4000SC/R4400SC VCE handler works just one cache
line at a time.

      reply	other threads:[~1998-05-18 16:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-18 11:35 VCE question ralf
1998-05-18 16:26 ` William J. Earl [this message]

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=199805181626.JAA20630@fir.engr.sgi.com \
    --to=wje@fir.engr.sgi.com \
    --cc=linux-mips@fnet.fr \
    --cc=linux-mips@vger.rutgers.edu \
    --cc=linux@cthulhu.engr.sgi.com \
    --cc=ralf@uni-koblenz.de \
    /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