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: Paolo Bonzini
Subject: [Qemu-devel] Re: [PATCH 4/4] target-xxx: Use fprintf_function (format checking)
Date: Mon, 01 Nov 2010 12:03:48 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.4

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



reply via email to

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