On Wed, Sep 9, 2009 at 10:47 AM, Gabriel Michael Black
<[email protected]> wrote:
> As far as how often those functions are called, the read one will be called
> fairly often for address translation, and potentially in the predecoder
> depending on the ISA. The writing one is likely called substantially less
> often.

If I understand this correctly, a lot of the overhead you're concerned
about is the recurring accesses outside of instructions (e.g., when
the page-table walker needs to read CR3 to figure out where to start
its walk).  That makes sense to me that some of those could occur
often enough to incur noticeable overhead.

What about a hybrid solution that addresses these common problems
without causing a rearchitecting of how accesses work in the ISA
parser?  Loosely speaking, something like this:

int readCR3() { return cr3; }

readMiscReg(int index) {
  switch (index) {
    [...]
    case CR3index: return readCR3();
    [...]
  }
}

So now when you're in the page table walker you can just call
readCR3(), but instruction-based accesses can still use the regular
method, and yet all the accesses still go through a common function at
the lowest layer.

> That reminds me. Why do we have a convention of read/set? Why not read/write
> or set/get? It seems a little asymmetric, but admittedly probably not
> important enough to change in any case.

I expect it's just historical... I don't have a strong opinion about it.

Steve
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to