From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50627 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCsBC-0004gc-TQ for qemu-devel@nongnu.org; Mon, 01 Nov 2010 07:04:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCsBB-00058X-6d for qemu-devel@nongnu.org; Mon, 01 Nov 2010 07:03:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCsBA-00055J-W7 for qemu-devel@nongnu.org; Mon, 01 Nov 2010 07:03:57 -0400 Message-ID: <4CCE9E94.2030906@redhat.com> Date: Mon, 01 Nov 2010 12:03:48 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1287781413-26723-1-git-send-email-weil@mail.berlios.de> <1287781413-26723-4-git-send-email-weil@mail.berlios.de> <4CCE66CC.3080205@mail.berlios.de> <4CCE92FE.2080408@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 4/4] target-xxx: Use fprintf_function (format checking) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: TeLeMan , Blue Swirl , qemu-devel , Stefan Weil On 11/01/2010 11:27 AM, TeLeMan wrote: > On Mon, Nov 1, 2010 at 18:14, Paolo Bonzini 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