Kevin P. Lawton wrote:

> Ramon van Handel wrote:
> >
> > Kevin P. Lawton wrote:
> > > Mark pages in question with read-only.  Now guest code
> > > running at ring1 will generate exceptions, but interrupt
> > > code will run.
> >
> > Hey wait a moment... as far as I know, when you've got
> > WP set in CR0 then *every* piece of code will trap on
> > writing to R/O pages.  Is this not true ?
>
> Yes, this is my understanding.  It's what you would want,
> ring1 and ring3 guest code generating exceptions upon
> writes to r/o protected pages.  The monitor could do CR0.WP=0
> to be able to modify without an exception.

Oh yeah... that does make sense :).  Didn't think of that.
We could do it on demand I guess.. sort of like linux handles
FPU state saving.  That way there's less overhead (how many
cycles is reloading %cr0 ?)

Ramon




Reply via email to