qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 4/4] target-xxx: Use fprintf_function (format ch


From: Stefan Weil
Subject: [Qemu-devel] Re: [PATCH 4/4] target-xxx: Use fprintf_function (format checking)
Date: Mon, 01 Nov 2010 16:18:58 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Thunderbird/3.0.10

Am 01.11.2010 12:03, schrieb Paolo Bonzini:
On 11/01/2010 11:27 AM, TeLeMan wrote:
On Mon, Nov 1, 2010 at 18:14, Paolo Bonzini<address@hidden>  wrote:
On 11/01/2010 10:50 AM, TeLeMan wrote:

I think this patch is not right. Outputting 64bits data is not
necessary on 32bits mode.

Do you speak of 32 bit hosts or 32 bit targets?

32bit mode of x64

There is no such thing as a 32 bit host on x64, only 64-bit hosts that
haven't turned on long mode.  So printing 64 bits is correct for those.

If so, why the above crX is printed by 32 bits?

There are two issues. One is what type specifier to use (and it is a correctness issue), the other is what width to use (and it is an aesthetics issue). The patch fixes the correctness issue and makes the aesthetic part worse.

I agree that a better fix would be to cast to uint32_t as it is done for crX, but this patch is anyway better than nothing because right now DR7 is printed incorrectly _exactly on 64-bit guests running on 32-bit mode_.

An even better fix than uint32_t would be to introduce TARGET_FMT_8lx (which maps to "%08"PRI_x64) so that, if for some reason the high 32-bit are not zero, they will be shown.

Paolo

Yes. We already had a similar discussion about TARGET_FMT_PLX, see
http://www.mail-archive.com/address@hidden/msg42977.html.

There I suggested to define PRIxTPA (format specifier for a target
physical address). We could also add a PRIxTUL (for target_ulong),
so it would be possible to output "%04" PRIxTUL or "%08" PRIxTUL.
Thus we could avoid the need for TARGET_FMT_8lx, TARGET_FMT_4lx
and maybe even TARGET_FMT_2lx.

Kind regards,
Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]