[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rep:Re: Rep:Re: [f-cpu] TLB resume



hi,

Michael Riepe wrote:
> 
> On Sat, Aug 10, 2002 at 03:53:08AM +0200, Yann Guidon wrote:
> > Michael Riepe wrote:
> > > On Fri, Aug 09, 2002 at 07:58:42AM +0200, Yann Guidon wrote:
> > > [...]
> > > > In Bordeaux, there was an idea of adding an instruction that would
> > > > return the access rights and mapping associated to a pointer.
> > >
> > > Uh... Intel-style :(
> >
> > ??
> 
> The ia32 has a similar instruction, IIRC.

so what ? they also do additions, multiplies, register moves...

The idea here is that one could read the "hidden flags"
associated to a pointer/register. When it comes to the other
flags (MSB, Zero etc) they are implicitly available through
the conditional instructions. I don't think it's overly complex
to do a "pointer test" instruction because load and store are
also conditional instructions, though more complex :
 - is the register marked as a pointer
 - is it valid
 - is the associated data present
 - what access rights are granted (R,W,RW or X) to current process.

Here are what these flags indicate :

* if the register is not marked as pointer, a load/store/jump
will perform some synching cycles (pass the register value
through TLB then compare the address with the LSU/Fetcher entries.
* if it is not valid, any access (load/store/jump) will trigger
a trap.
* if the data is present, the load/store/jump instruction will
not stall.
* if the access right is
  R -> store and jump will trap (protection error)
  W -> load and jump will trap
  RW-> jump will trap
  X -> load and store will trap
Note : in FC0, aliases between the LSU and the fetcher give
potentially wrong results -> the presence must be exclusive,
or the whole system breaks. but i presume nobody will make
self-modifying code, right ? So we can spare 1 bit and encode
the allowed rights in 2 bits only. The same remark also
applies to the TLB entries. OOOPs, i shouldn't have
written that... it'll trigger a lot of mails again
and i was quietly programming some useful software :-)


>  Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
WHYGEE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/