From: Jeff Dike <jdike@addtoit.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: akpm@linux-foundation.org, andi@firstfloor.org,
linux-kernel@vger.kernel.org,
user-mode-linux-devel@lists.sourceforge.net,
harvey.harrison@gmail.com
Subject: Re: [uml-devel] uml and -regparm=3
Date: Wed, 9 Jan 2008 21:14:04 -0500 [thread overview]
Message-ID: <20080110021404.GA11287@c2.user-mode-linux.org> (raw)
In-Reply-To: <E1JCioy-0006os-6i@pomaz-ex.szeredi.hu>
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 <rwsem_down_write_failed+0>: push %ebp
0x0819359a <rwsem_down_write_failed+1>: mov %esp,%ebp
0x0819359c <rwsem_down_write_failed+3>: push %ebx
0x0819359d <rwsem_down_write_failed+4>: mov %eax,%ebx
0x0819359f <rwsem_down_write_failed+6>: sub $0x10,%esp
0x081935a2 <rwsem_down_write_failed+9>: push $0xffffffff
0x081935a4 <rwsem_down_write_failed+11>: lea 0xffffffec(%ebp),%eax
0x081935a7 <rwsem_down_write_failed+14>: push %eax
0x081935a8 <rwsem_down_write_failed+15>: push %ebx
0x081935a9 <rwsem_down_write_failed+16>: movl $0x2,0xfffffff8(%ebp)
0x081935b0 <rwsem_down_write_failed+23>: call 0x8193423 <rwsem_down_failed_common>
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
WARNING: multiple messages have this Message-ID (diff)
From: Jeff Dike <jdike@addtoit.com>
To: Miklos Szeredi <miklos@szeredi.hu>
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
Date: Wed, 9 Jan 2008 21:14:04 -0500 [thread overview]
Message-ID: <20080110021404.GA11287@c2.user-mode-linux.org> (raw)
In-Reply-To: <E1JCioy-0006os-6i@pomaz-ex.szeredi.hu>
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 <rwsem_down_write_failed+0>: push %ebp
0x0819359a <rwsem_down_write_failed+1>: mov %esp,%ebp
0x0819359c <rwsem_down_write_failed+3>: push %ebx
0x0819359d <rwsem_down_write_failed+4>: mov %eax,%ebx
0x0819359f <rwsem_down_write_failed+6>: sub $0x10,%esp
0x081935a2 <rwsem_down_write_failed+9>: push $0xffffffff
0x081935a4 <rwsem_down_write_failed+11>: lea 0xffffffec(%ebp),%eax
0x081935a7 <rwsem_down_write_failed+14>: push %eax
0x081935a8 <rwsem_down_write_failed+15>: push %ebx
0x081935a9 <rwsem_down_write_failed+16>: movl $0x2,0xfffffff8(%ebp)
0x081935b0 <rwsem_down_write_failed+23>: call 0x8193423 <rwsem_down_failed_common>
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
next prev parent reply other threads:[~2008-01-10 2:14 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-09 21:01 [uml-devel] uml and -regparm=3 Miklos Szeredi
2008-01-09 21:01 ` Miklos Szeredi
2008-01-09 21:12 ` [uml-devel] " Andi Kleen
2008-01-09 21:12 ` Andi Kleen
2008-01-09 21:20 ` [uml-devel] " Miklos Szeredi
2008-01-09 21:20 ` Miklos Szeredi
2008-01-09 21:32 ` [uml-devel] " Andi Kleen
2008-01-09 21:32 ` Andi Kleen
2008-01-09 21:50 ` [uml-devel] " Miklos Szeredi
2008-01-09 21:50 ` Miklos Szeredi
2008-01-10 2:14 ` Jeff Dike [this message]
2008-01-10 2:14 ` Jeff Dike
2008-01-10 2:37 ` [uml-devel] " Andi Kleen
2008-01-10 2:37 ` Andi Kleen
2008-01-10 2:45 ` [uml-devel] " H. Peter Anvin
2008-01-10 2:45 ` H. Peter Anvin
2008-01-09 21:33 ` [uml-devel] " Adrian Bunk
2008-01-09 21:33 ` Adrian Bunk
2008-01-09 22:01 ` [uml-devel] " linux-os (Dick Johnson)
2008-01-09 22:01 ` linux-os (Dick Johnson)
2008-01-10 7:32 ` [uml-devel] " Ingo Molnar
2008-01-10 7:32 ` Ingo Molnar
2008-01-10 9:05 ` [uml-devel] " Miklos Szeredi
2008-01-10 9:05 ` Miklos Szeredi
2008-01-10 9:35 ` [uml-devel] " Ingo Molnar
2008-01-10 9:35 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080110021404.GA11287@c2.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=harvey.harrison@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.