From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>
Subject: Re: [PATCH v2] ArmPlatformPkg/NorFlashDxe: use strictly aligned CopyMem()
Date: Fri, 9 Sep 2016 13:59:28 +0100 [thread overview]
Message-ID: <CAKv+Gu9=Ot-0GQfZ2iUfuE3juLEVSPwUHXY-yQDg=JHRQrn_QQ@mail.gmail.com> (raw)
In-Reply-To: <20160909123429.GP16080@bivouac.eciton.net>
On 9 September 2016 at 13:34, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Fri, Sep 09, 2016 at 01:18:22PM +0100, Ard Biesheuvel wrote:
>> The UEFI spec stipulates that unaligned accesses should be enabled
>> on CPUs that support them, which means all of them, given that we
>> no longer support pre-v7 ARM cores, and the AARCH64 bindings mandate
>> support for unaligned accesses unconditionally.
>>
>> This means that one should not assume that CopyMem () is safe to call
>> on regions that may be mapped using device attributes, which is the
>> case for the NOR flash. Since we have no control over the mappings when
>> running under the OS, and given that write accesses require device
>> mappings, we should not call CopyMem () in the read path either, but
>> use our own implementation that is guaranteed to take alignment into
>> account.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> That's a lot less complex, thanks.
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>
Pushed, thanks.
prev parent reply other threads:[~2016-09-09 12:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-09 12:18 [PATCH v2] ArmPlatformPkg/NorFlashDxe: use strictly aligned CopyMem() Ard Biesheuvel
2016-09-09 12:34 ` Leif Lindholm
2016-09-09 12:59 ` Ard Biesheuvel [this message]
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-list 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='CAKv+Gu9=Ot-0GQfZ2iUfuE3juLEVSPwUHXY-yQDg=JHRQrn_QQ@mail.gmail.com' \
--to=devel@edk2.groups.io \
/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