[Gems-users] When to invalidate instruction (trace) cache?


Date: Sun, 9 Dec 2007 00:32:30 -0500
From: "Eirik Bakke" <ebakke@xxxxxxxxxxxxx>
Subject: [Gems-users] When to invalidate instruction (trace) cache?
We are implementing/simulating a Trace Cache [1] in ruby. While an
instruction cache stores sequences of instructions in the order they are
stored in memory (static order), the Trace Cache stores sequences of
instructions in the order they are fetched and executed (dynamic order).
Most of our changes are limited to "opal/system/pseq.C".

Since the Trace Cache is indeed a cache that is supposed to reflect data in
memory (instructions), it must be flushed every now and then. In particular,
it must be flushed whenever instructions are loaded for the first time (into
a location which potentially could have contained other instructions
before). According to [2], SPARC requires that a FLUSH instruction is issued
before newly loaded instructions are executed, to flush the instruction
cache. If this is the case, we can simply flush entries in the Trace Cache
at the same time. However, [3] seems to indicate that there are several
other more obscure methods that software may use to achieve the same effect.

When is the correct time to flush instructions from an instruction or trace
cache? Where is the best spot to hook into this in opal?

Eirik & Evan

[1] www.tinker.ncsu.edu/ericro/publications/conference_MICRO-29_rbs.pdf
[2] http://bugs.opensolaris.org/view_bug.do?bug_id=1238184
[3] http://www.sparc.org/standards/sparc64.errata.txt

[← Prev in Thread] Current Thread [Next in Thread→]