[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 2/9] ppc/vof: Fix unaligned FDT property access
From: |
Akihiko Odaki |
Subject: |
[PATCH v3 2/9] ppc/vof: Fix unaligned FDT property access |
Date: |
Mon, 08 Jul 2024 15:55:13 +0900 |
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>
---
hw/ppc/vof.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c
index e3b430a81f4f..b5b6514d79fc 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));
}
--
2.45.2
- [PATCH v3 0/9] Fix check-qtest-ppc64 sanitizer errors, Akihiko Odaki, 2024/07/08
- [PATCH v3 1/9] spapr: Free stdout path, Akihiko Odaki, 2024/07/08
- [PATCH v3 2/9] ppc/vof: Fix unaligned FDT property access,
Akihiko Odaki <=
- [PATCH v3 3/9] migration: Free removed SaveStateEntry, Akihiko Odaki, 2024/07/08
- [PATCH v3 4/9] memory: Do not refer to "memory region's reference count", Akihiko Odaki, 2024/07/08
- [PATCH v3 5/9] memory: Refer to docs/devel/memory.rst for "owner", Akihiko Odaki, 2024/07/08
- [PATCH v3 6/9] memory: Clarify that owner may be missing, Akihiko Odaki, 2024/07/08
- [PATCH v3 8/9] memory: Do not create circular reference with subregion, Akihiko Odaki, 2024/07/08
- [PATCH v3 7/9] memory: Clarify owner must not call memory_region_ref(), Akihiko Odaki, 2024/07/08
- [PATCH v3 9/9] tests/qtest: Delete previous boot file, Akihiko Odaki, 2024/07/08