From: Anthony Liguori <aliguori@us.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] build: fix target_phys_addr_t to 64-bit
Date: Thu, 12 Jan 2012 16:56:46 -0600 [thread overview]
Message-ID: <4F0F652E.6010307@us.ibm.com> (raw)
In-Reply-To: <CAFEAcA-89BZC5=5+AJ3U2HLNGeiovAHD67nf0K7mMP5T6Vxe_g@mail.gmail.com>
On 01/12/2012 04:46 PM, Peter Maydell wrote:
> On 12 January 2012 22:42, Peter Maydell<peter.maydell@linaro.org> wrote:
>> You're the one changing what was previously a known-to-be-32-bit
>> type to one that's much bigger, you get to fix the printing
>> issues.
This code is broken in its current form. target_phys_addr_t has an unspecified
width which is why we provide a FMT for it.
Assuming it's 32-bit is just as bad as assuming that all hosts are 64-bit or all
guests are little endian. It may have worked up until now for a particular
device, but it doesn't change the fact that it was wrong.
> ...which isn't to say that I don't think this is a good
> plan (indeed I suspect I'm going to need wider physaddrs
> for Cortex-A15 at some point :-)), just that I think we
> ought to have at least a sketch of how the average device
> for which the offset is going to be<4096,
I think a reasonable thing to do is:
#define PRIp64 "0x%08" PRIx64
s:TARGET_FMT_plx:PRIp64:g
Then in places where desired, you can just use PRIx64 directly to specify a
custom width.
But that's a touch-everything change that I think should be done in a separate
series.
> let alone<32bits
> can print messages involving the offsets without it looking
> really ugly in either the code or the output (and that
> where in this patch you're actually touching output formats
> you should use whatever the reasonable-looking thing is
> rather than just something that compiles.)
To print a target_phys_addr_t, you need to use TARGET_FMT_plx. If code wasn't
using TARGET_FMT_plx, then it was broken.
If you want something more flexible than TARGET_FMT_plx, I'm supportive of that,
but that should have been done to begin with instead of making bad assumptions
about sizeof(target_phys_addr_t).
Regards,
Anthony Liguori
> -- PMM
>
next prev parent reply other threads:[~2012-01-12 22:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 17:54 [Qemu-devel] [PATCH] build: fix target_phys_addr_t to 64-bit Anthony Liguori
2012-01-12 18:51 ` Andreas Färber
2012-01-12 20:06 ` Peter Maydell
2012-01-12 20:32 ` Anthony Liguori
2012-01-12 22:42 ` Peter Maydell
2012-01-12 22:46 ` Peter Maydell
2012-01-12 22:56 ` Anthony Liguori [this message]
2012-01-12 23:29 ` Peter Maydell
2012-01-12 23:47 ` Andreas Färber
2012-01-13 1:13 ` Peter Maydell
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=4F0F652E.6010307@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=peter.maydell@linaro.org \
--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).