Use sysretq in the syscall handler
Currently, IRETQ
is invoked when returning from the syscall handler, rather than SYSRETQ
. This may probably be somewhat slower.
To properly use SYSRETQ
, we would need to set bits 63:48 of the IA32_STAR
MSR, to the user segments in the GDT, and change some assembly (may be harder that it seems).