On Dec 12, 2007 6:00 PM, Marc Jones marc.jones@amd.com wrote:
There are a couple ways to address this.
- copy the stack to a new location.
- Set the tags dirty with by writing the way MSRs.
- enable the cache and copy the stack back on it's self to dirty the tags.
I am least sure about number three.
Here is one idea.
Copy the stack to "somewhere" in real memory, not "CAR memory". Disable CAR. Enable the cache. Copy the stack back.
in fact, we could define disable_car as follows: void disable_car(void *savestack) { memcpy(savestack, &savestack, 4096); /* copy stack to "savestack" in real memory */ /* turn off car */ /* enable cache */ /* problem: how do we invd without losing savestack variable? */ /* one option is to ALWAYS save the stack to page 0 */ memcopy(&savestack, savestack, 4096);
Something like this might work. We're saving the stack to memory, enabling cache, and copying it back. What do you think?
ron