From: Rob Landley <rob@landley.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Porting QEMU to new hosts with unusual ABI (sizeof(long) != sizeof(void *))
Date: Thu, 10 Feb 2011 23:05:08 -0600 [thread overview]
Message-ID: <4D54C384.2000500@landley.net> (raw)
In-Reply-To: <4D4D612F.2010904@mail.berlios.de>
On 02/05/2011 08:39 AM, Stefan Weil wrote:
> Currently, most QEMU code assumes that pointers and long integers have
> the same size, typically 32 bit on 32 bit hosts, 64 bit on 64 bit hosts.
This is called the LP64 standard:
http://www.unix.org/whitepapers/64bit.html
Which was created for a reason:
http://www.unix.org/version2/whatsnew/lp64_wp.html
And which Linux, MacOSX, BSD, Solaris, android, iphone, you name it,
they all comply with.
> While this assumption works on QEMU's major hosts, it is not generally
> true.
It is generally true. There is exactly one operating system that
decided to go its own way, and the insane legacy reasons they did so are
explained here:
http://blogs.msdn.com/oldnewthing/archive/2005/01/31/363790.aspx
> There exist 64 bit host OS which use an ABI with 32 bit long integers,
> maybe to be more compatible with an older 32 bit OS version, so here is
> sizeof(long) < sizeof(void *).
You're implying that someone actually uses 64 bit windows?
On 32 bit hosts, LP64 is fine. Long and pointer match. So the obvious
fix is to build QEMU for 32 bits on windows.
> Other ABIs might use "near" pointers which may reduce code size and improve
> code speed. This results in sizeof(long) > sizeof(void *).
Um, "near pointer" was dos. That went away long enough ago that its
absence is just about old enough to vote.
> Both cases will break current QEMU, because lots of code lines use
> type casts from pointer to long or vice versa like these two examples:
Sucks to be Microsoft, doesn't it? They have billions of dollars to
comfort them.
Rob
next prev parent reply other threads:[~2011-02-11 5:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-05 14:39 [Qemu-devel] Porting QEMU to new hosts with unusual ABI (sizeof(long) != sizeof(void *)) Stefan Weil
2011-02-05 15:35 ` [Qemu-devel] " Blue Swirl
2011-02-05 21:47 ` Stefan Weil
2011-02-07 7:23 ` Markus Armbruster
2011-02-07 17:51 ` Stefan Weil
2011-02-07 18:16 ` Markus Armbruster
2011-02-05 16:03 ` [Qemu-devel] " Stefan Hajnoczi
2011-02-05 17:40 ` Stefan Weil
2011-02-11 5:05 ` Rob Landley [this message]
2011-02-11 12:47 ` [Qemu-devel] " Paolo Bonzini
2011-02-11 13:04 ` Tristan Gingold
2011-02-11 18:50 ` Blue Swirl
2011-02-11 19:28 ` malc
2011-02-11 8:24 ` [Qemu-devel] " Anthony Liguori
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=4D54C384.2000500@landley.net \
--to=rob@landley.net \
--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 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.