
Bringing Call Gates Back - 68c12c16
http://www.alex-ionescu.com/?p=340
======
brian_herman
I initially thought this had something to do with Bill Gates and Windows. But
it just has to do with Windows.

------
amluto
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.

~~~
aionescu
Got some numbers/public information? Would love to know more.

~~~
amluto
My old prototype is here:
[https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.g...](https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/lret-
to-userspace&id=05ce2ed5b8a1fc4465114000f222d0c60bf5ddaf)

------
yuhong
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.

~~~
dfox
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).

~~~
yuhong
And yes, older Unixes also often used call gates too, for example Solaris.

------
j_s
Seeing this 2010-era (per the referenced doc) vulnerability silently mitigated
triggers my spidey sense re: a pending Shadowbrokers leak...

