>This is actually a general problem, and is caused by this situation:
[snip]
Yes, I noticed that and tryed to fix that. But then came the
questions you saw... ;)

>To implement this correctly would probably require to create 
>'shadow' GDT selectors that contain the old descriptors that
>are to be loaded into the descriptor cache, and change the guest
>segment register to those shadow selectors when emulating lgdt.
My idea was to leave these descriptors untouched, which were
referenced by segment selectors. If these descriptors in the new
table doesn't change, it's ok. If one or more descriptors change,
the guest will try to load them in selectors. This case can
be caught by setting DPL to a lower than 3 value. Now we can
emulate selector loading and update monitors GDT. The new
descriptors to insert are still stored in guests GDT.
One disadvantage of this is, that the guest may read a different
GDT than it wrote. But currently we have more such guest-sees-
different-things-problems, with emulating of sgdt we should
rethink about GDT loading - and storing ;)

jens

Reply via email to