From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iy7w2-0004ib-TR for qemu-devel@nongnu.org; Fri, 30 Nov 2007 10:37:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iy7vz-0004hs-5J for qemu-devel@nongnu.org; Fri, 30 Nov 2007 10:37:46 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iy7vz-0004hp-03 for qemu-devel@nongnu.org; Fri, 30 Nov 2007 10:37:43 -0500 Received: from nf-out-0910.google.com ([64.233.182.190]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iy7vy-0000ap-6L for qemu-devel@nongnu.org; Fri, 30 Nov 2007 10:37:42 -0500 Received: by nf-out-0910.google.com with SMTP id 30so2519786nfu for ; Fri, 30 Nov 2007 07:37:36 -0800 (PST) Message-ID: Date: Fri, 30 Nov 2007 17:37:35 +0200 From: "Blue Swirl" Subject: Re: [Qemu-devel] [PATCH] [RESEND] hw/sh7750.c: use TARGET_FMT_plx to printf target_phys_addr_t In-Reply-To: <20071130152126.GC28369@tapir> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071111154922.GE25322@tapir> <20071118211837.GA15962@tapir> <20071130152126.GC28369@tapir> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 11/30/07, Carlo Marcelo Arenas Belon wrote: > On Fri, Nov 30, 2007 at 02:36:32PM +0900, Magnus Damm wrote: > > On Nov 19, 2007 6:18 AM, Carlo Marcelo Arenas Belon > > wrote: > > > The following patch changes the formatting string from %08x to TARGET_FMT_plx > > > to accommodate for compilation in 64bit hosts and that manifests with the > > > following warning : > > > > > > qemu/hw/sh7750.c: In function `error_access': > > > qemu/hw/sh7750.c:186: warning: unsigned int format, different type arg (arg 5) > > > qemu/hw/sh7750.c: In function `ignore_access': > > > qemu/hw/sh7750.c:192: warning: unsigned int format, different type arg (arg 5) > > > > This patch works fine on 32 bit x86 hosts. Please apply. > > Thanks, forgot to mention that I tested it of course as well in 32 bit x86 > where the code is equivalent as cpu-defs.h defines for 32 bit targets : > > #define TARGET_FMT_plx "%08x" > > For 64 bit targets, it will use a 64 bit type for physical addresses and > therefore a 64 bit wide format as defined by : > > #define TARGET_FMT_plx "%016" PRIx64 > > which might not be what was intended originally and might be uncovering a bug > somewhere else and based on the fact that apparently (and this gets confusing > as it seems to be inconsistently used everywhere in qemu) : > > target_phys_addr_t = physical address of the host > ram_addr_t = physical address of the guest No, target_phys_addr_t is the physical address of the emulated target system. For host addresses ram_addr_t, unsigned long or even int is used. Host addresses are of course virtual, Qemu is a user space application until someone makes it run in bare metal without OS. > and so all this function should had been using ram_addr_t instead, and that > would need to be redefined to be 64 bit safe and have as well a new formatting > string to match that. No.