From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41742 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCwAp-0006js-0e for qemu-devel@nongnu.org; Mon, 01 Nov 2010 11:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCwAF-0003mp-0C for qemu-devel@nongnu.org; Mon, 01 Nov 2010 11:19:16 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:56745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCwAE-0003mZ-IZ for qemu-devel@nongnu.org; Mon, 01 Nov 2010 11:19:14 -0400 Message-ID: <4CCEDA62.4060006@mail.berlios.de> Date: Mon, 01 Nov 2010 16:18:58 +0100 From: Stefan Weil 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> <4CCE9E94.2030906@redhat.com> In-Reply-To: <4CCE9E94.2030906@redhat.com> 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: Paolo Bonzini Cc: Blue Swirl , TeLeMan , qemu-devel 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 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/qemu-devel@nongnu.org/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