qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: QEMU Development <qemu-devel@nongnu.org>
Cc: Openrisc <openrisc@lists.librecores.org>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	Stafford Horne <shorne@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Jia Liu <proljc@gmail.com>
Subject: [PULL 1/4] hw/openrisc: page-align FDT address
Date: Sun, 15 May 2022 10:39:45 +0900	[thread overview]
Message-ID: <20220515013948.2993495-2-shorne@gmail.com> (raw)
In-Reply-To: <20220515013948.2993495-1-shorne@gmail.com>

From: "Jason A. Donenfeld" <Jason@zx2c4.com>

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c
index 8184caa60b..99b14940f4 100644
--- a/hw/openrisc/openrisc_sim.c
+++ b/hw/openrisc/openrisc_sim.c
@@ -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 */
-- 
2.31.1



  reply	other threads:[~2022-05-15  1:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15  1:39 [PULL 0/4] OpenRISC fixes for QEMU 2022-05-15 Stafford Horne
2022-05-15  1:39 ` Stafford Horne [this message]
2022-05-15  1:39 ` [PULL 2/4] hw/openrisc: support 4 serial ports in or1ksim Stafford Horne
2022-05-15  1:39 ` [PULL 3/4] hw/openrisc: use right OMPIC size variable Stafford Horne
2022-05-15  1:39 ` [PULL 4/4] target/openrisc: Do not reset delay slot flag on early tb exit Stafford Horne
2022-05-15 23:12 ` [PULL 0/4] OpenRISC fixes for QEMU 2022-05-15 Richard Henderson
2022-05-15 23:50   ` Stafford Horne

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-all 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=20220515013948.2993495-2-shorne@gmail.com \
    --to=shorne@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=openrisc@lists.librecores.org \
    --cc=peter.maydell@linaro.org \
    --cc=proljc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).