New SYSCALL instruction (was: Re: Call Gates)

S.Boessenkool (sboessen@wi.leidenuniv.nl)
Fri, 20 Jun 1997 15:19:25 +0200 (MDT)


[explanation about LDT desc's snipped]

> The way chosen for linux is a bit more hacky, but it has some advantages.
> Linux uses a user-triggered interrupt; the system call is an "int $80".
> I think it might be a bit slower, but it saves the flags automatically,
> allow all types of travels between rings, and this opcode is much smaller
> than the "call 0007:00000000" one (2 bytes vs 7).
> It also has the great characteristic of switching to a kernel stack, as it
> would be really BAD is the kernel had to rely on the user-level stack.

All newer pentiums & pro's, and the K5 and K6 have the newer SYSCALL/SYSRET
instructions: 2 byte opcode, and upon entry to the system only cs and the stack
are reloaded. This is very fast :-) Anyone looking into implementing this as
an alternative to int $80 in the linux kernel? A lot of syscalls can do without
to much protection :-)

btw, this instructions are described in detail in the K6 databook...

**Seegh
--------------------
Segher Boessenkool, Arnhem, Holland