Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 20 Dec 2002 18:42:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 20 Dec 2002 18:42:56 -0500 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:59920 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Fri, 20 Dec 2002 18:42:55 -0500 Message-ID: <3E03ACCD.70600@transmeta.com> Date: Fri, 20 Dec 2002 15:50:37 -0800 From: "H. Peter Anvin" Organization: Transmeta Corporation User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021119 X-Accept-Language: en, sv MIME-Version: 1.0 To: Jamie Lokier CC: Linus Torvalds , Ulrich Drepper , bart@etpmod.phys.tue.nl, davej@codemonkey.org.uk, terje.eggestad@scali.com, matti.aarnio@zmailer.org, hugh@veritas.com, mingo@elte.hu, linux-kernel@vger.kernel.org Subject: Re: Intel P6 vs P7 system call performance References: <20021220120656.GA20674@bjl1.asuk.net> <20021220233825.GA22232@bjl1.asuk.net> In-Reply-To: <20021220233825.GA22232@bjl1.asuk.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 800 Lines: 32 Jamie Lokier wrote: > > No, your "real" code sequence is wrong. > > %ebx/%edi/%esi are preserved across sysenter/sysexit, whereas > %ecx/%edx are call-clobbered registers in the i386 function call ABI. > > This is not a coincidence. > > So, getpid looks like this with the _smaller_ vsyscall code: > > getpid(): > movl $__NR_getpid,%eax > call *%gs:0x18 > ret ... or just... getpid: movl $__NR_getpid, %eax jmp *%gs:0x18 This doesn't mess up the call/return stack, even, because the ret in the stub matches the call to getpid. -hpa - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/