[coyotos-dev] SMP Issue: load correct kernel stack on trap

Jeroen Visser jeroen.c.visser at gmail.com
Mon Oct 22 12:57:52 EDT 2007


On 10/22/07, Jonathan S. Shapiro <shap at eros-os.com> wrote:
> Yes. The problem is that during the user register save sequence we are
> on the wrong stack, so we need to load the current CPU pointer from the
> Process structure. My changes to interrupt.S from this morning should
> now do that properly.

The code is now also much clearer as to when the stack might switch
and when it is merely rewound. Thanks!

> Yes. Just so you know, our original plan there was to treat the cpu0 map
> as the "definitive" map, and copy entries from it on demand (in response
> to kernel page faults). This is simpler than what you were doing, but it
> is delicate.

I was initially going to crudely copy the cpu0 map (less per CPU
entry) in response to a kernel page fault, using a generation counter
associated with the cpu0 map to eliminate some unnecessary copies.

> Now that the kernel maps are not per-CPU, this is probably easier. The
> issue is that there are more layers (therefore more memory references)
> when you use PAE, and unless you have a large physical memory or you
> require NX support there is no real reason to accept the extra cost.

Understood.

-JCV


More information about the coyotos-dev mailing list