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

Re: [f-cpu] More Dark and Dusty Corners



Michael Riepe schrieb:
> On Mon, Sep 03, 2001 at 08:22:52PM -0400, nicO wrote:
> [...]
> > > First of all, how do we detect supervisor mode?  I guess there should be
> > > a special register indicating the current privilege level.  Bit 0 will
> > > be the `supervisor' bit, all other bits are reserved and must be zero
> > > (we can later refine the model to include specific privileges, similar
> > > to capabilities in the linux kernel).
> > 
> > Nice idea the capabilities ! It look like new protection scheme from new
> > designed OS.
> > 
> > But do you want to detect the mode by software or you speak from the
> > hardware point of view ? [...]
>
> I said "register", so I guess I meant hardware ;)  Whether user mode
> programs are allowed to read that register is currently unspecified.
NO they should NOT be allowed to read that register.
If a user mode program has a way of getting information about the internal state 
of the CPU, you can not do fast virtual machines. Any instruction which reveals 
whether its user mode or supervisor mode MUST trap while in user mode. 
A virtual machine works by keeping the CPU in user mode while sometimes tricking 
it into believing it is in supervisor mode. Instructions which would blow the 
masquerade are handle in the trap handler.

Thilo Reichelt


*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/