Ulrich Weigand wrote:
> 
> Kevin Lawton wrote:
> 
> > A question.  For a system call from user code which
> > is serviced in the kernel and returns without rescheduling
> > another process, which guest OSes can do this without
> > reloading CR3?
> 
> Well, most of them, I'd hope ;-)  Linux definitly can, and so can
> Windows 95/98.  I'd assume that Windows NT also avoids reloading
> CR3 for most system calls, except those that need to call the
> subsystem server process ...

I hope so too.  Wasn't sure if any of the Windows variants
suffered some braindeath here.

The reason I asked was as follows.  I have
to rebuild the monitor page tables dynamically upon CR3
reload, and if we are running all guest code at CPL3, then
upon a privilege level transition.  The reason for the second
case is that the page permissions have to be tailored for
the current guest (requested) privilege level.

If most OSes are good at transitioning from CPL3-->CPL0-->CPL3
for a normal system call without anything special happening,
then we could gain some performance by running guest code
like this:

guest  0--+      monitor
          +-- 1

       3----- 3

This way we the same page tables can be used for either CPL
level, since the natural paging permissions will work.  I'm
not going to add this to plex86 at the moment, but it is worth
looking into in the future.  We would save 2 page table rebuilds
for each simple system call.  We talked about this awhile ago
on the list.  There's some issues surrounding running guest
code at ring1, but I think they can be solved.


-Kevin

Reply via email to