3 ms·
I don't really understand how it could be that problematic. It would only be an issue if there was a memory access in between the time the ptbr changes and the
by zhemao 11y ago
I don't really understand how it could be that problematic. It would only be an issue if there was a memory access in between the time the ptbr changes and the asid changes. But the instructions for manipulating CSRs don't access memory. If you had the instructions for changing these two registers one after another, there should be no intervening memory access. This might be broken if the CPU takes an interrupt, but interrupts are generally disabled during the context switch routine.
- brandmeyer 11y agoIn principle, the two instructions could cross a page boundary. Its a narrow corner case, but it is there.
- zhemao 11y agoOh yeah. Didn't think of that. Actually, just crossing a cache block boundary might be enough to trigger bad behavior.