Re:Bringing Call Gates Back
by amluto on Wednesday August 09, 2017 @11:13PM
(#14976013)
64-bit call gates may well be useless, but the corresponding return instruction (LRETQ or whatever you want to call it) can be useful. I have prototype Linux code to use it instead of IRET, and it's considerably faster.
Re:Bringing Call Gates Back
by yuhong on Tuesday August 08, 2017 @12:31PM
(#14959526)
The fun thing is that I found out that these 64-bit call gates are rarely used. Because it does not disable interrupts for example.
Back when AMD was developing x86-64, they were probably focusing on Linux which did not use call gates.
Re:Bringing Call Gates Back
by dfox on Wednesday August 09, 2017 @01:15PM
(#14971384)
The fact that call gates does not disable interrupts is usually the desired behavior. Linux (and NT for 32 bit code) does not use call gates because they are not that useful for OSes that target the Unix/C flat memory model. You can probably use call gates to implement particularly fast IPC mechanism with semantics similar to QNX's message passing. But probably only real users of call gates are DOS extenders and 32 bit windows for 32/16b thunking (which is to large extent the same use case of mixing 32/16b code in single process).
Re:Bringing Call Gates Back
by yuhong on Wednesday August 09, 2017 @04:09PM
(#14973098)
When SYSCALL added EFLAGS masking, SWAPGS was also created with the assumption that it would be always done when going between kernel and user mode and before enabling interrupts.