From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1JCmw9-0001of-RT for user-mode-linux-devel@lists.sourceforge.net; Wed, 09 Jan 2008 18:14:29 -0800 Received: from saraswathi.solana.com ([198.99.130.12]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1JCmw9-0000Zv-AZ for user-mode-linux-devel@lists.sourceforge.net; Wed, 09 Jan 2008 18:14:29 -0800 Date: Wed, 9 Jan 2008 21:14:04 -0500 From: Jeff Dike Message-ID: <20080110021404.GA11287@c2.user-mode-linux.org> References: <20080109213258.GC15612@one.firstfloor.org> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: Subject: Re: [uml-devel] uml and -regparm=3 List-Id: The user-mode Linux development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: user-mode-linux-devel-bounces@lists.sourceforge.net Errors-To: user-mode-linux-devel-bounces@lists.sourceforge.net To: Miklos Szeredi Cc: akpm@linux-foundation.org, andi@firstfloor.org, linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net, harvey.harrison@gmail.com On Wed, Jan 09, 2008 at 10:50:48PM +0100, Miklos Szeredi wrote: > > FASTCALL is useless and should not make a difference. It enables > > regparm on specific functions, but that should not make a difference > > if it works or not. > > __down_write() in include/asm-x86/rwsem.h seems to assume, that the > semaphore pointer is passed in %eax down to rwsem_down_write_failed(), > so regparm does make a difference there. And rwsem_down_write_failed seems to think it's getting the pointer in %eax: Dump of assembler code for function rwsem_down_write_failed: 0x08193599 : push %ebp 0x0819359a : mov %esp,%ebp 0x0819359c : push %ebx 0x0819359d : mov %eax,%ebx 0x0819359f : sub $0x10,%esp 0x081935a2 : push $0xffffffff 0x081935a4 : lea 0xffffffec(%ebp),%eax 0x081935a7 : push %eax 0x081935a8 : push %ebx 0x081935a9 : movl $0x2,0xfffffff8(%ebp) 0x081935b0 : call 0x8193423 This is clearly taking something from %eax and something on the stack (and a -1) and passing it to rwsem_down_failed_common, corresponding to this: rwsem_down_failed_common(sem, &waiter, RWSEM_WAITING_BIAS - RWSEM_ACTIVE_BIAS); So, this does look right to me. Jeff -- Work email - jdike at linux dot intel dot com ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757625AbYAJCOr (ORCPT ); Wed, 9 Jan 2008 21:14:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754068AbYAJCOi (ORCPT ); Wed, 9 Jan 2008 21:14:38 -0500 Received: from saraswathi.solana.com ([198.99.130.12]:49897 "EHLO saraswathi.solana.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753750AbYAJCOh (ORCPT ); Wed, 9 Jan 2008 21:14:37 -0500 Date: Wed, 9 Jan 2008 21:14:04 -0500 From: Jeff Dike To: Miklos Szeredi Cc: andi@firstfloor.org, harvey.harrison@gmail.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net Subject: Re: uml and -regparm=3 Message-ID: <20080110021404.GA11287@c2.user-mode-linux.org> References: <20080109213258.GC15612@one.firstfloor.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 09, 2008 at 10:50:48PM +0100, Miklos Szeredi wrote: > > FASTCALL is useless and should not make a difference. It enables > > regparm on specific functions, but that should not make a difference > > if it works or not. > > __down_write() in include/asm-x86/rwsem.h seems to assume, that the > semaphore pointer is passed in %eax down to rwsem_down_write_failed(), > so regparm does make a difference there. And rwsem_down_write_failed seems to think it's getting the pointer in %eax: Dump of assembler code for function rwsem_down_write_failed: 0x08193599 : push %ebp 0x0819359a : mov %esp,%ebp 0x0819359c : push %ebx 0x0819359d : mov %eax,%ebx 0x0819359f : sub $0x10,%esp 0x081935a2 : push $0xffffffff 0x081935a4 : lea 0xffffffec(%ebp),%eax 0x081935a7 : push %eax 0x081935a8 : push %ebx 0x081935a9 : movl $0x2,0xfffffff8(%ebp) 0x081935b0 : call 0x8193423 This is clearly taking something from %eax and something on the stack (and a -1) and passing it to rwsem_down_failed_common, corresponding to this: rwsem_down_failed_common(sem, &waiter, RWSEM_WAITING_BIAS - RWSEM_ACTIVE_BIAS); So, this does look right to me. Jeff -- Work email - jdike at linux dot intel dot com