]> git.proxmox.com Git - mirror_edk2.git/commit
ArmVirtPkg/FdtParser: avoid unaligned accesses with the MMU off
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 13 Sep 2016 14:13:31 +0000 (15:13 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 13 Sep 2016 14:35:36 +0000 (15:35 +0100)
commit94a3845be698ddeed9d126363c755bd3bb13dd17
treef139d9214a4819384b29af663bca9a787f7fa79a
parentdd82465a9f0f0beff0e4d74c6e3192b966853332
ArmVirtPkg/FdtParser: avoid unaligned accesses with the MMU off

When parsing the device tree to find the memory node, we are still running
with the MMU off, which means unaligned memory accesses are not allowed.
Since the FDT only mandates 32-bit alignment, 64-bit quantities are not
guaranteed to appear naturally aligned, and so should be accessed using
32-bit accesses instead.

Reported-by: Julien Grall <julien.grall@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/FdtParser.c
ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c