aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2024-07-08 15:55:13 +0900
committerNicholas Piggin <npiggin@gmail.com>2024-07-26 09:21:06 +1000
commit785c8637f9d2362a8addf4ded853d975955a9d6b (patch)
tree6de5c9dfaaa86bd58d1c30c2437ef1dc31ce0b49
parent8af863f2bd976b937f7e3d38b2ab1813b2fa1d9d (diff)
ppc/vof: Fix unaligned FDT property access
FDT properties are aligned by 4 bytes, not 8 bytes. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
-rw-r--r--hw/ppc/vof.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c
index e3b430a81f..b5b6514d79 100644
--- a/hw/ppc/vof.c
+++ b/hw/ppc/vof.c
@@ -646,7 +646,7 @@ static void vof_dt_memory_available(void *fdt, GArray *claimed, uint64_t base)
mem0_reg = fdt_getprop(fdt, offset, "reg", &proplen);
g_assert(mem0_reg && proplen == sizeof(uint32_t) * (ac + sc));
if (sc == 2) {
- mem0_end = be64_to_cpu(*(uint64_t *)(mem0_reg + sizeof(uint32_t) * ac));
+ mem0_end = ldq_be_p(mem0_reg + sizeof(uint32_t) * ac);
} else {
mem0_end = be32_to_cpu(*(uint32_t *)(mem0_reg + sizeof(uint32_t) * ac));
}