All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Richard Henderson <richard.henderson@linaro.org>,
	David Gibson <david@gibson.dropbear.id.au>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Paul Burton" <paul.burton@mips.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 2/2] loader: Fix 64-bit misaligned member access
Date: Mon, 23 Apr 2018 14:38:50 -0300	[thread overview]
Message-ID: <c397f644-db18-1193-d8b2-457989e2c55f@amsat.org> (raw)
In-Reply-To: <756704ca-f41d-d0ec-fb57-cd844b6164e6@linaro.org>

On 04/23/2018 02:34 PM, Richard Henderson wrote:
> On 04/23/2018 06:25 AM, Philippe Mathieu-Daudé wrote:
>> Assuming the base of the fdt is aligned, a 32-bit property returns
>> a 32-bit aligned pointer...
> ...
>>      case 4:
>> -        *addr = fdt32_to_cpu(*(fdt32_t *)prop);
>> +        *addr = fdt32_to_cpu(ldl_he_p(prop));
>>          return 0;
> 
> So why are you changing the 32-bit case?

First to not assume base fdt is always 32-bit aligned,
second to keep calls similar and avoid someone use *(fdt64_t *) similar
to the 32-bit property. But this is avoidable with a simple comment
about why we have to use ldq_he_p().

  reply	other threads:[~2018-04-23 17:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 16:25 [Qemu-devel] [PATCH v3 0/2] loader: Fix misaligned member access Philippe Mathieu-Daudé
2018-04-23 16:25 ` [Qemu-devel] [PATCH v3 1/2] bswap.h: Fix ldl_he_p() signedness Philippe Mathieu-Daudé
2018-04-23 16:56   ` Peter Maydell
2018-04-24 22:18     ` Philippe Mathieu-Daudé
2018-04-23 17:32   ` Richard Henderson
2018-05-25 14:06   ` Paolo Bonzini
2018-04-23 16:25 ` [Qemu-devel] [PATCH v3 2/2] loader: Fix 64-bit misaligned member access Philippe Mathieu-Daudé
2018-04-23 17:34   ` Richard Henderson
2018-04-23 17:38     ` Philippe Mathieu-Daudé [this message]
2018-05-25 14:07   ` Paolo Bonzini

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=c397f644-db18-1193-d8b2-457989e2c55f@amsat.org \
    --to=f4bug@amsat.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=marcandre.lureau@redhat.com \
    --cc=paul.burton@mips.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.