Re: [PATCH] x86-32: A better system call mechanism

From: Willy Tarreau
Date: Sun Apr 01 2012 - 02:51:10 EST


Hi Peter,

On Sun, Apr 01, 2012 at 12:00:00AM +0000, H. Peter Anvin wrote:
> On x86-32, we currently use int $0x80 as the primary system call
> mechanism. Although there are some recent variants available on
> certain hardware (sysenter, syscall) via the vdso, the primary system
> call vector is still way up the interrupt vector table, which is
> inefficient.
>
> This patch adds a very small amount of code which permits the very
> first vector to be used for system call. That vector is #DE, divide
> error, generally known as division by zero.

Looks like a clever trick, but beyond the beauty, what does it really
save ? Code size is the same as aam 0 / div edx are both 2-byte long,
just like int 0x80. Is the call less expensive ? And if so, how does
it compare to vdso ?

Thanks,
Willy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/