From: Stefan Weil <weil@mail.berlios.de>
To: Markus Armbruster <armbru@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Re: Porting QEMU to new hosts with unusual ABI (sizeof(long) != sizeof(void *))
Date: Mon, 07 Feb 2011 18:51:46 +0100 [thread overview]
Message-ID: <4D503132.3010807@mail.berlios.de> (raw)
In-Reply-To: <m339o0jokj.fsf@blackfin.pond.sub.org>
Am 07.02.2011 08:23, schrieb Markus Armbruster:
> Stefan Weil <weil@mail.berlios.de> writes:
>> Am 05.02.2011 16:35, schrieb Blue Swirl:
> [...]
>>> The patch changes also signed longs to uintptr_t. That could introduce
>>> regressions, so please use signed/unsigned as original.
>>
>> I changed the code manually, and there was only one location where
>> signed/unsigned made a difference. That single case was an int
>> parameter passed in a void pointer, and I used intptr_t there.
>>
>> I had the impression that in the current code (long) was
>> sometimes used because it is shorter than (unsigned long) :-)
>>
>> As long as changes are made manually with the necessary care,
>> I'd recommend using uintptr_t where possible.
>
> I'd recommend not to mix up the intptr portability clean up with the
> signedness cleanup. Much easier to review separately. Moreover,
> cleaning up signedness changes generated code, while cleaning up the
> types shouldn't (except on hosts where the code doesn't work).
> Testable, just don't forget to strip the debug info.
>
> [...]
Markus, your recommendation is ok for modifications which change the
generated code or which need more context for the review.
I don't think that you will have any problem with reviewing
"signedness changes" like these ones:
-#define saddr(x) (uint8_t *)(long)(x)
-#define laddr(x) (uint8_t *)(long)(x)
+#define saddr(x) (uint8_t *)(uintptr_t)(x)
+#define laddr(x) (uint8_t *)(uintptr_t)(x)
Neither of these changes changes the binary code for the commonly used
hosts,
and the patch does not need further context for the review.
I intend to split my patch in three parts:
* one for tcg_gen_exit_tb calls which will be modified as Blue Swirl has
suggested
* one for the parameter passing of a signed value via pointer
* one for the rest which contains only a handful of trivial "signedness
changes",
all following the same pattern like the example given above
Is that ok?
Regards,
Stefan
next prev parent reply other threads:[~2011-02-07 21:13 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 [this message]
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
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=4D503132.3010807@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=armbru@redhat.com \
--cc=blauwirbel@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 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.