]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/openrisc: page-align FDT address
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 28 Apr 2022 10:35:16 +0000 (12:35 +0200)
committerStafford Horne <shorne@gmail.com>
Tue, 3 May 2022 20:23:37 +0000 (05:23 +0900)
The QEMU-provided FDT was only being recognized by the kernel when it
was used in conjunction with -initrd. Without it, the magic bytes
wouldn't be there and the kernel couldn't load it. This patch fixes the
issue by page aligning the provided FDT.

Cc: Stafford Horne <shorne@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Stafford Horne <shorne@gmail.com>
hw/openrisc/openrisc_sim.c

index 8184caa60b882b483c76d4790b4523a2e222f925..99b14940f4ea7594c61e49e71a6379f161956170 100644 (file)
@@ -356,7 +356,7 @@ static uint32_t openrisc_load_fdt(Or1ksimState *state, hwaddr load_start,
     }
 
     /* We put fdt right after the kernel and/or initrd. */
-    fdt_addr = ROUND_UP(load_start, 4);
+    fdt_addr = TARGET_PAGE_ALIGN(load_start);
 
     ret = fdt_pack(fdt);
     /* Should only fail if we've built a corrupted tree */