qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Thomas Steffen" <steffen.list.account@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] x86_64 vs. i386
Date: Sun, 20 Aug 2006 20:38:45 +0200	[thread overview]
Message-ID: <d7e2700f0608201138m21e50fcfu558aba6f02bba6be@mail.gmail.com> (raw)
In-Reply-To: <200607311258.48456.pg@futureware.at>

On 7/31/06, Philipp Gühring <pg@futureware.at> wrote:
[32bit vs 64bit libraries]
> Now I am wondering, whether it would be possible to integrate the processor
> emulator of qemu into the Linux kernel, so that applications can
> transparently use different-bitsized libraries by qemulating them on demand?

The problem is not running 32bit code, a 64bit kernel can do that
perfectly fine (with the correct 32bit libraries). The problem is that
32bit and 64bit code has a different ABI. Basically, if you call a
library function with an integer on the pointer, both are put on the
stack. In the 32bit ABI, they are both 4 byte values, but in the 64bit
ABI the pointer needs 8 bytes.

So when you want to call 64bit libraries from 32bit code, you would
need to convert the parameters on the stack, and for that you would
need to know what the parameters are. However, the library and the
code have no information on this, because it is only in the source
code, not in the binary.

There are more problems (address space, different register allocation
etc), but the function call sequence is the main problem. And qemu
cannot solve it.

Thomas

      reply	other threads:[~2006-08-20 18:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-31 10:58 [Qemu-devel] x86_64 vs. i386 Philipp Gühring
2006-08-20 18:38 ` Thomas Steffen [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=d7e2700f0608201138m21e50fcfu558aba6f02bba6be@mail.gmail.com \
    --to=steffen.list.account@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).