From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751909Ab2DAGvP (ORCPT ); Sun, 1 Apr 2012 02:51:15 -0400 Received: from 1wt.eu ([62.212.114.60]:64011 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750903Ab2DAGvO (ORCPT ); Sun, 1 Apr 2012 02:51:14 -0400 Date: Sun, 1 Apr 2012 08:50:19 +0200 From: Willy Tarreau To: "H. Peter Anvin" Cc: Linus Torvalds , Ingo Molnar , Thomas Gleixner , Linux Kernel Mailing List , Arjan van de Ven Subject: Re: [PATCH] x86-32: A better system call mechanism Message-ID: <20120401065019.GA27590@1wt.eu> References: <201204010000.quickdontsayit@terminus.zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201204010000.quickdontsayit@terminus.zytor.com> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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