From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] [RESEND] hw/sh7750.c: use TARGET_FMT_plx to printf target_phys_addr_t
Date: Fri, 30 Nov 2007 17:37:35 +0200 [thread overview]
Message-ID: <f43fc5580711300737y16a91e9bu3308a26122df4c8e@mail.gmail.com> (raw)
In-Reply-To: <20071130152126.GC28369@tapir>
On 11/30/07, Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> 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
> > <carenas@sajinet.com.pe> 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.
next prev parent reply other threads:[~2007-11-30 15:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-11 15:49 [Qemu-devel] [PATCH] hw/sh7750.c: use TARGET_FMT_plx to printf target_phys_addr_t Carlo Marcelo Arenas Belon
2007-11-18 21:18 ` [Qemu-devel] [PATCH] [RESEND] " Carlo Marcelo Arenas Belon
2007-11-30 5:36 ` Magnus Damm
2007-11-30 15:21 ` Carlo Marcelo Arenas Belon
2007-11-30 15:37 ` Blue Swirl [this message]
2007-11-30 16:11 ` Carlo Marcelo Arenas Belon
2007-11-30 16:50 ` Paul Brook
2007-11-30 17:16 ` Blue Swirl
2007-11-30 17:42 ` Paul Brook
2007-11-30 18:45 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f43fc5580711300737y16a91e9bu3308a26122df4c8e@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).