4 ms·
I'm not very knowledgeable about x86, but why do they have to use the debug registers if they're slower? I know in GCC you can mark registers as "do not touch"
by rthomas6 13y ago
I'm not very knowledgeable about x86, but why do they have to use the debug registers if they're slower? I know in GCC you can mark registers as "do not touch" when you write assembly in C. Why not use more general purpose registers?
- mikeash 13y agoBecause the idea is to run it in kernel mode with arbitrary other software running on the computer. Asking other software to pretty please don't touch these specific registers isn't going to work, because there's no way to enforce that. The debug registers are perfect because they can only be accessed from kernel mode, not userland.
- tptacek 13y agoRegisters you ask the compiler not to touch are still flushed to RAM on context switches, which defeats the purpose of this system.