* Change restore_user_context() and fastpath_restore() to call POPF just before SYSEXIT. * Also change the way registers are loaded such that we don't access memory that is not guarded by the current position of the stack pointer. The reason for this change is that EFLAGS.TF, the Trap Flag, only takes effect on the instruction AFTER the instruction that sets EFLAGS.TF. The reason Intel/AMD did it this way is to allow the kernel to enable EFLAGS.TF for userspace, without it taking effect on kernel instructions BEFORE the CPU actually has returned to userspace. EFLAGS.TF enables single-stepping. So the full picture is that since we executed other instructions between POPF and SYSRET, those instructions were triggering single-stepping IN the kernel. To solve this, we must put POPF immediately before SYSRET. |
||
|---|---|---|
| .. | ||
| arm | ||
| x86/arch | ||