Linux MIPS Architecture development
 help / color / mirror / Atom feed
* VCE question
@ 1998-05-18 11:35 ralf
  1998-05-18 16:26 ` William J. Earl
  0 siblings, 1 reply; 2+ messages in thread
From: ralf @ 1998-05-18 11:35 UTC (permalink / raw)
  To: linux, linux-mips, linux-mips

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?

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: VCE question
  1998-05-18 11:35 VCE question ralf
@ 1998-05-18 16:26 ` William J. Earl
  0 siblings, 0 replies; 2+ messages in thread
From: William J. Earl @ 1998-05-18 16:26 UTC (permalink / raw)
  To: ralf; +Cc: linux, linux-mips, linux-mips

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-05-18 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-05-18 11:35 VCE question ralf
1998-05-18 16:26 ` William J. Earl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox