Jens Nerche wrote:
> Well, at weekend I had a closer look on Kevins new code. Great
> work!
> Some questions:
> * In phymem.c you mention "UC mem aeas" - what does the
> "UC" mean? (in whole words? ;)
UnCacheable memory. This is a region of memory that the
CPU may not cache, because what you write may not be what
you read. An adapter card may have a region of memory mapped
IO for instance, like the VGA. In this case, we want plex86
to redirect memory reads/writes to the code which emulates
that device etc. Though for text mode VGA, we can cheat
and just sample memory every now and then, since what you
write is what you read.
> * You took an extra cache as segemnt selector cache and used not
> free entries in GDT, right?
In SBE mode, I use one descriptor in the monitor GDT to represent
what would be in the descriptor cache for each of DS/SS/CS/ES/FS/GS.
Then point the selector value at that cache descriptor. Since
we're virtualizing reads of the selector, the guest doesn't
see this different value.
> * Is overlapping code a bug or a feature? Does Intel encourage
> or discourage this technique?
Just a side-effect of having highly variably sized instructions
which can execute on non-aligned boundaries. You have to be
ready to execute anything, anywhere. Pretty crappy architecture.
No idea if this is discouraged or not.
> I suggest to make some things to variables, they can configured
> in plex86.conf - such as page cluster size and MAX_PRESCAN_DEPTH.
Sounds reasonable for prescan_depth. Perhaps for cluster
size - have to see about that one when we get there.
>
> I've no idea, how often such dangerous instruction we are looking
> for with SBE are in the code of common os'es. Perhaps we should
> gather some information about this. If they are not so often
> and some or many pages are free from them, we could find and
> mark whole pages as "clean". Yes, this works only without
> overlapping code...
All code pages with code paths we haven't scanned
or which branch out of the page (or which branch to calculated
offsets) are in a sense 'dirty' because of the unknown.
This is pretty much every code page. What exactly was your
intent for a 'clean' page?
-Kevin