2 ms·
>Fun detail, this isn't unsafe anymore on x86! On x86, not x86-64, which has the syscall instruction, replacing interrupts for syscalls (technically x86 had sy
by zaarn 9y ago
>Fun detail, this isn't unsafe anymore on x86!
On x86, not x86-64, which has the syscall instruction, replacing interrupts for syscalls (technically x86 had sysenter)
The syscall instruction requires writing the address of the syscall function into the LSTAR MSR. Additionally, the syscall entry is purely naked, only the EIP and Segments are preserved and in a way that requires the caller to handle it.
Sysret is also particularly nasty in being unsafe in various ways, including being buggy on all Intel CPUs.
Atleast it's faster than interrupts and you don't technically need the -mno-redzone for it if it's not part of your interrupt handling code.