From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net,
"linux-os (Dick Johnson)" <linux-os@analogic.com>
Cc: "Jeff Dike" <jdike@addtoit.com>,
akpm@osdl.org, "Linux kernel" <linux-kernel@vger.kernel.org>
Subject: Re: [uml-devel] Re: [PATCH 3/4] UML - Properly invoke x86_64 system calls
Date: Fri, 18 Nov 2005 07:41:37 +0100 [thread overview]
Message-ID: <200511180741.37478.blaisorblade@yahoo.it> (raw)
In-Reply-To: <Pine.LNX.4.61.0511171528570.10664@chaos.analogic.com>
On Thursday 17 November 2005 21:37, linux-os (Dick Johnson) wrote:
> On Thu, 17 Nov 2005, Jeff Dike wrote:
> > This patch makes stub_segv use the stub_syscall macros. This was
> > needed anyway, but the bug that prompted this was the discovery that
> > gcc was storing stuff in RCX, which is trashed across a system
> > call.
> But the C-calling convention used by gcc for 32-bit systems
> is supposed to allow the called-function to destroy general-
> purpose registers but not index registers. In other words,
> ECX, EDX are supposed to be available and EAX is used for
> return-values. The register size isn't supposed to have
> anything to do with it (longword/quadword)!
> In 64-bit world, the same is supposed to apply as well.
> If RCX is now precious, it's a GCC bug that should be fixed.
It's not _normally_ precious, for function calling conventions, but syscalls
are different.
Read include/asm-x86_64/unistd.h and see that the _syscallX macros contain
various register clobber. I.e. they explicitly tell GCC "don't use that". We
(UML code) were missing that. Simple.
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Messenger: chiamate gratuite in tutto il mondo
http://it.messenger.yahoo.com
prev parent reply other threads:[~2005-11-18 6:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-17 21:10 [PATCH 3/4] UML - Properly invoke x86_64 system calls Jeff Dike
2005-11-17 20:37 ` linux-os (Dick Johnson)
2005-11-17 22:04 ` Jeff Dike
2005-11-18 6:41 ` Blaisorblade [this message]
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=200511180741.37478.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=akpm@osdl.org \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-os@analogic.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox