Ramon van Handel wrote:
>
> This morning (yes, in bed ;)) I was thinking about the two options for
> caching SBE-pages, and I got rather confused. For each code page, we have
> an "original" and a "scanned" code page.. (in addition to another page
> which has SBE info in it). It's the "scanned" page that is mapped at the
> corresponding physical
> address, right ?
>
> Let us pretend that we map pages r/w, and check for the dirty bit. If I'm
> not confused, then the page needs to be rescanned if it turns out the
> "scanned" page is dirty. However, how are we ever going to figure out WHAT
> the modifications are to the code page ? After all, the modifications were
> written to the "scanned" page, and we're rescanning from the "original"
> code page !!
>
> I have a feeling I'm confusing things terribly, will anybody help me out ?
Your understanding and observation is correct. The trade-off of
that option is that we have to trash the whole cache for
a vcode page if we find the dirty bit set.
As to when to dump the cache, we check before transferring
control to each vcode page. If clean, we can use the vcode
cache, if dirty we have to rescan.
The other option, gives us the opportunity to emulate
the instruction, and during the emulation of the write
to memory, we can invalidate only the small data area of
memory that got written to, rather than the whole page.
-Kevin