Steve Reinhardt wrote:
> On Wed, Sep 9, 2009 at 10:47 AM, Gabriel Michael Black
> <gbl...@eecs.umich.edu> 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 would work, except that you'd have to punch a readCR3 function
through all the *context classes and CPU classes between the producer
and consumer of that value. With templates, that all still happens, but
it's anonymous and doesn't make the actual text of the intermediary code
any less generic. I was actually thinking outside of the context of the
ISA parser, but independently it would be nice (not to be read as
necessary or necessarily worthwhile) to save the overhead there too.

Gabe
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to